refactor: replace icons
This commit is contained in:
parent
07d39100d7
commit
020852f0ab
|
@ -18,8 +18,8 @@ class CodeModel with ChangeNotifier {
|
||||||
'Cascadia Code',
|
'Cascadia Code',
|
||||||
];
|
];
|
||||||
|
|
||||||
String _theme = 'tomorrow';
|
String _theme = 'vs';
|
||||||
String _themeDark = 'tomorrow-night';
|
String _themeDark = 'vs2015';
|
||||||
int _fontSize = 14;
|
int _fontSize = 14;
|
||||||
String _fontFamily = 'JetBrains Mono';
|
String _fontFamily = 'JetBrains Mono';
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ class BbObjectScreen extends StatelessWidget {
|
||||||
actionBuilder: (p, _) {
|
actionBuilder: (p, _) {
|
||||||
if (p is String) {
|
if (p is String) {
|
||||||
return ActionEntry(
|
return ActionEntry(
|
||||||
iconData: Icons.settings,
|
iconData: Ionicons.cog,
|
||||||
url: '/choose-code-theme',
|
url: '/choose-code-theme',
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -42,7 +42,7 @@ class BbUserScreen extends StatelessWidget {
|
||||||
},
|
},
|
||||||
action: isViewer
|
action: isViewer
|
||||||
? ActionEntry(
|
? ActionEntry(
|
||||||
iconData: Icons.settings,
|
iconData: Ionicons.cog,
|
||||||
url: '/settings',
|
url: '/settings',
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
|
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:git_touch/models/auth.dart';
|
import 'package:git_touch/models/auth.dart';
|
||||||
import 'package:git_touch/models/gitee.dart';
|
import 'package:git_touch/models/gitee.dart';
|
||||||
import 'package:git_touch/scaffolds/refresh_stateful.dart';
|
import 'package:git_touch/scaffolds/refresh_stateful.dart';
|
||||||
|
import 'package:git_touch/utils/utils.dart';
|
||||||
import 'package:git_touch/widgets/action_entry.dart';
|
import 'package:git_touch/widgets/action_entry.dart';
|
||||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||||
import 'package:git_touch/widgets/blob_view.dart';
|
import 'package:git_touch/widgets/blob_view.dart';
|
||||||
|
@ -24,7 +25,7 @@ class GeBlobScreen extends StatelessWidget {
|
||||||
final res = await auth.fetchGitee('/repos/$owner/$name/git/blobs/$sha');
|
final res = await auth.fetchGitee('/repos/$owner/$name/git/blobs/$sha');
|
||||||
return GiteeBlob.fromJson(res).content;
|
return GiteeBlob.fromJson(res).content;
|
||||||
},
|
},
|
||||||
action: ActionEntry(iconData: Icons.settings, url: '/choose-code-theme'),
|
action: ActionEntry(iconData: Ionicons.cog, url: '/choose-code-theme'),
|
||||||
bodyBuilder: (content, _) {
|
bodyBuilder: (content, _) {
|
||||||
return BlobView(path, base64Text: content);
|
return BlobView(path, base64Text: content);
|
||||||
},
|
},
|
||||||
|
|
|
@ -178,7 +178,7 @@ class GePullScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Icon(
|
Icon(
|
||||||
Icons.chevron_right,
|
Ionicons.chevron_forward,
|
||||||
color: theme.palette.border,
|
color: theme.palette.border,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -36,7 +36,7 @@ class GeUserScreen extends StatelessWidget {
|
||||||
title: AppBarTitle(isViewer ? 'Me' : login),
|
title: AppBarTitle(isViewer ? 'Me' : login),
|
||||||
action: isViewer
|
action: isViewer
|
||||||
? ActionEntry(
|
? ActionEntry(
|
||||||
iconData: Icons.settings,
|
iconData: Ionicons.cog,
|
||||||
url: '/settings',
|
url: '/settings',
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:git_touch/scaffolds/common.dart';
|
import 'package:git_touch/scaffolds/common.dart';
|
||||||
|
import 'package:git_touch/utils/utils.dart';
|
||||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||||
import 'package:git_touch/widgets/blob_view.dart';
|
import 'package:git_touch/widgets/blob_view.dart';
|
||||||
import 'package:git_touch/widgets/action_entry.dart';
|
import 'package:git_touch/widgets/action_entry.dart';
|
||||||
|
@ -18,7 +19,7 @@ class GistObjectScreen extends StatelessWidget {
|
||||||
return CommonScaffold(
|
return CommonScaffold(
|
||||||
title: AppBarTitle(file),
|
title: AppBarTitle(file),
|
||||||
action: ActionEntry(
|
action: ActionEntry(
|
||||||
iconData: Icons.settings,
|
iconData: Ionicons.cog,
|
||||||
url: '/choose-code-theme',
|
url: '/choose-code-theme',
|
||||||
),
|
),
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
|
|
|
@ -237,7 +237,7 @@ class GhIssueScreen extends StatelessWidget {
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
)),
|
)),
|
||||||
Icon(Icons.chevron_right,
|
Icon(Ionicons.chevron_forward,
|
||||||
color: theme.palette.border),
|
color: theme.palette.border),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -131,7 +131,7 @@ ${item.key}: pullRequest(number: ${item.subject.number}) {
|
||||||
// await _onSwitchTab(); // TODO:
|
// await _onSwitchTab(); // TODO:
|
||||||
},
|
},
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Octicons.check,
|
Ionicons.checkmark_done,
|
||||||
color: theme.palette.tertiaryText,
|
color: theme.palette.tertiaryText,
|
||||||
size: 24,
|
size: 24,
|
||||||
),
|
),
|
||||||
|
@ -176,22 +176,22 @@ ${item.key}: pullRequest(number: ${item.subject.number}) {
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
actionBuilder: (_, refresh) => ActionEntry(
|
// actionBuilder: (_, refresh) => ActionEntry(
|
||||||
iconData: Icons.done_all,
|
// iconData: Ionicons.checkmark_done,
|
||||||
onTap: () async {
|
// onTap: () async {
|
||||||
final value = await context
|
// final value = await context
|
||||||
.read<ThemeModel>()
|
// .read<ThemeModel>()
|
||||||
.showConfirm(context, Text('Mark all as read?'));
|
// .showConfirm(context, Text('Mark all as read?'));
|
||||||
if (value) {
|
// if (value) {
|
||||||
await context
|
// await context
|
||||||
.read<AuthModel>()
|
// .read<AuthModel>()
|
||||||
.ghClient
|
// .ghClient
|
||||||
.activity
|
// .activity
|
||||||
.markNotificationsRead();
|
// .markNotificationsRead();
|
||||||
refresh();
|
// refresh();
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ class GhObjectScreen extends StatelessWidget {
|
||||||
actionBuilder: (data, _) {
|
actionBuilder: (data, _) {
|
||||||
if (data.isFile) {
|
if (data.isFile) {
|
||||||
return ActionEntry(
|
return ActionEntry(
|
||||||
iconData: Icons.settings,
|
iconData: Ionicons.cog,
|
||||||
url: '/choose-code-theme',
|
url: '/choose-code-theme',
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -119,7 +119,7 @@ class _User extends StatelessWidget {
|
||||||
hasIcon: true,
|
hasIcon: true,
|
||||||
items: [
|
items: [
|
||||||
TableViewItem(
|
TableViewItem(
|
||||||
leftIconData: Icons.rss_feed,
|
leftIconData: Octicons.rss,
|
||||||
text: Text(AppLocalizations.of(context).events),
|
text: Text(AppLocalizations.of(context).events),
|
||||||
url: '/github/$login?tab=events',
|
url: '/github/$login?tab=events',
|
||||||
),
|
),
|
||||||
|
@ -218,7 +218,7 @@ class _Org extends StatelessWidget {
|
||||||
hasIcon: true,
|
hasIcon: true,
|
||||||
items: [
|
items: [
|
||||||
TableViewItem(
|
TableViewItem(
|
||||||
leftIconData: Icons.rss_feed,
|
leftIconData: Octicons.rss,
|
||||||
text: Text(AppLocalizations.of(context).events),
|
text: Text(AppLocalizations.of(context).events),
|
||||||
url: '/github/${p.login}?tab=events',
|
url: '/github/${p.login}?tab=events',
|
||||||
),
|
),
|
||||||
|
@ -276,7 +276,7 @@ class GhViewer extends StatelessWidget {
|
||||||
},
|
},
|
||||||
title: AppBarTitle(AppLocalizations.of(context).me),
|
title: AppBarTitle(AppLocalizations.of(context).me),
|
||||||
action: ActionEntry(
|
action: ActionEntry(
|
||||||
iconData: Icons.settings,
|
iconData: Ionicons.cog,
|
||||||
url: '/settings',
|
url: '/settings',
|
||||||
),
|
),
|
||||||
bodyBuilder: (p, _) {
|
bodyBuilder: (p, _) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ class GlBlobScreen extends StatelessWidget {
|
||||||
'/projects/$id/repository/files/${path.urlencode}?ref=$ref');
|
'/projects/$id/repository/files/${path.urlencode}?ref=$ref');
|
||||||
return GitlabBlob.fromJson(res);
|
return GitlabBlob.fromJson(res);
|
||||||
},
|
},
|
||||||
action: ActionEntry(iconData: Icons.settings, url: '/choose-code-theme'),
|
action: ActionEntry(iconData: Ionicons.cog, url: '/choose-code-theme'),
|
||||||
bodyBuilder: (data, _) {
|
bodyBuilder: (data, _) {
|
||||||
return BlobView(path, base64Text: data.content);
|
return BlobView(path, base64Text: data.content);
|
||||||
},
|
},
|
||||||
|
|
|
@ -37,7 +37,7 @@ class GlUserScreen extends StatelessWidget {
|
||||||
},
|
},
|
||||||
action: isViewer
|
action: isViewer
|
||||||
? ActionEntry(
|
? ActionEntry(
|
||||||
iconData: Icons.settings,
|
iconData: Ionicons.cog,
|
||||||
url: '/settings',
|
url: '/settings',
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
|
|
|
@ -33,7 +33,7 @@ class GoObjectScreen extends StatelessWidget {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return ActionEntry(
|
return ActionEntry(
|
||||||
iconData: Icons.settings,
|
iconData: Ionicons.cog,
|
||||||
url: '/choose-code-theme',
|
url: '/choose-code-theme',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ class GoUserScreen extends StatelessWidget {
|
||||||
},
|
},
|
||||||
action: isViewer
|
action: isViewer
|
||||||
? ActionEntry(
|
? ActionEntry(
|
||||||
iconData: Icons.settings,
|
iconData: Ionicons.cog,
|
||||||
url: '/settings',
|
url: '/settings',
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
|
|
|
@ -32,7 +32,7 @@ class GtObjectScreen extends StatelessWidget {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return ActionEntry(
|
return ActionEntry(
|
||||||
iconData: Icons.settings,
|
iconData: Ionicons.cog,
|
||||||
url: '/choose-code-theme',
|
url: '/choose-code-theme',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ class GtUserScreen extends StatelessWidget {
|
||||||
},
|
},
|
||||||
action: isViewer
|
action: isViewer
|
||||||
? ActionEntry(
|
? ActionEntry(
|
||||||
iconData: Icons.settings,
|
iconData: Ionicons.cog,
|
||||||
url: '/settings',
|
url: '/settings',
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
|
|
|
@ -80,7 +80,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
(index == auth.activeAccountIndex)
|
(index == auth.activeAccountIndex)
|
||||||
? Icon(Icons.check)
|
? Icon(Ionicons.checkmark)
|
||||||
: Container(),
|
: Container(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -99,7 +99,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(Icons.add),
|
Icon(Ionicons.add),
|
||||||
SizedBox(width: 4),
|
SizedBox(width: 4),
|
||||||
Icon(brand),
|
Icon(brand),
|
||||||
SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
|
@ -200,7 +200,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||||
),
|
),
|
||||||
_buildAddItem(
|
_buildAddItem(
|
||||||
text: AppLocalizations.of(context).gitlabAccount,
|
text: AppLocalizations.of(context).gitlabAccount,
|
||||||
brand: Ionicons.logo_gitlab,
|
brand: Ionicons.git_branch_outline,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
_domainController.text = 'https://gitlab.com';
|
_domainController.text = 'https://gitlab.com';
|
||||||
final result = await theme.showConfirm(
|
final result = await theme.showConfirm(
|
||||||
|
@ -305,7 +305,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||||
),
|
),
|
||||||
_buildAddItem(
|
_buildAddItem(
|
||||||
text: AppLocalizations.of(context).giteaAccount,
|
text: AppLocalizations.of(context).giteaAccount,
|
||||||
brand: Octicons.git_branch, // TODO: brand icon
|
brand: Ionicons.git_branch_outline, // TODO: brand icon
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
_domainController.text = 'https://gitea.com';
|
_domainController.text = 'https://gitea.com';
|
||||||
final result = await theme.showConfirm(
|
final result = await theme.showConfirm(
|
||||||
|
@ -340,7 +340,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||||
),
|
),
|
||||||
_buildAddItem(
|
_buildAddItem(
|
||||||
text: AppLocalizations.of(context).giteeAccount + '(码云)',
|
text: AppLocalizations.of(context).giteeAccount + '(码云)',
|
||||||
brand: Octicons.git_branch, // TODO: brand icon
|
brand: Ionicons.git_branch_outline, // TODO: brand icon
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final result = await theme.showConfirm(
|
final result = await theme.showConfirm(
|
||||||
context,
|
context,
|
||||||
|
@ -358,7 +358,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||||
),
|
),
|
||||||
_buildAddItem(
|
_buildAddItem(
|
||||||
text: 'Gogs Account',
|
text: 'Gogs Account',
|
||||||
brand: Octicons.git_branch, // TODO: brand icon
|
brand: Ionicons.git_branch_outline, // TODO: brand icon
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
_domainController.text = 'https://gogs.com';
|
_domainController.text = 'https://gogs.com';
|
||||||
final result = await theme.showConfirm(
|
final result = await theme.showConfirm(
|
||||||
|
|
|
@ -15,12 +15,6 @@ import 'package:tuple/tuple.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||||
|
|
||||||
class SettingsScreen extends StatelessWidget {
|
class SettingsScreen extends StatelessWidget {
|
||||||
// Widget _buildRightWidget(BuildContext context, bool checked) {
|
|
||||||
// final theme = Provider.of<ThemeModel>(context);
|
|
||||||
// if (!checked) return null;
|
|
||||||
// return Icon(Icons.check, color: theme.palette.primary, size: 24);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// After translation finished, add locale name here to display in settings
|
// After translation finished, add locale name here to display in settings
|
||||||
static const localeNameMap = {
|
static const localeNameMap = {
|
||||||
'en': 'English',
|
'en': 'English',
|
||||||
|
@ -198,11 +192,11 @@ class SettingsScreen extends StatelessWidget {
|
||||||
TableView(headerText: AppLocalizations.of(context).feedback, items: [
|
TableView(headerText: AppLocalizations.of(context).feedback, items: [
|
||||||
TableViewItem(
|
TableViewItem(
|
||||||
text: Text(AppLocalizations.of(context).submitAnIssue),
|
text: Text(AppLocalizations.of(context).submitAnIssue),
|
||||||
rightWidget: Text('pd4d10/git-touch'),
|
rightWidget: Text('git-touch/git-touch'),
|
||||||
url: (auth.activeAccount.platform == PlatformType.github
|
url: (auth.activeAccount.platform == PlatformType.github
|
||||||
? '/github'
|
? '/github'
|
||||||
: 'https://github.com') +
|
: 'https://github.com') +
|
||||||
'/pd4d10/git-touch/issues/new',
|
'/git-touch/git-touch/issues/new',
|
||||||
),
|
),
|
||||||
TableViewItem(
|
TableViewItem(
|
||||||
text: Text(AppLocalizations.of(context).rateThisApp),
|
text: Text(AppLocalizations.of(context).rateThisApp),
|
||||||
|
@ -233,11 +227,11 @@ class SettingsScreen extends StatelessWidget {
|
||||||
)),
|
)),
|
||||||
TableViewItem(
|
TableViewItem(
|
||||||
text: Text(AppLocalizations.of(context).sourceCode),
|
text: Text(AppLocalizations.of(context).sourceCode),
|
||||||
rightWidget: Text('pd4d10/git-touch'),
|
rightWidget: Text('git-touch/git-touch'),
|
||||||
url: (auth.activeAccount.platform == PlatformType.github
|
url: (auth.activeAccount.platform == PlatformType.github
|
||||||
? '/github'
|
? '/github'
|
||||||
: 'https://github.com') +
|
: 'https://github.com') +
|
||||||
'/pd4d10/git-touch',
|
'/git-touch/git-touch',
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
],
|
],
|
||||||
|
|
|
@ -10,8 +10,8 @@ import 'package:provider/provider.dart';
|
||||||
import 'package:tuple/tuple.dart';
|
import 'package:tuple/tuple.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
export 'extensions.dart';
|
export 'extensions.dart';
|
||||||
export 'package:flutter_vector_icons/flutter_vector_icons.dart' show Octicons;
|
export 'package:flutter_vector_icons/flutter_vector_icons.dart'
|
||||||
export 'package:ionicons/ionicons.dart';
|
show Octicons, Ionicons;
|
||||||
|
|
||||||
class StorageKeys {
|
class StorageKeys {
|
||||||
@deprecated
|
@deprecated
|
||||||
|
|
|
@ -49,7 +49,7 @@ class ActionButton extends StatelessWidget {
|
||||||
ActionButton({
|
ActionButton({
|
||||||
@required this.title,
|
@required this.title,
|
||||||
@required this.items,
|
@required this.items,
|
||||||
this.iconData = Icons.more_vert,
|
this.iconData = Ionicons.ellipsis_horizontal,
|
||||||
this.selected,
|
this.selected,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ class _NotificationItemState extends State<NotificationItem> {
|
||||||
Widget _buildCheckIcon() {
|
Widget _buildCheckIcon() {
|
||||||
final theme = Provider.of<ThemeModel>(context);
|
final theme = Provider.of<ThemeModel>(context);
|
||||||
return Icon(
|
return Icon(
|
||||||
payload.unread ? Octicons.check : Octicons.primitive_dot,
|
payload.unread ? Ionicons.checkmark : Octicons.primitive_dot,
|
||||||
color:
|
color:
|
||||||
loading ? theme.palette.grayBackground : theme.palette.tertiaryText,
|
loading ? theme.palette.grayBackground : theme.palette.tertiaryText,
|
||||||
size: 24,
|
size: 24,
|
||||||
|
|
|
@ -103,7 +103,7 @@ class TableView extends StatelessWidget {
|
||||||
],
|
],
|
||||||
if ((item.onTap != null || item.url != null) &&
|
if ((item.onTap != null || item.url != null) &&
|
||||||
!item.hideRightChevron)
|
!item.hideRightChevron)
|
||||||
Icon(CupertinoIcons.right_chevron,
|
Icon(Ionicons.chevron_forward,
|
||||||
size: 20, color: theme.palette.tertiaryText)
|
size: 20, color: theme.palette.tertiaryText)
|
||||||
else
|
else
|
||||||
SizedBox(width: 2),
|
SizedBox(width: 2),
|
||||||
|
|
|
@ -455,13 +455,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.4"
|
version: "0.3.4"
|
||||||
ionicons:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: ionicons
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.1"
|
|
||||||
js:
|
js:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -48,7 +48,6 @@ dependencies:
|
||||||
uri: ^0.11.3
|
uri: ^0.11.3
|
||||||
url_launcher: ^5.4.1
|
url_launcher: ^5.4.1
|
||||||
webview_flutter: ^1.0.5
|
webview_flutter: ^1.0.5
|
||||||
ionicons: ^0.1.1
|
|
||||||
flutter_localizations:
|
flutter_localizations:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue