diff --git a/lib/app.dart b/lib/app.dart index c82d080..9749023 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -62,9 +62,7 @@ class MyApp extends StatelessWidget { theme: CupertinoThemeData( brightness: theme.brightness, primaryColor: antTheme.colorPrimary, - scaffoldBackgroundColor: theme.brightness == Brightness.dark - ? const Color(0x00ff2629) - : const Color(0xfffafbfc), + scaffoldBackgroundColor: antTheme.colorBox, textTheme: CupertinoTextThemeData( textStyle: TextStyle( fontSize: antTheme.fontSizeMain, diff --git a/lib/screens/ge_repo.dart b/lib/screens/ge_repo.dart index 59cbae7..8e4e773 100644 --- a/lib/screens/ge_repo.dart +++ b/lib/screens/ge_repo.dart @@ -116,17 +116,17 @@ class GeRepoScreen extends StatelessWidget { Row( children: [ EntryItem( - count: p.watchersCount, + count: p.watchersCount!, text: 'Watchers', url: '/gitee/$owner/$name/watchers', ), EntryItem( - count: p.stargazersCount, + count: p.stargazersCount!, text: 'Stars', url: '/gitee/$owner/$name/stargazers', ), EntryItem( - count: p.forksCount, + count: p.forksCount!, text: 'Forks', url: '/gitee/$owner/$name/forks', ), diff --git a/lib/screens/ge_user.dart b/lib/screens/ge_user.dart index dd97593..a5b9921 100644 --- a/lib/screens/ge_user.dart +++ b/lib/screens/ge_user.dart @@ -65,22 +65,22 @@ class GeUserScreen extends StatelessWidget { CommonStyle.border, Row(children: [ EntryItem( - count: user.publicRepos, + count: user.publicRepos!, text: 'Repositories', url: '/gitee/$login?tab=repositories', ), EntryItem( - count: user.stared, + count: user.stared!, text: 'Stars', url: '/gitee/$login?tab=stars', ), EntryItem( - count: user.followers, + count: user.followers!, text: 'Followers', url: '/gitee/$login?tab=followers', ), EntryItem( - count: user.following, + count: user.following!, text: 'Following', url: '/gitee/$login?tab=following', ), diff --git a/lib/screens/gh_user.dart b/lib/screens/gh_user.dart index 5e50922..d8fea13 100644 --- a/lib/screens/gh_user.dart +++ b/lib/screens/gh_user.dart @@ -103,7 +103,6 @@ class _User extends StatelessWidget { ] ], ), - CommonStyle.border, AntList( children: [ if (p.company != null) diff --git a/lib/screens/gl_project.dart b/lib/screens/gl_project.dart index 7b684c6..81cde25 100644 --- a/lib/screens/gl_project.dart +++ b/lib/screens/gl_project.dart @@ -121,19 +121,19 @@ class GlProjectScreen extends StatelessWidget { future: memberCountFuture, builder: (context, snapshot) { return EntryItem( - count: snapshot.data, + count: snapshot.data!, text: AppLocalizations.of(context)!.members, url: '/gitlab/projects/$id/members', ); }, ), EntryItem( - count: p.starCount, + count: p.starCount!, text: AppLocalizations.of(context)!.stars, url: '/gitlab/projects/$id/starrers', ), EntryItem( - count: p.forksCount, + count: p.forksCount!, text: AppLocalizations.of(context)!.forks, // TODO: ), ], diff --git a/lib/screens/go_repo.dart b/lib/screens/go_repo.dart index c416a4c..7854918 100644 --- a/lib/screens/go_repo.dart +++ b/lib/screens/go_repo.dart @@ -76,15 +76,15 @@ class GoRepoScreen extends StatelessWidget { children: [ // TODO: when API is available EntryItem( - count: p.watchersCount, + count: p.watchersCount!, text: 'Watchers', ), EntryItem( - count: p.starsCount, + count: p.starsCount!, text: 'Stars', ), EntryItem( - count: p.forksCount, + count: p.forksCount!, text: 'Forks', ), ], diff --git a/lib/screens/gt_repo.dart b/lib/screens/gt_repo.dart index 35d48e3..ddf3e9b 100644 --- a/lib/screens/gt_repo.dart +++ b/lib/screens/gt_repo.dart @@ -65,16 +65,17 @@ class GtRepoScreen extends StatelessWidget { Row( children: [ EntryItem( + count: 0, // TODO: text: 'Watchers', url: '/gitea/$owner/$name/watchers', ), EntryItem( - count: p.starsCount, + count: p.starsCount!, text: 'Stars', url: '/gitea/$owner/$name/stargazers', ), EntryItem( - count: p.forksCount, + count: p.forksCount!, text: 'Forks', url: '/gitea/$owner/$name/forks', ), diff --git a/lib/screens/gt_user.dart b/lib/screens/gt_user.dart index d5df574..59927c1 100644 --- a/lib/screens/gt_user.dart +++ b/lib/screens/gt_user.dart @@ -111,7 +111,7 @@ class GtUserScreen extends StatelessWidget { CommonStyle.border, Row(children: [ EntryItem( - count: p.userRepoCount, + count: p.userRepoCount!, text: 'Repositories', url: '/gitea/$login?tab=repositories', ), diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 9821204..03d808e 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -39,6 +39,7 @@ class StorageKeys { } class CommonStyle { + CommonStyle._(); static const padding = EdgeInsets.all(12); static const border = BorderView(); static const verticalGap = SizedBox(height: 18); diff --git a/lib/widgets/border_view.dart b/lib/widgets/border_view.dart index 53517b5..1d08fc0 100644 --- a/lib/widgets/border_view.dart +++ b/lib/widgets/border_view.dart @@ -17,7 +17,7 @@ class BorderView extends StatelessWidget { margin: EdgeInsets.only(left: leftPadding), decoration: BoxDecoration( border: Border( - top: BorderSide(color: AntTheme.of(context).colorBorder, width: 0), + top: BorderSide(color: AntTheme.of(context).colorBorder, width: 1), ), ), ); diff --git a/lib/widgets/entry_item.dart b/lib/widgets/entry_item.dart index 7092878..99baa88 100644 --- a/lib/widgets/entry_item.dart +++ b/lib/widgets/entry_item.dart @@ -1,7 +1,6 @@ import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:git_touch/utils/utils.dart'; -import 'package:git_touch/widgets/link.dart'; class EntryItem extends StatelessWidget { const EntryItem({ @@ -15,11 +14,19 @@ class EntryItem extends StatelessWidget { @override Widget build(BuildContext context) { + final theme = AntTheme.of(context); + return Expanded( - child: LinkWidget( - url: url, - child: Container( - padding: const EdgeInsets.symmetric(vertical: 14), + child: Container( + color: theme.colorBackground, + child: AntButton( + block: true, + size: AntButtonSize.large, + fill: AntButtonFill.none, + color: theme.colorPrimary, + onClick: () { + if (url != null) context.pushUrl(url!); + }, child: Column( children: [ Text( @@ -27,14 +34,14 @@ class EntryItem extends StatelessWidget { style: TextStyle( fontSize: 17, fontWeight: FontWeight.w600, - color: AntTheme.of(context).colorText, + color: theme.colorText, ), ), Text( text, style: TextStyle( fontSize: 14, - color: AntTheme.of(context).colorTextSecondary, + color: theme.colorTextSecondary, fontWeight: FontWeight.w500, ), )