build: update icons
This commit is contained in:
parent
a512e41121
commit
d250f1c95c
|
@ -153,10 +153,11 @@ class _HomeState extends State<Home> {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(iconData),
|
Icon(iconData),
|
||||||
Positioned(
|
Positioned(
|
||||||
right: -2,
|
right: -2,
|
||||||
top: -2,
|
top: -2,
|
||||||
child: Icon(Octicons.primitive_dot,
|
child:
|
||||||
color: theme.palette.primary, size: 14))
|
Icon(Octicons.dot_fill, color: theme.palette.primary, size: 14),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,14 +60,14 @@ class _NotificationItemState extends State<NotificationItem> {
|
||||||
case 'CheckSuite':
|
case 'CheckSuite':
|
||||||
return _buildIcon(Octicons.x, GithubPalette.closed);
|
return _buildIcon(Octicons.x, GithubPalette.closed);
|
||||||
default:
|
default:
|
||||||
return _buildIcon(Octicons.octoface);
|
return _buildIcon(Octicons.bell);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildCheckIcon() {
|
Widget _buildCheckIcon() {
|
||||||
final theme = Provider.of<ThemeModel>(context);
|
final theme = Provider.of<ThemeModel>(context);
|
||||||
return Icon(
|
return Icon(
|
||||||
payload.unread! ? Ionicons.checkmark : Octicons.primitive_dot,
|
payload.unread! ? Ionicons.checkmark : Octicons.dot_fill,
|
||||||
color:
|
color:
|
||||||
loading ? theme.palette.grayBackground : theme.palette.tertiaryText,
|
loading ? theme.palette.grayBackground : theme.palette.tertiaryText,
|
||||||
size: 24,
|
size: 24,
|
||||||
|
|
|
@ -1,30 +1,22 @@
|
||||||
|
import 'package:antd_mobile/antd_mobile.dart';
|
||||||
import 'package:file_icon/file_icon.dart';
|
import 'package:file_icon/file_icon.dart';
|
||||||
import 'package:filesize/filesize.dart';
|
import 'package:filesize/filesize.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:git_touch/utils/utils.dart';
|
import 'package:git_touch/utils/utils.dart';
|
||||||
import 'package:git_touch/widgets/table_view.dart';
|
import 'package:git_touch/widgets/table_view.dart';
|
||||||
import 'package:primer/primer.dart';
|
|
||||||
|
|
||||||
Widget _buildIcon(String type, String name) {
|
Widget _buildIcon(String type, String name) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'blob': // github gql, gitlab
|
case 'blob': // github gql, gitlab
|
||||||
case 'file': // github rest, gitea
|
case 'file': // github rest, gitea
|
||||||
case 'commit_file': // bitbucket
|
case 'commit_file': // bitbucket
|
||||||
return FileIcon(name, size: 36);
|
return FileIcon(name, size: 26); // TODO: size
|
||||||
case 'tree': // github gql, gitlab
|
case 'tree': // github gql, gitlab
|
||||||
case 'dir': // github rest, gitea
|
case 'dir': // github rest, gitea
|
||||||
case 'commit_directory': // bitbucket
|
case 'commit_directory': // bitbucket
|
||||||
return const Icon(
|
return const Icon(AntIcons.folderOutline);
|
||||||
Octicons.file_directory,
|
|
||||||
color: PrimerColors.blue300,
|
|
||||||
size: 24,
|
|
||||||
);
|
|
||||||
case 'commit':
|
case 'commit':
|
||||||
return const Icon(
|
return const Icon(AntIcons.fileOutline);
|
||||||
Octicons.file_submodule,
|
|
||||||
color: PrimerColors.blue300,
|
|
||||||
size: 24,
|
|
||||||
);
|
|
||||||
default:
|
default:
|
||||||
throw 'object type error';
|
throw 'object type error';
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ class TimelineEventItem extends StatelessWidget {
|
||||||
|
|
||||||
const TimelineEventItem({
|
const TimelineEventItem({
|
||||||
this.actor,
|
this.actor,
|
||||||
this.iconData = Octicons.octoface,
|
this.iconData = Octicons.diamond,
|
||||||
this.iconColor = Colors.grey,
|
this.iconColor = Colors.grey,
|
||||||
this.textSpan,
|
this.textSpan,
|
||||||
});
|
});
|
||||||
|
@ -62,7 +62,7 @@ class TimelineItem extends StatelessWidget {
|
||||||
Widget _buildFallback(String? type, BuildContext context) {
|
Widget _buildFallback(String? type, BuildContext context) {
|
||||||
return TimelineEventItem(
|
return TimelineEventItem(
|
||||||
actor: '',
|
actor: '',
|
||||||
iconData: Octicons.octoface,
|
iconData: Octicons.diamond,
|
||||||
textSpan: TextSpan(children: [
|
textSpan: TextSpan(children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text:
|
text:
|
||||||
|
@ -99,7 +99,7 @@ class TimelineItem extends StatelessWidget {
|
||||||
final prefix = p.source.G__typename == 'Issue' ? 'issues' : 'pull';
|
final prefix = p.source.G__typename == 'Issue' ? 'issues' : 'pull';
|
||||||
return TimelineEventItem(
|
return TimelineEventItem(
|
||||||
actor: p.actor!.login,
|
actor: p.actor!.login,
|
||||||
iconData: Octicons.primitive_dot,
|
iconData: Octicons.dot_fill,
|
||||||
iconColor: GithubPalette.open,
|
iconColor: GithubPalette.open,
|
||||||
textSpan: TextSpan(children: [
|
textSpan: TextSpan(children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
|
@ -123,7 +123,7 @@ class TimelineItem extends StatelessWidget {
|
||||||
final p = node as GReopenedEventParts;
|
final p = node as GReopenedEventParts;
|
||||||
return TimelineEventItem(
|
return TimelineEventItem(
|
||||||
actor: p.actor!.login,
|
actor: p.actor!.login,
|
||||||
iconData: Octicons.primitive_dot,
|
iconData: Octicons.dot_fill,
|
||||||
iconColor: GithubPalette.open,
|
iconColor: GithubPalette.open,
|
||||||
textSpan: TextSpan(
|
textSpan: TextSpan(
|
||||||
text: ' ${AppLocalizations.of(context)!.reopenedEventMessage} '),
|
text: ' ${AppLocalizations.of(context)!.reopenedEventMessage} '),
|
||||||
|
@ -393,7 +393,7 @@ class TimelineItem extends StatelessWidget {
|
||||||
case 'HeadRefForcePushedEvent':
|
case 'HeadRefForcePushedEvent':
|
||||||
final p = node as GHeadRefForcePushedEventParts;
|
final p = node as GHeadRefForcePushedEventParts;
|
||||||
return TimelineEventItem(
|
return TimelineEventItem(
|
||||||
iconData: Octicons.repo_force_push,
|
iconData: Octicons.repo_push,
|
||||||
actor: p.actor!.login,
|
actor: p.actor!.login,
|
||||||
textSpan: TextSpan(
|
textSpan: TextSpan(
|
||||||
children: [
|
children: [
|
||||||
|
@ -419,7 +419,7 @@ class TimelineItem extends StatelessWidget {
|
||||||
case 'BaseRefForcePushedEvent':
|
case 'BaseRefForcePushedEvent':
|
||||||
final p = node as GBaseRefForcePushedEventParts;
|
final p = node as GBaseRefForcePushedEventParts;
|
||||||
return TimelineEventItem(
|
return TimelineEventItem(
|
||||||
iconData: Octicons.repo_force_push,
|
iconData: Octicons.repo_push,
|
||||||
actor: p.actor!.login,
|
actor: p.actor!.login,
|
||||||
textSpan: TextSpan(
|
textSpan: TextSpan(
|
||||||
children: [
|
children: [
|
||||||
|
|
|
@ -313,9 +313,9 @@ packages:
|
||||||
flutter_vector_icons:
|
flutter_vector_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: flutter_vector_icons
|
path: "../flutter-vector-icons"
|
||||||
url: "https://pub.dartlang.org"
|
relative: true
|
||||||
source: hosted
|
source: path
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
flutter_web_plugins:
|
flutter_web_plugins:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
|
|
|
@ -41,6 +41,7 @@ dependencies:
|
||||||
flutter_markdown:
|
flutter_markdown:
|
||||||
flutter_svg:
|
flutter_svg:
|
||||||
flutter_vector_icons:
|
flutter_vector_icons:
|
||||||
|
path: ../flutter-vector-icons
|
||||||
github:
|
github:
|
||||||
github_trending:
|
github_trending:
|
||||||
gql:
|
gql:
|
||||||
|
|
Loading…
Reference in New Issue