refactor: button widgets

This commit is contained in:
Rongjian Zhang 2022-10-05 01:51:53 +08:00
parent 3953544d55
commit e6298b2363
7 changed files with 21 additions and 14 deletions

View File

@ -39,9 +39,10 @@ class _BbIssueCommentScreenState extends State<BbIssueCommentScreen> {
maxLines: 10, maxLines: 10,
), ),
), ),
CupertinoButton.filled( AntButton(
color: AntTheme.of(context).colorPrimary,
child: const Text('Comment'), child: const Text('Comment'),
onPressed: () async { onClick: () async {
await auth.fetchBb( await auth.fetchBb(
'/repositories/${widget.owner}/${widget.name}/issues/${widget.number}/comments', '/repositories/${widget.owner}/${widget.name}/issues/${widget.number}/comments',
isPost: true, isPost: true,

View File

@ -52,9 +52,10 @@ class _BbIssueFormScreenState extends State<BbIssueFormScreen> {
maxLines: 10, maxLines: 10,
), ),
), ),
CupertinoButton.filled( AntButton(
color: AntTheme.of(context).colorPrimary,
child: Text(AppLocalizations.of(context)!.submit), child: Text(AppLocalizations.of(context)!.submit),
onPressed: () async { onClick: () async {
await auth.fetchBbJson( await auth.fetchBbJson(
'/repositories/${widget.owner}/${widget.name}/issues', '/repositories/${widget.owner}/${widget.name}/issues',
isPost: true, isPost: true,

View File

@ -49,9 +49,10 @@ class _GeIssueCommentScreenState extends State<GeIssueCommentScreen> {
maxLines: 10, maxLines: 10,
), ),
), ),
CupertinoButton.filled( AntButton(
color: AntTheme.of(context).colorPrimary,
child: const Text('Comment'), child: const Text('Comment'),
onPressed: () async { onClick: () async {
if (!isEdit) { if (!isEdit) {
await auth.fetchGitee( await auth.fetchGitee(
'/repos/${widget.owner}/${widget.name}/${widget.isPr ? 'pulls' : 'issues'}/${widget.number}/comments', '/repos/${widget.owner}/${widget.name}/${widget.isPr ? 'pulls' : 'issues'}/${widget.number}/comments',

View File

@ -51,9 +51,10 @@ class _GhIssueFormScreenState extends State<GhIssueFormScreen> {
maxLines: 10, maxLines: 10,
), ),
), ),
CupertinoButton.filled( AntButton(
color: AntTheme.of(context).colorPrimary,
child: Text(AppLocalizations.of(context)!.submit), child: Text(AppLocalizations.of(context)!.submit),
onPressed: () async { onClick: () async {
final slug = RepositorySlug(widget.owner, widget.name); final slug = RepositorySlug(widget.owner, widget.name);
final res = await context final res = await context
.read<AuthModel>() .read<AuthModel>()

View File

@ -51,9 +51,10 @@ class _GlIssueFormScreenState extends State<GlIssueFormScreen> {
maxLines: 10, maxLines: 10,
), ),
), ),
CupertinoButton.filled( AntButton(
color: AntTheme.of(context).colorPrimary,
child: Text(AppLocalizations.of(context)!.submit), child: Text(AppLocalizations.of(context)!.submit),
onPressed: () async { onClick: () async {
final res = await auth.fetchGitlab( final res = await auth.fetchGitlab(
'/projects/${widget.id}/issues', '/projects/${widget.id}/issues',
isPost: true, isPost: true,

View File

@ -49,9 +49,10 @@ class _GtIssueCommentScreenState extends State<GtIssueCommentScreen> {
maxLines: 10, maxLines: 10,
), ),
), ),
CupertinoButton.filled( AntButton(
color: AntTheme.of(context).colorPrimary,
child: const Text('Comment'), child: const Text('Comment'),
onPressed: () async { onClick: () async {
if (!isEdit) { if (!isEdit) {
await auth.fetchGitea( await auth.fetchGitea(
'/repos/${widget.owner}/${widget.name}/${widget.isPr ? 'pulls' : 'issues'}/${widget.number}/comments', '/repos/${widget.owner}/${widget.name}/${widget.isPr ? 'pulls' : 'issues'}/${widget.number}/comments',

View File

@ -52,9 +52,10 @@ class _GtIssueFormScreenState extends State<GtIssueFormScreen> {
maxLines: 10, maxLines: 10,
), ),
), ),
CupertinoButton.filled( AntButton(
color: AntTheme.of(context).colorPrimary,
child: Text(AppLocalizations.of(context)!.submit), child: Text(AppLocalizations.of(context)!.submit),
onPressed: () async { onClick: () async {
await auth.fetchGitea( await auth.fetchGitea(
'/repos/${widget.owner}/${widget.name}/issues', '/repos/${widget.owner}/${widget.name}/issues',
requestType: 'POST', requestType: 'POST',