From e6298b23633c1eccf0334c897897df5f0c452ba8 Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Wed, 5 Oct 2022 01:51:53 +0800 Subject: [PATCH] refactor: button widgets --- lib/screens/bb_issue_comment.dart | 5 +++-- lib/screens/bb_issue_form.dart | 5 +++-- lib/screens/ge_issue_comment.dart | 5 +++-- lib/screens/gh_issue_form.dart | 5 +++-- lib/screens/gl_issue_form.dart | 5 +++-- lib/screens/gt_issue_comment.dart | 5 +++-- lib/screens/gt_issue_form.dart | 5 +++-- 7 files changed, 21 insertions(+), 14 deletions(-) diff --git a/lib/screens/bb_issue_comment.dart b/lib/screens/bb_issue_comment.dart index 79b6fec..bdd8dd3 100644 --- a/lib/screens/bb_issue_comment.dart +++ b/lib/screens/bb_issue_comment.dart @@ -39,9 +39,10 @@ class _BbIssueCommentScreenState extends State { 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, diff --git a/lib/screens/bb_issue_form.dart b/lib/screens/bb_issue_form.dart index 5c4eab4..36635b0 100644 --- a/lib/screens/bb_issue_form.dart +++ b/lib/screens/bb_issue_form.dart @@ -52,9 +52,10 @@ class _BbIssueFormScreenState extends State { 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, diff --git a/lib/screens/ge_issue_comment.dart b/lib/screens/ge_issue_comment.dart index f7d3f45..6f2e0d4 100644 --- a/lib/screens/ge_issue_comment.dart +++ b/lib/screens/ge_issue_comment.dart @@ -49,9 +49,10 @@ class _GeIssueCommentScreenState extends State { 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', diff --git a/lib/screens/gh_issue_form.dart b/lib/screens/gh_issue_form.dart index 454e210..c0e27d4 100644 --- a/lib/screens/gh_issue_form.dart +++ b/lib/screens/gh_issue_form.dart @@ -51,9 +51,10 @@ class _GhIssueFormScreenState extends State { 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() diff --git a/lib/screens/gl_issue_form.dart b/lib/screens/gl_issue_form.dart index 126c937..525f986 100644 --- a/lib/screens/gl_issue_form.dart +++ b/lib/screens/gl_issue_form.dart @@ -51,9 +51,10 @@ class _GlIssueFormScreenState extends State { 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, diff --git a/lib/screens/gt_issue_comment.dart b/lib/screens/gt_issue_comment.dart index 407beb6..1de60e1 100644 --- a/lib/screens/gt_issue_comment.dart +++ b/lib/screens/gt_issue_comment.dart @@ -49,9 +49,10 @@ class _GtIssueCommentScreenState extends State { 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', diff --git a/lib/screens/gt_issue_form.dart b/lib/screens/gt_issue_form.dart index 6d1f78b..885cdb0 100644 --- a/lib/screens/gt_issue_form.dart +++ b/lib/screens/gt_issue_form.dart @@ -52,9 +52,10 @@ class _GtIssueFormScreenState extends State { 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',