chore: using ionicons
This commit is contained in:
parent
f4e5df4068
commit
918d0f3971
|
@ -32350,68 +32350,6 @@ class _$GUserPartsData_pinnedItems_nodes__asRepositorySerializer
|
|||
}
|
||||
}
|
||||
|
||||
class _$GReactionConnectionPartsDataSerializer
|
||||
implements StructuredSerializer<GReactionConnectionPartsData> {
|
||||
@override
|
||||
final Iterable<Type> types = const [
|
||||
GReactionConnectionPartsData,
|
||||
_$GReactionConnectionPartsData
|
||||
];
|
||||
@override
|
||||
final String wireName = 'GReactionConnectionPartsData';
|
||||
|
||||
@override
|
||||
Iterable<Object> serialize(
|
||||
Serializers serializers, GReactionConnectionPartsData object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object>[
|
||||
'__typename',
|
||||
serializers.serialize(object.G__typename,
|
||||
specifiedType: const FullType(String)),
|
||||
'totalCount',
|
||||
serializers.serialize(object.totalCount,
|
||||
specifiedType: const FullType(int)),
|
||||
'viewerHasReacted',
|
||||
serializers.serialize(object.viewerHasReacted,
|
||||
specifiedType: const FullType(bool)),
|
||||
];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@override
|
||||
GReactionConnectionPartsData deserialize(
|
||||
Serializers serializers, Iterable<Object> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = new GReactionConnectionPartsDataBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final dynamic value = iterator.current;
|
||||
switch (key) {
|
||||
case '__typename':
|
||||
result.G__typename = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case 'totalCount':
|
||||
result.totalCount = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
case 'viewerHasReacted':
|
||||
result.viewerHasReacted = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
class _$GReactablePartsDataSerializer
|
||||
implements StructuredSerializer<GReactablePartsData> {
|
||||
class _$GUserPartsData_pinnedItems_nodes__asRepository_ownerSerializer
|
||||
implements
|
||||
StructuredSerializer<
|
||||
|
@ -34133,6 +34071,66 @@ class _$GCommentPartsData_authorSerializer
|
|||
}
|
||||
}
|
||||
|
||||
class _$GReactionConnectionPartsDataSerializer
|
||||
implements StructuredSerializer<GReactionConnectionPartsData> {
|
||||
@override
|
||||
final Iterable<Type> types = const [
|
||||
GReactionConnectionPartsData,
|
||||
_$GReactionConnectionPartsData
|
||||
];
|
||||
@override
|
||||
final String wireName = 'GReactionConnectionPartsData';
|
||||
|
||||
@override
|
||||
Iterable<Object> serialize(
|
||||
Serializers serializers, GReactionConnectionPartsData object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object>[
|
||||
'__typename',
|
||||
serializers.serialize(object.G__typename,
|
||||
specifiedType: const FullType(String)),
|
||||
'totalCount',
|
||||
serializers.serialize(object.totalCount,
|
||||
specifiedType: const FullType(int)),
|
||||
'viewerHasReacted',
|
||||
serializers.serialize(object.viewerHasReacted,
|
||||
specifiedType: const FullType(bool)),
|
||||
];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@override
|
||||
GReactionConnectionPartsData deserialize(
|
||||
Serializers serializers, Iterable<Object> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = new GReactionConnectionPartsDataBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final dynamic value = iterator.current;
|
||||
switch (key) {
|
||||
case '__typename':
|
||||
result.G__typename = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case 'totalCount':
|
||||
result.totalCount = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
case 'viewerHasReacted':
|
||||
result.viewerHasReacted = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
class _$GReactablePartsDataSerializer
|
||||
implements StructuredSerializer<GReactablePartsData> {
|
||||
@override
|
||||
|
|
135
lib/home.dart
135
lib/home.dart
|
@ -110,9 +110,8 @@ class _HomeState extends State<Home> {
|
|||
}
|
||||
}
|
||||
|
||||
Widget _buildNotificationIcon(BuildContext context, bool isActive) {
|
||||
Widget _buildNotificationIcon(BuildContext context, IconData iconData) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
final iconData = Icons.notifications;
|
||||
int count = Provider.of<NotificationModel>(context).count;
|
||||
if (count == 0) {
|
||||
return Icon(iconData);
|
||||
|
@ -147,6 +146,69 @@ class _HomeState extends State<Home> {
|
|||
return tab1;
|
||||
}
|
||||
|
||||
List<BottomNavigationBarItem> _buildNavigationItems(String platform) {
|
||||
final search = BottomNavigationBarItem(
|
||||
icon: Icon(Ionicons.search_outline),
|
||||
activeIcon: Icon(Ionicons.search),
|
||||
label: S.of(context).search,
|
||||
);
|
||||
final group = BottomNavigationBarItem(
|
||||
icon: Icon(Ionicons.people_outline),
|
||||
activeIcon: Icon(Ionicons.people),
|
||||
label: S.of(context).organizations,
|
||||
);
|
||||
final me = BottomNavigationBarItem(
|
||||
icon: Icon(Ionicons.person_outline),
|
||||
activeIcon: Icon(Ionicons.person),
|
||||
label: S.of(context).me,
|
||||
);
|
||||
final explore = BottomNavigationBarItem(
|
||||
icon: Icon(Ionicons.compass_outline),
|
||||
activeIcon: Icon(Ionicons.compass),
|
||||
label: S.of(context).explore,
|
||||
);
|
||||
|
||||
switch (platform) {
|
||||
case PlatformType.github:
|
||||
return [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Ionicons.newspaper_outline),
|
||||
activeIcon: Icon(Ionicons.newspaper),
|
||||
label: S.of(context).news,
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon:
|
||||
_buildNotificationIcon(context, Ionicons.notifications_outline),
|
||||
activeIcon: _buildNotificationIcon(context, Ionicons.notifications),
|
||||
label: S.of(context).notification,
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Ionicons.flame_outline),
|
||||
activeIcon: Icon(Ionicons.flame),
|
||||
label: S.of(context).trending,
|
||||
),
|
||||
search,
|
||||
me,
|
||||
];
|
||||
break;
|
||||
case PlatformType.gitlab:
|
||||
return [explore, group, search, me];
|
||||
break;
|
||||
case PlatformType.bitbucket:
|
||||
return [explore, group, me];
|
||||
break;
|
||||
case PlatformType.gitea:
|
||||
return [group, me];
|
||||
break;
|
||||
case PlatformType.gitee:
|
||||
case PlatformType.gogs:
|
||||
return [search, me];
|
||||
break;
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
@ -156,74 +218,7 @@ class _HomeState extends State<Home> {
|
|||
return LoginScreen();
|
||||
}
|
||||
|
||||
List<BottomNavigationBarItem> navigationItems;
|
||||
|
||||
switch (auth.activeAccount.platform) {
|
||||
case PlatformType.github:
|
||||
navigationItems = [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.rss_feed), label: S.of(context).news),
|
||||
BottomNavigationBarItem(
|
||||
icon: _buildNotificationIcon(context, false),
|
||||
activeIcon: _buildNotificationIcon(context, true),
|
||||
label: S.of(context).notification),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.whatshot), label: S.of(context).trending),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.search), label: S.of(context).search),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.person),
|
||||
activeIcon: Icon(Icons.person),
|
||||
label: S.of(context).me),
|
||||
];
|
||||
break;
|
||||
case PlatformType.gitlab:
|
||||
navigationItems = [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.explore), label: S.of(context).explore),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.group), label: S.of(context).groups),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.search), label: S.of(context).search),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.person), label: S.of(context).me),
|
||||
];
|
||||
break;
|
||||
case PlatformType.bitbucket:
|
||||
navigationItems = [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.explore), label: S.of(context).explore),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.group), label: S.of(context).teams),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.person), label: S.of(context).me),
|
||||
];
|
||||
break;
|
||||
case PlatformType.gitea:
|
||||
navigationItems = [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.group), label: S.of(context).organizations),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.person), label: S.of(context).me),
|
||||
];
|
||||
break;
|
||||
case PlatformType.gitee:
|
||||
navigationItems = [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.search), label: S.of(context).search),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.person), label: S.of(context).me),
|
||||
];
|
||||
break;
|
||||
case PlatformType.gogs:
|
||||
navigationItems = [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.search), label: S.of(context).search),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.person), label: S.of(context).me),
|
||||
];
|
||||
break;
|
||||
}
|
||||
final navigationItems = _buildNavigationItems(auth.activeAccount.platform);
|
||||
|
||||
switch (theme.theme) {
|
||||
case AppThemeType.cupertino:
|
||||
|
|
|
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:git_touch/graphql/github.data.gql.dart';
|
||||
import 'package:git_touch/graphql/github.req.gql.dart';
|
||||
import 'package:git_touch/graphql/schema.schema.gql.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
|
|
|
@ -148,7 +148,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||
...List.generate(auth.accounts.length, _buildAccountItem),
|
||||
_buildAddItem(
|
||||
text: S.of(context).githubAccount,
|
||||
brand: FontAwesome5Brands.github,
|
||||
brand: Ionicons.logo_github,
|
||||
onTap: () async {
|
||||
theme.showActions(context, [
|
||||
ActionItem(
|
||||
|
@ -200,7 +200,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||
),
|
||||
_buildAddItem(
|
||||
text: S.of(context).gitlabAccount,
|
||||
brand: FontAwesome5Brands.gitlab,
|
||||
brand: Ionicons.logo_gitlab,
|
||||
onTap: () async {
|
||||
_domainController.text = 'https://gitlab.com';
|
||||
final result = await theme.showConfirm(
|
||||
|
@ -236,7 +236,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||
),
|
||||
_buildAddItem(
|
||||
text: S.of(context).bitbucketAccount,
|
||||
brand: FontAwesome5Brands.bitbucket,
|
||||
brand: Ionicons.logo_bitbucket,
|
||||
onTap: () async {
|
||||
_domainController.text = 'https://bitbucket.org';
|
||||
final result = await theme.showConfirm(
|
||||
|
|
|
@ -10,7 +10,8 @@ import 'package:provider/provider.dart';
|
|||
import 'package:tuple/tuple.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
export 'extensions.dart';
|
||||
export 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
export 'package:flutter_vector_icons/flutter_vector_icons.dart' show Octicons;
|
||||
export 'package:ionicons/ionicons.dart';
|
||||
|
||||
class StorageKeys {
|
||||
@deprecated
|
||||
|
|
|
@ -102,7 +102,7 @@ class ReleaseItem extends StatelessWidget {
|
|||
theme.push(context, asset.downloadUrl);
|
||||
}
|
||||
},
|
||||
icon: Icon(MaterialCommunityIcons.download)),
|
||||
icon: Icon(Ionicons.download_outline)),
|
||||
hideRightChevron: true,
|
||||
),
|
||||
])
|
||||
|
|
|
@ -129,11 +129,11 @@ class RepositoryItem extends StatelessWidget {
|
|||
static IconData _buildGlIconData(String visibility) {
|
||||
switch (visibility) {
|
||||
case 'internal':
|
||||
return FontAwesome.shield;
|
||||
return Ionicons.shield_outline;
|
||||
case 'public':
|
||||
return FontAwesome.globe;
|
||||
return Ionicons.globe_outline;
|
||||
case 'private':
|
||||
return FontAwesome.lock;
|
||||
return Ionicons.lock_closed_outline;
|
||||
default:
|
||||
return Octicons.repo;
|
||||
}
|
||||
|
|
|
@ -455,6 +455,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.4"
|
||||
ionicons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: ionicons
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.1"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -48,6 +48,7 @@ dependencies:
|
|||
uri: ^0.11.3
|
||||
url_launcher: ^5.4.1
|
||||
webview_flutter: ^1.0.5
|
||||
ionicons: ^0.1.1
|
||||
flutter_localizations:
|
||||
sdk: flutter
|
||||
|
||||
|
|
Loading…
Reference in New Issue