refactor: button widgets
This commit is contained in:
parent
3953544d55
commit
e6298b2363
|
@ -39,9 +39,10 @@ class _BbIssueCommentScreenState extends State<BbIssueCommentScreen> {
|
|||
maxLines: 10,
|
||||
),
|
||||
),
|
||||
CupertinoButton.filled(
|
||||
AntButton(
|
||||
color: AntTheme.of(context).colorPrimary,
|
||||
child: const Text('Comment'),
|
||||
onPressed: () async {
|
||||
onClick: () async {
|
||||
await auth.fetchBb(
|
||||
'/repositories/${widget.owner}/${widget.name}/issues/${widget.number}/comments',
|
||||
isPost: true,
|
||||
|
|
|
@ -52,9 +52,10 @@ class _BbIssueFormScreenState extends State<BbIssueFormScreen> {
|
|||
maxLines: 10,
|
||||
),
|
||||
),
|
||||
CupertinoButton.filled(
|
||||
AntButton(
|
||||
color: AntTheme.of(context).colorPrimary,
|
||||
child: Text(AppLocalizations.of(context)!.submit),
|
||||
onPressed: () async {
|
||||
onClick: () async {
|
||||
await auth.fetchBbJson(
|
||||
'/repositories/${widget.owner}/${widget.name}/issues',
|
||||
isPost: true,
|
||||
|
|
|
@ -49,9 +49,10 @@ class _GeIssueCommentScreenState extends State<GeIssueCommentScreen> {
|
|||
maxLines: 10,
|
||||
),
|
||||
),
|
||||
CupertinoButton.filled(
|
||||
AntButton(
|
||||
color: AntTheme.of(context).colorPrimary,
|
||||
child: const Text('Comment'),
|
||||
onPressed: () async {
|
||||
onClick: () async {
|
||||
if (!isEdit) {
|
||||
await auth.fetchGitee(
|
||||
'/repos/${widget.owner}/${widget.name}/${widget.isPr ? 'pulls' : 'issues'}/${widget.number}/comments',
|
||||
|
|
|
@ -51,9 +51,10 @@ class _GhIssueFormScreenState extends State<GhIssueFormScreen> {
|
|||
maxLines: 10,
|
||||
),
|
||||
),
|
||||
CupertinoButton.filled(
|
||||
AntButton(
|
||||
color: AntTheme.of(context).colorPrimary,
|
||||
child: Text(AppLocalizations.of(context)!.submit),
|
||||
onPressed: () async {
|
||||
onClick: () async {
|
||||
final slug = RepositorySlug(widget.owner, widget.name);
|
||||
final res = await context
|
||||
.read<AuthModel>()
|
||||
|
|
|
@ -51,9 +51,10 @@ class _GlIssueFormScreenState extends State<GlIssueFormScreen> {
|
|||
maxLines: 10,
|
||||
),
|
||||
),
|
||||
CupertinoButton.filled(
|
||||
AntButton(
|
||||
color: AntTheme.of(context).colorPrimary,
|
||||
child: Text(AppLocalizations.of(context)!.submit),
|
||||
onPressed: () async {
|
||||
onClick: () async {
|
||||
final res = await auth.fetchGitlab(
|
||||
'/projects/${widget.id}/issues',
|
||||
isPost: true,
|
||||
|
|
|
@ -49,9 +49,10 @@ class _GtIssueCommentScreenState extends State<GtIssueCommentScreen> {
|
|||
maxLines: 10,
|
||||
),
|
||||
),
|
||||
CupertinoButton.filled(
|
||||
AntButton(
|
||||
color: AntTheme.of(context).colorPrimary,
|
||||
child: const Text('Comment'),
|
||||
onPressed: () async {
|
||||
onClick: () async {
|
||||
if (!isEdit) {
|
||||
await auth.fetchGitea(
|
||||
'/repos/${widget.owner}/${widget.name}/${widget.isPr ? 'pulls' : 'issues'}/${widget.number}/comments',
|
||||
|
|
|
@ -52,9 +52,10 @@ class _GtIssueFormScreenState extends State<GtIssueFormScreen> {
|
|||
maxLines: 10,
|
||||
),
|
||||
),
|
||||
CupertinoButton.filled(
|
||||
AntButton(
|
||||
color: AntTheme.of(context).colorPrimary,
|
||||
child: Text(AppLocalizations.of(context)!.submit),
|
||||
onPressed: () async {
|
||||
onClick: () async {
|
||||
await auth.fetchGitea(
|
||||
'/repos/${widget.owner}/${widget.name}/issues',
|
||||
requestType: 'POST',
|
||||
|
|
Loading…
Reference in New Issue