diff --git a/lib/screens/issue.dart b/lib/screens/issue.dart index 3eb3cf0..0e78b08 100644 --- a/lib/screens/issue.dart +++ b/lib/screens/issue.dart @@ -344,13 +344,13 @@ mutation { return ActionButton( title: (isPullRequest ? 'Pull Request' : 'Issue') + ' Actions', actions: [ - Action( + MyAction( text: 'Share', onPress: () { Share.share(payload['url']); }, ), - Action( + MyAction( text: 'Open in Browser', onPress: () { launch(payload['url']); diff --git a/lib/screens/news.dart b/lib/screens/news.dart index 02678f0..058a59b 100644 --- a/lib/screens/news.dart +++ b/lib/screens/news.dart @@ -74,14 +74,14 @@ class NewsScreenState extends State { return ActionButton( title: 'Filter', actions: [ - Action( + MyAction( text: 'Show all items', onPress: () { filter = NewsFilter.all; refresh(force: true); }, ), - Action( + MyAction( text: 'Only GitHub items', onPress: () { filter = NewsFilter.github; diff --git a/lib/screens/organization.dart b/lib/screens/organization.dart index 8dc805b..c700774 100644 --- a/lib/screens/organization.dart +++ b/lib/screens/organization.dart @@ -135,13 +135,13 @@ class _OrganizationScreenState extends State { title: Text(widget.login), trailingBuilder: (payload) { return ActionButton(title: 'User Actions', actions: [ - Action( + MyAction( text: 'Share', onPress: () { Share.share(payload['url']); }, ), - Action( + MyAction( text: 'Open in Browser', onPress: () { launch(payload['url']); diff --git a/lib/screens/repo.dart b/lib/screens/repo.dart index 8ec6761..22fc1d4 100644 --- a/lib/screens/repo.dart +++ b/lib/screens/repo.dart @@ -94,7 +94,7 @@ class _RepoScreenState extends State { var payload = data[0]; return ActionButton(title: 'Repository Actions', actions: [ - Action( + MyAction( text: '@$owner', onPress: () { WidgetBuilder builder; @@ -117,7 +117,7 @@ class _RepoScreenState extends State { .pushRoute(context: context, builder: builder); }, ), - Action( + MyAction( text: payload['viewerHasStarred'] ? 'Unstar' : 'Star', onPress: () async { if (payload['viewerHasStarred']) { @@ -132,13 +132,13 @@ class _RepoScreenState extends State { }, ), // TODO: watch - Action( + MyAction( text: 'Share', onPress: () { Share.share(payload['url']); }, ), - Action( + MyAction( text: 'Open in Browser', onPress: () { launch(payload['url']); @@ -147,9 +147,9 @@ class _RepoScreenState extends State { ]); }, onRefresh: () => Future.wait([ - queryRepo(context), - fetchReadme(context), - ]), + queryRepo(context), + fetchReadme(context), + ]), bodyBuilder: (data) { var payload = data[0]; var readme = data[1]; @@ -170,18 +170,18 @@ class _RepoScreenState extends State { count: payload['issues']['totalCount'], text: 'Issues', screenBuilder: (context) => IssuesScreen( - owner: widget.owner, - name: widget.name, - ), + owner: widget.owner, + name: widget.name, + ), ), EntryItem( count: payload['pullRequests']['totalCount'], text: 'Pull Requests', screenBuilder: (context) => IssuesScreen( - owner: widget.owner, - name: widget.name, - isPullRequest: true, - ), + owner: widget.owner, + name: widget.name, + isPullRequest: true, + ), ), EntryItem( text: 'Files', diff --git a/lib/screens/user.dart b/lib/screens/user.dart index 1a11ad9..4c24857 100644 --- a/lib/screens/user.dart +++ b/lib/screens/user.dart @@ -163,10 +163,10 @@ class _UserScreenState extends State { fullscreenDialog: true, ); } else { - List actions = []; + List actions = []; if (payload['viewerCanFollow']) { - actions.add(Action( + actions.add(MyAction( text: payload['viewerIsFollowing'] ? 'Unfollow' : 'Follow', onPress: () async { if (payload['viewerIsFollowing']) { @@ -183,13 +183,13 @@ class _UserScreenState extends State { } actions.addAll([ - Action( + MyAction( text: 'Share', onPress: () { Share.share(payload['url']); }, ), - Action( + MyAction( text: 'Open in Browser', onPress: () { launch(payload['url']); diff --git a/lib/widgets/action.dart b/lib/widgets/action.dart index eb368f7..122bd37 100644 --- a/lib/widgets/action.dart +++ b/lib/widgets/action.dart @@ -2,16 +2,16 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import '../providers/settings.dart'; -class Action { +class MyAction { String text; Function onPress; - Action({@required this.text, @required this.onPress}); + MyAction({@required this.text, @required this.onPress}); } class ActionButton extends StatelessWidget { final String title; - final List actions; + final List actions; final IconData iconData; ActionButton({