1
0
mirror of https://github.com/git-touch/git-touch synced 2025-01-31 08:04:51 +01:00

fix: duplicated class name

This commit is contained in:
Rongjian Zhang 2019-06-20 22:59:13 +08:00
parent bd131b0ef3
commit af25486a9c
6 changed files with 27 additions and 27 deletions

View File

@ -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']);

View File

@ -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;

View File

@ -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']);

View File

@ -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;
@ -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']) {
@ -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']);
@ -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];
@ -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',

View File

@ -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']) {
@ -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']);

View File

@ -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({