Skip to content

Commit

Permalink
fix: duplicated class name
Browse files Browse the repository at this point in the history
  • Loading branch information
pd4d10 committed Jun 20, 2019
1 parent bd131b0 commit af25486
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions lib/screens/issue.dart
Expand Up @@ -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']);
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/news.dart
Expand Up @@ -74,14 +74,14 @@ class NewsScreenState extends State<NewsScreen> {
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;
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/organization.dart
Expand Up @@ -135,13 +135,13 @@ class _OrganizationScreenState extends State<OrganizationScreen> {
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']);
Expand Down
28 changes: 14 additions & 14 deletions lib/screens/repo.dart
Expand Up @@ -94,7 +94,7 @@ class _RepoScreenState extends State<RepoScreen> {
var payload = data[0];

return ActionButton(title: 'Repository Actions', actions: [
Action(
MyAction(
text: '@$owner',
onPress: () {
WidgetBuilder builder;
Expand All @@ -117,7 +117,7 @@ class _RepoScreenState extends State<RepoScreen> {
.pushRoute(context: context, builder: builder);
},
),
Action(
MyAction(
text: payload['viewerHasStarred'] ? 'Unstar' : 'Star',
onPress: () async {
if (payload['viewerHasStarred']) {
Expand All @@ -132,13 +132,13 @@ class _RepoScreenState extends State<RepoScreen> {
},
),
// TODO: watch
Action(
MyAction(
text: 'Share',
onPress: () {
Share.share(payload['url']);
},
),
Action(
MyAction(
text: 'Open in Browser',
onPress: () {
launch(payload['url']);
Expand All @@ -147,9 +147,9 @@ class _RepoScreenState extends State<RepoScreen> {
]);
},
onRefresh: () => Future.wait([
queryRepo(context),
fetchReadme(context),
]),
queryRepo(context),
fetchReadme(context),
]),
bodyBuilder: (data) {
var payload = data[0];
var readme = data[1];
Expand All @@ -170,18 +170,18 @@ class _RepoScreenState extends State<RepoScreen> {
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',
Expand Down
8 changes: 4 additions & 4 deletions lib/screens/user.dart
Expand Up @@ -163,10 +163,10 @@ class _UserScreenState extends State<UserScreen> {
fullscreenDialog: true,
);
} else {
List<Action> actions = [];
List<MyAction> actions = [];

if (payload['viewerCanFollow']) {
actions.add(Action(
actions.add(MyAction(
text: payload['viewerIsFollowing'] ? 'Unfollow' : 'Follow',
onPress: () async {
if (payload['viewerIsFollowing']) {
Expand All @@ -183,13 +183,13 @@ class _UserScreenState extends State<UserScreen> {
}

actions.addAll([
Action(
MyAction(
text: 'Share',
onPress: () {
Share.share(payload['url']);
},
),
Action(
MyAction(
text: 'Open in Browser',
onPress: () {
launch(payload['url']);
Expand Down
6 changes: 3 additions & 3 deletions lib/widgets/action.dart
Expand Up @@ -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<Action> actions;
final List<MyAction> actions;
final IconData iconData;

ActionButton({
Expand Down

0 comments on commit af25486

Please sign in to comment.