From 15a57899fd6598333424a307a1c0da0b9a35e481 Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Sun, 25 Sep 2022 02:46:37 +0800 Subject: [PATCH] refactor: replace legacy palette --- lib/home.dart | 5 ++- lib/models/theme.dart | 59 +++------------------------- lib/scaffolds/long_list.dart | 19 ++++----- lib/screens/about.dart | 2 +- lib/screens/bb_issue.dart | 6 +-- lib/screens/bb_issue_comment.dart | 3 +- lib/screens/bb_issue_form.dart | 5 ++- lib/screens/bb_repo.dart | 3 +- lib/screens/ge_commit.dart | 5 ++- lib/screens/ge_contributors.dart | 5 ++- lib/screens/ge_issue.dart | 5 ++- lib/screens/ge_issue_comment.dart | 3 +- lib/screens/ge_issue_form.dart | 5 ++- lib/screens/ge_pull.dart | 17 +++++--- lib/screens/ge_repo.dart | 3 +- lib/screens/ge_search.dart | 3 +- lib/screens/gh_issue.dart | 14 +++---- lib/screens/gh_issue_form.dart | 5 ++- lib/screens/gh_notification.dart | 12 +++--- lib/screens/gh_search.dart | 3 +- lib/screens/gh_trending.dart | 7 +++- lib/screens/gh_user.dart | 3 +- lib/screens/gl_issue_form.dart | 5 ++- lib/screens/gl_project_activity.dart | 3 +- lib/screens/gl_search.dart | 3 +- lib/screens/gl_todos.dart | 8 ++-- lib/screens/go_repo.dart | 3 +- lib/screens/gt_issue.dart | 5 ++- lib/screens/gt_issue_comment.dart | 3 +- lib/screens/gt_issue_form.dart | 5 ++- lib/screens/gt_repo.dart | 3 +- lib/screens/image_view.dart | 2 +- lib/screens/login.dart | 30 ++++++++------ lib/utils/utils.dart | 3 +- lib/widgets/blob_view.dart | 2 +- lib/widgets/border_view.dart | 10 +++-- lib/widgets/comment_item.dart | 12 ++++-- lib/widgets/commit_item.dart | 7 ++-- lib/widgets/contributor_item.dart | 4 +- lib/widgets/diff_view.dart | 4 +- lib/widgets/entry_item.dart | 8 ++-- lib/widgets/event_item.dart | 48 +++++++++++----------- lib/widgets/files_item.dart | 6 +-- lib/widgets/gists_item.dart | 13 +++--- lib/widgets/issue_item.dart | 11 +++--- lib/widgets/language_bar.dart | 12 +++--- lib/widgets/list_group.dart | 10 ++--- lib/widgets/markdown_view.dart | 18 +++++---- lib/widgets/notification_item.dart | 13 +++--- lib/widgets/release_item.dart | 10 ++--- lib/widgets/repo_header.dart | 7 ++-- lib/widgets/repository_item.dart | 21 +++++----- lib/widgets/text_field.dart | 3 +- lib/widgets/timeline_item.dart | 11 +++--- lib/widgets/user_header.dart | 11 +++--- lib/widgets/user_item.dart | 10 ++--- lib/widgets/user_name.dart | 4 +- 57 files changed, 265 insertions(+), 255 deletions(-) diff --git a/lib/home.dart b/lib/home.dart index fb80017..73034d1 100644 --- a/lib/home.dart +++ b/lib/home.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/models/auth.dart'; @@ -155,8 +156,8 @@ class _HomeState extends State { Positioned( right: -2, top: -2, - child: - Icon(Octicons.dot_fill, color: theme.palette.primary, size: 14), + child: Icon(Octicons.dot_fill, + color: AntTheme.of(context).colorPrimary, size: 14), ) ], ); diff --git a/lib/models/theme.dart b/lib/models/theme.dart index 82e61bc..d9eae5e 100644 --- a/lib/models/theme.dart +++ b/lib/models/theme.dart @@ -7,7 +7,6 @@ import 'package:flutter/services.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/widgets/action_button.dart'; -import 'package:primer/primer.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:universal_io/io.dart'; @@ -68,25 +67,6 @@ class StaticRoute extends PageRouteBuilder { final WidgetBuilder? builder; } -class Palette { - const Palette({ - required this.primary, - required this.text, - required this.secondaryText, - required this.tertiaryText, - required this.background, - required this.grayBackground, - required this.border, - }); - final Color primary; - final Color text; - final Color secondaryText; - final Color tertiaryText; - final Color background; - final Color grayBackground; - final Color border; -} - class ThemeModel with ChangeNotifier { String? markdownCss; @@ -161,35 +141,6 @@ class ThemeModel with ChangeNotifier { notifyListeners(); } - final paletteLight = Palette( - primary: PrimerColors.blue500, - text: Colors.black, - secondaryText: Colors.grey.shade800, - tertiaryText: Colors.grey.shade600, - background: Colors.white, - grayBackground: Colors.grey.shade100, - border: Colors.grey.shade300, - ); - final paletteDark = Palette( - primary: PrimerColors.blue500, - text: Colors.grey.shade300, - secondaryText: Colors.grey.shade400, - tertiaryText: Colors.grey.shade500, - background: Colors.black, - grayBackground: Colors.grey.shade900, - border: Colors.grey.shade700, - ); - - Palette get palette { - switch (brightness) { - case Brightness.dark: - return paletteDark; - case Brightness.light: - default: - return paletteLight; - } - } - Future init() async { markdownCss = await rootBundle.loadString('images/github-markdown.css'); @@ -252,10 +203,10 @@ class ThemeModel with ChangeNotifier { Container( alignment: Alignment.bottomCenter, decoration: BoxDecoration( - color: palette.background, + color: AntTheme.of(context).colorBackground, border: Border( bottom: BorderSide( - color: palette.grayBackground, + color: AntTheme.of(context).colorBox, width: 0.0, ), ), @@ -291,7 +242,7 @@ class ThemeModel with ChangeNotifier { SizedBox( height: 216, child: CupertinoPicker( - backgroundColor: palette.background, + backgroundColor: AntTheme.of(context).colorBackground, itemExtent: 40, scrollController: FixedExtentScrollController( initialItem: groupItem.items @@ -312,7 +263,9 @@ class ThemeModel with ChangeNotifier { }, children: [ for (var v in groupItem.items) - Text(v.text!, style: TextStyle(color: palette.text)), + Text(v.text!, + style: + TextStyle(color: AntTheme.of(context).colorText)), ], ), ) diff --git a/lib/scaffolds/long_list.dart b/lib/scaffolds/long_list.dart index 86a4901..35f862b 100644 --- a/lib/scaffolds/long_list.dart +++ b/lib/scaffolds/long_list.dart @@ -1,14 +1,13 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:git_touch/models/theme.dart'; import 'package:git_touch/utils/utils.dart'; -import 'package:provider/provider.dart'; - import 'package:git_touch/widgets/error_reload.dart'; import 'package:git_touch/widgets/link.dart'; import 'package:git_touch/widgets/loading.dart'; +import 'package:provider/provider.dart'; class LongListPayload { - LongListPayload({ required this.header, required this.totalCount, @@ -28,7 +27,6 @@ class LongListPayload { // We should load leading and trailing items at first fetching, and do load more in the middle // e.g. https://github.com/reactjs/rfcs/pull/68 class LongListStatefulScaffold extends StatefulWidget { - const LongListStatefulScaffold({ required this.title, this.trailingBuilder, @@ -125,20 +123,21 @@ class _LongListStatefulScaffoldState child: Container( padding: CommonStyle.padding, decoration: BoxDecoration( - border: Border.all(color: theme.palette.text), + border: Border.all(color: AntTheme.of(context).colorText), ), child: Column( children: [ Text('$count hidden items', - style: - TextStyle(color: theme.palette.text, fontSize: 15)), + style: TextStyle( + color: AntTheme.of(context).colorText, fontSize: 15)), const Padding(padding: EdgeInsets.only(top: 4)), loadingMore ? const CupertinoActivityIndicator() : Text( 'Load more...', style: TextStyle( - color: theme.palette.primary, fontSize: 16), + color: AntTheme.of(context).colorPrimary, + fontSize: 16), ), ], ), @@ -177,7 +176,9 @@ class _LongListStatefulScaffoldState @override Widget build(BuildContext context) { - final slivers = [CupertinoSliverRefreshControl(onRefresh: _refresh)]; + final slivers = [ + CupertinoSliverRefreshControl(onRefresh: _refresh) + ]; if (payload != null) { slivers.add( SliverToBoxAdapter(child: widget.headerBuilder(payload!.header)), diff --git a/lib/screens/about.dart b/lib/screens/about.dart index 12c44cb..369beb7 100644 --- a/lib/screens/about.dart +++ b/lib/screens/about.dart @@ -44,7 +44,7 @@ // SizedBox(height: 12), // Text( // 'GitTouch', -// style: TextStyle(fontSize: 20, color: theme.palette.text), +// style: TextStyle(fontSize: 20, color: AntTheme.of(context).text), // ), // SizedBox(height: 48), // AntList(items: [ diff --git a/lib/screens/bb_issue.dart b/lib/screens/bb_issue.dart index 0c7cc2e..fba25cb 100644 --- a/lib/screens/bb_issue.dart +++ b/lib/screens/bb_issue.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:git_touch/models/auth.dart'; import 'package:git_touch/models/bitbucket.dart'; @@ -13,7 +14,6 @@ import 'package:provider/provider.dart'; import 'package:tuple/tuple.dart'; class BbIssueScreen extends StatelessWidget { - const BbIssueScreen(this.owner, this.name, this.number, {this.isPr = false}); final String owner; final String name; @@ -65,7 +65,7 @@ class BbIssueScreen extends StatelessWidget { '$owner / $name', style: TextStyle( fontSize: 17, - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, ), ), const SizedBox(width: 4), @@ -73,7 +73,7 @@ class BbIssueScreen extends StatelessWidget { '#$number', style: TextStyle( fontSize: 17, - color: theme.palette.tertiaryText, + color: AntTheme.of(context).colorWeak, ), ), ], diff --git a/lib/screens/bb_issue_comment.dart b/lib/screens/bb_issue_comment.dart index afd2dd8..c8cbfb9 100644 --- a/lib/screens/bb_issue_comment.dart +++ b/lib/screens/bb_issue_comment.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/models/auth.dart'; @@ -30,7 +31,7 @@ class _BbIssueCommentScreenState extends State { Padding( padding: CommonStyle.padding, child: CupertinoTextField( - style: TextStyle(color: theme.palette.text), + style: TextStyle(color: AntTheme.of(context).colorText), placeholder: AppLocalizations.of(context)!.body, onChanged: (v) { setState(() { diff --git a/lib/screens/bb_issue_form.dart b/lib/screens/bb_issue_form.dart index ecd8956..56d95bd 100644 --- a/lib/screens/bb_issue_form.dart +++ b/lib/screens/bb_issue_form.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/models/auth.dart'; @@ -31,7 +32,7 @@ class _BbIssueFormScreenState extends State { Padding( padding: CommonStyle.padding, child: CupertinoTextField( - style: TextStyle(color: theme.palette.text), + style: TextStyle(color: AntTheme.of(context).colorText), placeholder: AppLocalizations.of(context)!.title, onChanged: (v) { setState(() { @@ -43,7 +44,7 @@ class _BbIssueFormScreenState extends State { Padding( padding: CommonStyle.padding, child: CupertinoTextField( - style: TextStyle(color: theme.palette.text), + style: TextStyle(color: AntTheme.of(context).colorText), placeholder: AppLocalizations.of(context)!.body, onChanged: (v) { setState(() { diff --git a/lib/screens/bb_repo.dart b/lib/screens/bb_repo.dart index c78c8f6..f088b52 100644 --- a/lib/screens/bb_repo.dart +++ b/lib/screens/bb_repo.dart @@ -1,6 +1,5 @@ -import 'dart:convert'; +import 'package:antd_mobile/antd_mobile.dart';import 'dart:convert'; -import 'package:antd_mobile/antd_mobile.dart'; import 'package:filesize/filesize.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; diff --git a/lib/screens/ge_commit.dart b/lib/screens/ge_commit.dart index 2b5bef6..dceec37 100644 --- a/lib/screens/ge_commit.dart +++ b/lib/screens/ge_commit.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:git_touch/models/auth.dart'; import 'package:git_touch/models/gitee.dart'; @@ -48,7 +49,7 @@ class GeCommitScreen extends StatelessWidget { '$owner / $name', style: TextStyle( fontSize: 17, - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, ), ), const SizedBox(width: 4), @@ -56,7 +57,7 @@ class GeCommitScreen extends StatelessWidget { sha.substring(0, 7), style: TextStyle( fontSize: 17, - color: theme.palette.tertiaryText, + color: AntTheme.of(context).colorWeak, ), ), ], diff --git a/lib/screens/ge_contributors.dart b/lib/screens/ge_contributors.dart index 59dabb4..07ec487 100644 --- a/lib/screens/ge_contributors.dart +++ b/lib/screens/ge_contributors.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; @@ -51,7 +52,7 @@ class GeContributorsScreen extends StatelessWidget { Text( v.name!, style: TextStyle( - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, fontSize: 18, fontWeight: FontWeight.w600, ), @@ -62,7 +63,7 @@ class GeContributorsScreen extends StatelessWidget { if (v.contributions != null) DefaultTextStyle( style: TextStyle( - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, fontSize: 16, ), child: Text('Contributions: ${v.contributions}'), diff --git a/lib/screens/ge_issue.dart b/lib/screens/ge_issue.dart index 9a68c0c..6ba0105 100644 --- a/lib/screens/ge_issue.dart +++ b/lib/screens/ge_issue.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:git_touch/models/auth.dart'; import 'package:git_touch/models/gitee.dart'; @@ -91,7 +92,7 @@ class GeIssueScreen extends StatelessWidget { '$owner / $name', style: TextStyle( fontSize: 17, - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, ), ), const SizedBox(width: 4), @@ -99,7 +100,7 @@ class GeIssueScreen extends StatelessWidget { '#$number', style: TextStyle( fontSize: 17, - color: theme.palette.tertiaryText, + color: AntTheme.of(context).colorWeak, ), ), ], diff --git a/lib/screens/ge_issue_comment.dart b/lib/screens/ge_issue_comment.dart index 456a1e0..1e6e7f3 100644 --- a/lib/screens/ge_issue_comment.dart +++ b/lib/screens/ge_issue_comment.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/models/auth.dart'; @@ -45,7 +46,7 @@ class _GeIssueCommentScreenState extends State { padding: CommonStyle.padding, child: CupertinoTextField( controller: _controller, - style: TextStyle(color: theme.palette.text), + style: TextStyle(color: AntTheme.of(context).colorText), placeholder: AppLocalizations.of(context)!.body, maxLines: 10, ), diff --git a/lib/screens/ge_issue_form.dart b/lib/screens/ge_issue_form.dart index e72885e..9ba3cbd 100644 --- a/lib/screens/ge_issue_form.dart +++ b/lib/screens/ge_issue_form.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/models/auth.dart'; @@ -31,7 +32,7 @@ class _GeIssueFormScreenState extends State { Padding( padding: CommonStyle.padding, child: CupertinoTextField( - style: TextStyle(color: theme.palette.text), + style: TextStyle(color: AntTheme.of(context).colorText), placeholder: AppLocalizations.of(context)!.title, onChanged: (v) { setState(() { @@ -43,7 +44,7 @@ class _GeIssueFormScreenState extends State { Padding( padding: CommonStyle.padding, child: CupertinoTextField( - style: TextStyle(color: theme.palette.text), + style: TextStyle(color: AntTheme.of(context).colorText), placeholder: AppLocalizations.of(context)!.body, onChanged: (v) { setState(() { diff --git a/lib/screens/ge_pull.dart b/lib/screens/ge_pull.dart index 89bca84..ba91c1a 100644 --- a/lib/screens/ge_pull.dart +++ b/lib/screens/ge_pull.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/material.dart'; import 'package:git_touch/models/auth.dart'; import 'package:git_touch/models/gitee.dart'; @@ -114,7 +115,8 @@ class GePullScreen extends StatelessWidget { '$owner / $name', style: TextStyle( fontSize: 17, - color: theme.palette.secondaryText, + color: AntTheme.of(context) + .colorTextSecondary, ), ), const SizedBox(width: 4), @@ -122,7 +124,7 @@ class GePullScreen extends StatelessWidget { '#$number', style: TextStyle( fontSize: 17, - color: theme.palette.tertiaryText, + color: AntTheme.of(context).colorWeak, ), ), ], @@ -157,7 +159,8 @@ class GePullScreen extends StatelessWidget { Text( '${files.length} files changed', style: TextStyle( - color: theme.palette.secondaryText, + color: AntTheme.of(context) + .colorTextSecondary, fontSize: 17, ), ), @@ -180,7 +183,8 @@ class GePullScreen extends StatelessWidget { ), Icon( Ionicons.chevron_forward, - color: theme.palette.border, + color: + AntTheme.of(context).colorBorder, ), ], ) @@ -195,7 +199,7 @@ class GePullScreen extends StatelessWidget { title: Text( 'Commits', style: TextStyle( - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, fontSize: 18, fontWeight: FontWeight.w600, ), @@ -215,7 +219,8 @@ class GePullScreen extends StatelessWidget { Text( commit.sha!.substring(0, 7), style: TextStyle( - color: theme.palette.primary, + color: AntTheme.of(context) + .colorPrimary, fontSize: 17, fontFamily: CommonStyle.monospace, diff --git a/lib/screens/ge_repo.dart b/lib/screens/ge_repo.dart index 59cbae7..5db5a85 100644 --- a/lib/screens/ge_repo.dart +++ b/lib/screens/ge_repo.dart @@ -1,7 +1,6 @@ -import 'dart:convert'; +import 'package:antd_mobile/antd_mobile.dart';import 'dart:convert'; import 'dart:io'; -import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/models/auth.dart'; diff --git a/lib/screens/ge_search.dart b/lib/screens/ge_search.dart index b9117a1..9b1d1bb 100644 --- a/lib/screens/ge_search.dart +++ b/lib/screens/ge_search.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/models/auth.dart'; @@ -122,7 +123,7 @@ class _GeSearchScreenState extends State { return CommonScaffold( title: Container( - color: theme.palette.background, + color: AntTheme.of(context).colorBackground, child: CupertinoTextField( prefix: Row( children: const [ diff --git a/lib/screens/gh_issue.dart b/lib/screens/gh_issue.dart index 9d080e3..ad45ea5 100644 --- a/lib/screens/gh_issue.dart +++ b/lib/screens/gh_issue.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:ferry/ferry.dart'; import 'package:flutter/widgets.dart'; import 'package:git_touch/graphql/__generated__/github.data.gql.dart'; @@ -5,18 +6,17 @@ import 'package:git_touch/graphql/__generated__/github.req.gql.dart'; import 'package:git_touch/graphql/__generated__/github.var.gql.dart'; import 'package:git_touch/models/auth.dart'; import 'package:git_touch/models/theme.dart'; +import 'package:git_touch/scaffolds/long_list.dart'; import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/widgets/action_button.dart'; import 'package:git_touch/widgets/avatar.dart'; +import 'package:git_touch/widgets/comment_item.dart'; import 'package:git_touch/widgets/link.dart'; import 'package:git_touch/widgets/timeline_item.dart'; import 'package:github/github.dart' as github; import 'package:primer/primer.dart'; import 'package:provider/provider.dart'; -import 'package:git_touch/scaffolds/long_list.dart'; -import 'package:git_touch/widgets/comment_item.dart'; - class GhIssueScreen extends StatelessWidget { const GhIssueScreen(this.owner, this.name, this.number); final String owner; @@ -50,7 +50,7 @@ class GhIssueScreen extends StatelessWidget { '$owner / $name', style: TextStyle( fontSize: 17, - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, ), ), const SizedBox(width: 4), @@ -58,7 +58,7 @@ class GhIssueScreen extends StatelessWidget { '#$number', style: TextStyle( fontSize: 17, - color: theme.palette.tertiaryText, + color: AntTheme.of(context).colorWeak, ), ), ], @@ -226,7 +226,7 @@ class GhIssueScreen extends StatelessWidget { children: [ Text('${pr.changedFiles} files changed', style: TextStyle( - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, fontSize: 17, )), Row( @@ -243,7 +243,7 @@ class GhIssueScreen extends StatelessWidget { fontSize: 15, )), Icon(Ionicons.chevron_forward, - color: theme.palette.border), + color: AntTheme.of(context).colorBorder), ], ) ], diff --git a/lib/screens/gh_issue_form.dart b/lib/screens/gh_issue_form.dart index 536f5b7..192a541 100644 --- a/lib/screens/gh_issue_form.dart +++ b/lib/screens/gh_issue_form.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/models/auth.dart'; @@ -31,7 +32,7 @@ class _GhIssueFormScreenState extends State { Padding( padding: CommonStyle.padding, child: CupertinoTextField( - style: TextStyle(color: theme.palette.text), + style: TextStyle(color: AntTheme.of(context).colorText), placeholder: AppLocalizations.of(context)!.title, onChanged: (v) { setState(() { @@ -43,7 +44,7 @@ class _GhIssueFormScreenState extends State { Padding( padding: CommonStyle.padding, child: CupertinoTextField( - style: TextStyle(color: theme.palette.text), + style: TextStyle(color: AntTheme.of(context).colorText), placeholder: AppLocalizations.of(context)!.body, onChanged: (v) { setState(() { diff --git a/lib/screens/gh_notification.dart b/lib/screens/gh_notification.dart index a006471..6c2984f 100644 --- a/lib/screens/gh_notification.dart +++ b/lib/screens/gh_notification.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; @@ -6,14 +7,13 @@ import 'package:git_touch/models/github.dart'; import 'package:git_touch/models/notification.dart'; import 'package:git_touch/models/theme.dart'; import 'package:git_touch/scaffolds/tab_stateful.dart'; -import 'package:git_touch/widgets/app_bar_title.dart'; -import 'package:github/github.dart'; -import 'package:provider/provider.dart'; - import 'package:git_touch/utils/utils.dart'; +import 'package:git_touch/widgets/app_bar_title.dart'; import 'package:git_touch/widgets/empty.dart'; import 'package:git_touch/widgets/list_group.dart'; import 'package:git_touch/widgets/notification_item.dart'; +import 'package:github/github.dart'; +import 'package:provider/provider.dart'; class GhNotificationScreen extends StatefulWidget { @override @@ -117,7 +117,7 @@ ${item.key}: pullRequest(number: ${item.subject!.number}) { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: theme.palette.text, + color: AntTheme.of(context).colorText, ), ), GestureDetector( @@ -132,7 +132,7 @@ ${item.key}: pullRequest(number: ${item.subject!.number}) { }, child: Icon( Ionicons.checkmark_done, - color: theme.palette.tertiaryText, + color: AntTheme.of(context).colorWeak, size: 24, ), ), diff --git a/lib/screens/gh_search.dart b/lib/screens/gh_search.dart index 710eed0..367b0c2 100644 --- a/lib/screens/gh_search.dart +++ b/lib/screens/gh_search.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/models/auth.dart'; @@ -182,7 +183,7 @@ class _GhSearchScreenState extends State { return CommonScaffold( title: Container( - color: theme.palette.background, + color: AntTheme.of(context).colorBackground, child: CupertinoTextField( prefix: Row( children: const [ diff --git a/lib/screens/gh_trending.dart b/lib/screens/gh_trending.dart index 9f6c636..de6bab6 100644 --- a/lib/screens/gh_trending.dart +++ b/lib/screens/gh_trending.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/models/theme.dart'; @@ -66,7 +67,8 @@ class GhTrendingScreen extends StatelessWidget { Icon( Octicons.repo, size: 17, - color: theme.palette.secondaryText, + color: AntTheme.of(context) + .colorTextSecondary, ), const SizedBox(width: 4), Expanded( @@ -74,7 +76,8 @@ class GhTrendingScreen extends StatelessWidget { '${v.username} / ${v.repo!.name}', style: TextStyle( fontSize: 17, - color: theme.palette.secondaryText, + color: AntTheme.of(context) + .colorTextSecondary, ), overflow: TextOverflow.ellipsis, )) diff --git a/lib/screens/gh_user.dart b/lib/screens/gh_user.dart index edf308d..41b6841 100644 --- a/lib/screens/gh_user.dart +++ b/lib/screens/gh_user.dart @@ -139,7 +139,8 @@ class _User extends StatelessWidget { child: TextWithAt( text: p.company!, linkFactory: (text) => '/github/${text.substring(1)}', - style: TextStyle(fontSize: 17, color: theme.palette.text), + style: TextStyle( + fontSize: 17, color: AntTheme.of(context).colorText), oneLine: true, ), ), diff --git a/lib/screens/gl_issue_form.dart b/lib/screens/gl_issue_form.dart index 12d7b84..f483bca 100644 --- a/lib/screens/gl_issue_form.dart +++ b/lib/screens/gl_issue_form.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/models/auth.dart'; @@ -30,7 +31,7 @@ class _GlIssueFormScreenState extends State { Padding( padding: CommonStyle.padding, child: CupertinoTextField( - style: TextStyle(color: theme.palette.text), + style: TextStyle(color: AntTheme.of(context).colorText), placeholder: AppLocalizations.of(context)!.title, onChanged: (v) { setState(() { @@ -42,7 +43,7 @@ class _GlIssueFormScreenState extends State { Padding( padding: CommonStyle.padding, child: CupertinoTextField( - style: TextStyle(color: theme.palette.text), + style: TextStyle(color: AntTheme.of(context).colorText), placeholder: AppLocalizations.of(context)!.body, onChanged: (v) { setState(() { diff --git a/lib/screens/gl_project_activity.dart b/lib/screens/gl_project_activity.dart index 01db298..f77f106 100644 --- a/lib/screens/gl_project_activity.dart +++ b/lib/screens/gl_project_activity.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/models/auth.dart'; @@ -44,7 +45,7 @@ class GlProjectActivityScreen extends StatelessWidget { TextSpan( text: data.author!.name, style: TextStyle( - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, fontWeight: FontWeight.w500, ), ), diff --git a/lib/screens/gl_search.dart b/lib/screens/gl_search.dart index 559ccfb..5939aa0 100644 --- a/lib/screens/gl_search.dart +++ b/lib/screens/gl_search.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/models/auth.dart'; @@ -98,7 +99,7 @@ class _GlSearchScreenState extends State { return CommonScaffold( title: Container( - color: theme.palette.background, + color: AntTheme.of(context).colorBackground, child: CupertinoTextField( prefix: Row( children: const [ diff --git a/lib/screens/gl_todos.dart b/lib/screens/gl_todos.dart index cc4dcba..9fa47ee 100644 --- a/lib/screens/gl_todos.dart +++ b/lib/screens/gl_todos.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:git_touch/models/auth.dart'; import 'package:git_touch/models/gitlab.dart'; @@ -13,7 +14,7 @@ class GlTodosScreen extends StatelessWidget { final theme = Provider.of(context); return TextSpan( text: p.author!.name, - style: TextStyle(color: theme.palette.primary), + style: TextStyle(color: AntTheme.of(context).colorPrimary), ); } @@ -21,7 +22,7 @@ class GlTodosScreen extends StatelessWidget { final theme = Provider.of(context); return TextSpan( text: '${p.project!.pathWithNamespace}!${p.target!.iid}', - style: TextStyle(color: theme.palette.primary), + style: TextStyle(color: AntTheme.of(context).colorPrimary), ); } @@ -86,7 +87,8 @@ class GlTodosScreen extends StatelessWidget { child: Text.rich( TextSpan( style: TextStyle( - color: theme.palette.text, fontSize: 17), + color: AntTheme.of(context).colorText, + fontSize: 17), children: [ ..._buildItem(context, item), ], diff --git a/lib/screens/go_repo.dart b/lib/screens/go_repo.dart index c416a4c..0f8b943 100644 --- a/lib/screens/go_repo.dart +++ b/lib/screens/go_repo.dart @@ -1,6 +1,5 @@ -import 'dart:convert'; +import 'package:antd_mobile/antd_mobile.dart';import 'dart:convert'; -import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/models/auth.dart'; diff --git a/lib/screens/gt_issue.dart b/lib/screens/gt_issue.dart index c5d7f13..622ca78 100644 --- a/lib/screens/gt_issue.dart +++ b/lib/screens/gt_issue.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:git_touch/models/auth.dart'; import 'package:git_touch/models/gitea.dart'; @@ -91,7 +92,7 @@ class GtIssueScreen extends StatelessWidget { '$owner / $name', style: TextStyle( fontSize: 17, - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, ), ), const SizedBox(width: 4), @@ -99,7 +100,7 @@ class GtIssueScreen extends StatelessWidget { '#$number', style: TextStyle( fontSize: 17, - color: theme.palette.tertiaryText, + color: AntTheme.of(context).colorWeak, ), ), ], diff --git a/lib/screens/gt_issue_comment.dart b/lib/screens/gt_issue_comment.dart index bbfb052..5bf8c9c 100644 --- a/lib/screens/gt_issue_comment.dart +++ b/lib/screens/gt_issue_comment.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/models/auth.dart'; @@ -45,7 +46,7 @@ class _GtIssueCommentScreenState extends State { padding: CommonStyle.padding, child: CupertinoTextField( controller: _controller, - style: TextStyle(color: theme.palette.text), + style: TextStyle(color: AntTheme.of(context).colorText), placeholder: AppLocalizations.of(context)!.body, maxLines: 10, ), diff --git a/lib/screens/gt_issue_form.dart b/lib/screens/gt_issue_form.dart index 1d84938..3844f69 100644 --- a/lib/screens/gt_issue_form.dart +++ b/lib/screens/gt_issue_form.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:git_touch/models/auth.dart'; @@ -31,7 +32,7 @@ class _GtIssueFormScreenState extends State { Padding( padding: CommonStyle.padding, child: CupertinoTextField( - style: TextStyle(color: theme.palette.text), + style: TextStyle(color: AntTheme.of(context).colorText), placeholder: AppLocalizations.of(context)!.title, onChanged: (v) { setState(() { @@ -43,7 +44,7 @@ class _GtIssueFormScreenState extends State { Padding( padding: CommonStyle.padding, child: CupertinoTextField( - style: TextStyle(color: theme.palette.text), + style: TextStyle(color: AntTheme.of(context).colorText), placeholder: AppLocalizations.of(context)!.body, onChanged: (v) { setState(() { diff --git a/lib/screens/gt_repo.dart b/lib/screens/gt_repo.dart index 35d48e3..6714629 100644 --- a/lib/screens/gt_repo.dart +++ b/lib/screens/gt_repo.dart @@ -1,6 +1,5 @@ -import 'dart:convert'; +import 'package:antd_mobile/antd_mobile.dart';import 'dart:convert'; -import 'package:antd_mobile/antd_mobile.dart'; import 'package:filesize/filesize.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_gen/gen_l10n/S.dart'; diff --git a/lib/screens/image_view.dart b/lib/screens/image_view.dart index b282a3e..1db4282 100644 --- a/lib/screens/image_view.dart +++ b/lib/screens/image_view.dart @@ -18,7 +18,7 @@ // title: title, // body: PhotoView( // imageProvider: NetworkImage(url), -// backgroundDecoration: BoxDecoration(color: theme.palette.background), +// backgroundDecoration: BoxDecoration(color: AntTheme.of(context).background), // ), // ); // } diff --git a/lib/screens/login.dart b/lib/screens/login.dart index 31e90cc..9e9daa9 100644 --- a/lib/screens/login.dart +++ b/lib/screens/login.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/widgets.dart'; @@ -49,7 +50,8 @@ class _LoginScreenState extends State { child: Container( padding: CommonStyle.padding, decoration: BoxDecoration( - border: Border(bottom: BorderSide(color: theme.palette.border)), + border: Border( + bottom: BorderSide(color: AntTheme.of(context).colorBorder)), ), child: Row( children: [ @@ -61,12 +63,14 @@ class _LoginScreenState extends State { children: [ Text( account.login, - style: TextStyle(fontSize: 20, color: theme.palette.text), + style: TextStyle( + fontSize: 20, color: AntTheme.of(context).colorText), ), const Padding(padding: EdgeInsets.only(top: 6)), Text( account.domain, - style: TextStyle(color: theme.palette.secondaryText), + style: TextStyle( + color: AntTheme.of(context).colorTextSecondary), ) ], ), @@ -88,7 +92,8 @@ class _LoginScreenState extends State { child: Container( padding: const EdgeInsets.symmetric(vertical: 20), decoration: BoxDecoration( - border: Border(bottom: BorderSide(color: theme.palette.border)), + border: Border( + bottom: BorderSide(color: AntTheme.of(context).colorBorder)), ), child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -173,7 +178,7 @@ class _LoginScreenState extends State { 'user, repo, read:org, notifications', style: TextStyle( fontSize: 16, - color: theme.palette.primary), + color: AntTheme.of(context).colorPrimary), ) ]), ); @@ -212,7 +217,8 @@ class _LoginScreenState extends State { Text( 'api, read_user, read_repository', style: TextStyle( - fontSize: 16, color: theme.palette.primary), + fontSize: 16, + color: AntTheme.of(context).colorPrimary), ) ], ), @@ -257,8 +263,8 @@ class _LoginScreenState extends State { ), TextSpan( text: 'this guide', - style: - TextStyle(color: theme.palette.primary), + style: TextStyle( + color: AntTheme.of(context).colorPrimary), recognizer: TapGestureRecognizer() ..onTap = () { context.pushUrl( @@ -279,7 +285,8 @@ class _LoginScreenState extends State { Text( 'Account: read\nTeam membership: read\nProjects: read\nRepositories: read\nPull requests: read\nIssues: read\nSnippets: read', style: TextStyle( - fontSize: 16, color: theme.palette.primary), + fontSize: 16, + color: AntTheme.of(context).colorPrimary), ) ], ), @@ -316,7 +323,8 @@ class _LoginScreenState extends State { Text( 'https://codeberg.org', style: TextStyle( - fontSize: 16, color: theme.palette.primary), + fontSize: 16, + color: AntTheme.of(context).colorPrimary), ), ], )); @@ -375,7 +383,7 @@ class _LoginScreenState extends State { AppLocalizations.of(context)!.longPressToRemoveAccount, style: TextStyle( fontSize: 16, - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, ), ), ) diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 1bd44f0..1bcd94c 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/widgets.dart'; import 'package:git_touch/models/theme.dart'; @@ -64,7 +65,7 @@ TextSpan createLinkSpan( return TextSpan( text: text, style: TextStyle( - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, fontWeight: FontWeight.w600, ), recognizer: TapGestureRecognizer() diff --git a/lib/widgets/blob_view.dart b/lib/widgets/blob_view.dart index d8f57fb..dc13da3 100644 --- a/lib/widgets/blob_view.dart +++ b/lib/widgets/blob_view.dart @@ -37,7 +37,7 @@ class BlobView extends StatelessWidget { case 'webp': // return PhotoView( // imageProvider: MemoryImage(Uint8List.fromList(bits)), - // backgroundDecoration: BoxDecoration(color: theme.palette.background), + // backgroundDecoration: BoxDecoration(color: AntTheme.of(context).background), // ); return base64Text == null ? Image.network( diff --git a/lib/widgets/border_view.dart b/lib/widgets/border_view.dart index 8c898cc..0bf1475 100644 --- a/lib/widgets/border_view.dart +++ b/lib/widgets/border_view.dart @@ -1,9 +1,9 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:git_touch/models/theme.dart'; import 'package:provider/provider.dart'; class BorderView extends StatelessWidget { - const BorderView({ this.height, this.leftPadding = 0, @@ -21,7 +21,7 @@ class BorderView extends StatelessWidget { margin: EdgeInsets.only(left: leftPadding), decoration: BoxDecoration( border: Border( - top: BorderSide(color: theme.palette.border, width: 0), + top: BorderSide(color: AntTheme.of(context).colorBorder, width: 0), ), ), ); @@ -33,14 +33,16 @@ class BorderView extends StatelessWidget { width: leftPadding, height: height, child: DecoratedBox( - decoration: BoxDecoration(color: theme.palette.background), + decoration: + BoxDecoration(color: AntTheme.of(context).colorBackground), ), ), Expanded( child: SizedBox( height: height, child: DecoratedBox( - decoration: BoxDecoration(color: theme.palette.border), + decoration: + BoxDecoration(color: AntTheme.of(context).colorBorder), ), ), ), diff --git a/lib/widgets/comment_item.dart b/lib/widgets/comment_item.dart index 98bcaff..da7378b 100644 --- a/lib/widgets/comment_item.dart +++ b/lib/widgets/comment_item.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:git_touch/graphql/__generated__/github.data.gql.dart'; import 'package:git_touch/graphql/__generated__/schema.schema.gql.dart'; @@ -138,7 +139,8 @@ mutation { const SizedBox(width: 4), Text(numberFormat.format(item.count), style: TextStyle( - color: theme.palette.primary, fontSize: 14)) + color: AntTheme.of(context).colorPrimary, + fontSize: 14)) ], ), ), @@ -160,8 +162,10 @@ mutation { child: Wrap( crossAxisAlignment: WrapCrossAlignment.center, children: [ - Text('+', style: TextStyle(color: theme.palette.primary)), - Icon(Octicons.smiley, color: theme.palette.primary, size: 18), + Text('+', + style: TextStyle(color: AntTheme.of(context).colorPrimary)), + Icon(Octicons.smiley, + color: AntTheme.of(context).colorPrimary, size: 18), ], ), ), @@ -224,7 +228,7 @@ class CommentItem extends StatelessWidget { Text( timeago.format(createdAt!), style: TextStyle( - color: theme.palette.tertiaryText, fontSize: 13), + color: AntTheme.of(context).colorWeak, fontSize: 13), ), ], ), diff --git a/lib/widgets/commit_item.dart b/lib/widgets/commit_item.dart index 80ed939..a922599 100644 --- a/lib/widgets/commit_item.dart +++ b/lib/widgets/commit_item.dart @@ -44,7 +44,7 @@ class CommitItem extends StatelessWidget { message!, style: TextStyle( fontSize: 17, - color: theme.palette.text, + color: AntTheme.of(context).colorText, ), overflow: TextOverflow.ellipsis, maxLines: 1, @@ -54,11 +54,12 @@ class CommitItem extends StatelessWidget { children: [ Text(author!, style: TextStyle( - fontSize: 15, color: theme.palette.primary)), + fontSize: 15, + color: AntTheme.of(context).colorPrimary)), Text( ' committed ${timeago.format(createdAt!)}', style: TextStyle( - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, fontSize: 15, ), ), diff --git a/lib/widgets/contributor_item.dart b/lib/widgets/contributor_item.dart index e101963..e12f13b 100644 --- a/lib/widgets/contributor_item.dart +++ b/lib/widgets/contributor_item.dart @@ -38,7 +38,7 @@ class ContributorItem extends StatelessWidget { Text( login!, style: TextStyle( - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, fontSize: 18, fontWeight: FontWeight.w600, ), @@ -49,7 +49,7 @@ class ContributorItem extends StatelessWidget { if (commits != null) DefaultTextStyle( style: TextStyle( - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, fontSize: 16, ), child: Text('Commits: $commits'), diff --git a/lib/widgets/diff_view.dart b/lib/widgets/diff_view.dart index 2a7433e..90e1e4e 100644 --- a/lib/widgets/diff_view.dart +++ b/lib/widgets/diff_view.dart @@ -57,7 +57,7 @@ // Text( // c.heading, // style: TextStyle( -// color: theme.palette.tertiaryText, +// color: AntTheme.of(context).tertiaryText, // backgroundColor: Color(0xfffafafa), // ), // ), @@ -79,7 +79,7 @@ // style: TextStyle( // fontFamily: code.fontFamilyUsed, // fontSize: 14, -// color: theme.palette.text, +// color: AntTheme.of(context).text, // ), // ); // } diff --git a/lib/widgets/entry_item.dart b/lib/widgets/entry_item.dart index 7a720f2..0f295e8 100644 --- a/lib/widgets/entry_item.dart +++ b/lib/widgets/entry_item.dart @@ -1,11 +1,11 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:git_touch/models/theme.dart'; import 'package:git_touch/utils/utils.dart'; -import 'package:provider/provider.dart'; import 'package:git_touch/widgets/link.dart'; +import 'package:provider/provider.dart'; class EntryItem extends StatelessWidget { - const EntryItem({ required this.text, this.count, @@ -31,14 +31,14 @@ class EntryItem extends StatelessWidget { style: TextStyle( fontSize: 17, fontWeight: FontWeight.w600, - color: theme.palette.text, + color: AntTheme.of(context).colorText, ), ), Text( text, style: TextStyle( fontSize: 14, - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, fontWeight: FontWeight.w500, ), ) diff --git a/lib/widgets/event_item.dart b/lib/widgets/event_item.dart index 5efb0fd..2990281 100644 --- a/lib/widgets/event_item.dart +++ b/lib/widgets/event_item.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/widgets.dart'; @@ -20,7 +21,7 @@ class EventItem extends StatelessWidget { final theme = Provider.of(context); return TextSpan( text: text, - style: TextStyle(color: theme.palette.primary), + style: TextStyle(color: AntTheme.of(context).colorPrimary), recognizer: TapGestureRecognizer() ..onTap = () { context.pushUrl(url!); @@ -65,7 +66,7 @@ class EventItem extends StatelessWidget { TextSpan( style: TextStyle( fontSize: 17, - color: theme.palette.text, + color: AntTheme.of(context).colorText, ), children: [ _buildLinkSpan(context, e.actor!.login, @@ -80,7 +81,7 @@ class EventItem extends StatelessWidget { Text(timeago.format(e.createdAt!), style: TextStyle( fontSize: 14, - color: theme.palette.tertiaryText, + color: AntTheme.of(context).colorWeak, )), ], ), @@ -102,7 +103,7 @@ class EventItem extends StatelessWidget { spans: [ TextSpan( text: ' ${e.type!}', - style: TextStyle(color: theme.palette.primary), + style: TextStyle(color: AntTheme.of(context).colorPrimary), ) ], card: Text( @@ -117,15 +118,16 @@ class EventItem extends StatelessWidget { '/github/${e.repoOwner}/${e.repoName}/compare/${e.payload!.before}/${e.payload!.head}', child: Container( padding: const EdgeInsets.all(12), - decoration: BoxDecoration( - color: theme.palette.grayBackground, - borderRadius: const BorderRadius.all(Radius.circular(4))), + decoration: const BoxDecoration( + color: Color(0xffcccccc), + borderRadius: BorderRadius.all(Radius.circular(4))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text.rich( TextSpan( - style: TextStyle(color: theme.palette.text, fontSize: 15), + style: TextStyle( + color: AntTheme.of(context).colorText, fontSize: 15), children: [ TextSpan( text: @@ -144,7 +146,7 @@ class EventItem extends StatelessWidget { Text( commit.sha!.substring(0, 7), style: TextStyle( - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, fontSize: 15, fontFamily: CommonStyle.monospace, ), @@ -155,7 +157,8 @@ class EventItem extends StatelessWidget { commit.message!, overflow: TextOverflow.ellipsis, maxLines: 1, - style: TextStyle(color: theme.palette.text, fontSize: 15), + style: TextStyle( + color: AntTheme.of(context).colorText, fontSize: 15), ), ) ], @@ -175,7 +178,7 @@ class EventItem extends StatelessWidget { child: Container( padding: const EdgeInsets.all(12), decoration: BoxDecoration( - color: theme.palette.grayBackground, + color: AntTheme.of(context).colorBox, borderRadius: const BorderRadius.all(Radius.circular(4))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -185,7 +188,7 @@ class EventItem extends StatelessWidget { Text( e.payload!.comment!.commitId!.substring(0, 7), style: TextStyle( - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, fontSize: 15, fontFamily: CommonStyle.monospace, ), @@ -196,7 +199,8 @@ class EventItem extends StatelessWidget { e.payload!.comment!.body!, overflow: TextOverflow.ellipsis, maxLines: 1, - style: TextStyle(color: theme.palette.text, fontSize: 15), + style: TextStyle( + color: AntTheme.of(context).colorText, fontSize: 15), ), ) ], @@ -234,7 +238,7 @@ class EventItem extends StatelessWidget { child: Container( padding: const EdgeInsets.all(12), decoration: BoxDecoration( - color: theme.palette.grayBackground, + color: AntTheme.of(context).colorBox, borderRadius: const BorderRadius.all(Radius.circular(4))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -249,7 +253,7 @@ class EventItem extends StatelessWidget { style: TextStyle( fontWeight: FontWeight.w500, fontSize: 17, - color: theme.palette.text, + color: AntTheme.of(context).colorText, ), overflow: TextOverflow.ellipsis, ), @@ -261,8 +265,9 @@ class EventItem extends StatelessWidget { body, overflow: TextOverflow.ellipsis, maxLines: 3, - style: - TextStyle(color: theme.palette.secondaryText, fontSize: 15), + style: TextStyle( + color: AntTheme.of(context).colorTextSecondary, + fontSize: 15), ), Row( children: [ @@ -271,20 +276,20 @@ class EventItem extends StatelessWidget { Text(issue.user!.login!, style: TextStyle( fontSize: 14, - color: theme.palette.tertiaryText, + color: AntTheme.of(context).colorWeak, )), Expanded(child: Container()), if (issue.comments != null) ...[ Icon( Octicons.comment, size: 14, - color: theme.palette.tertiaryText, + color: AntTheme.of(context).colorWeak, ), const SizedBox(width: 4), Text(issue.comments.toString(), style: TextStyle( fontSize: 14, - color: theme.palette.tertiaryText, + color: AntTheme.of(context).colorWeak, )), ] ], @@ -422,8 +427,7 @@ class EventItem extends StatelessWidget { ], ); case 'InstallationRepositoriesEvent': - final repositoriesAdded = - e.payload!.installation!.repositoriesAdded!; + final repositoriesAdded = e.payload!.installation!.repositoriesAdded!; final repositoriesRemoved = e.payload!.installation!.repositoriesRemoved!; var addedRepos = ''; diff --git a/lib/widgets/files_item.dart b/lib/widgets/files_item.dart index f780ef2..e3f425d 100644 --- a/lib/widgets/files_item.dart +++ b/lib/widgets/files_item.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_highlight/flutter_highlight.dart'; import 'package:flutter_highlight/theme_map.dart'; @@ -7,7 +8,6 @@ import 'package:git_touch/utils/utils.dart'; import 'package:provider/provider.dart'; class FilesItem extends StatelessWidget { - const FilesItem({ required this.filename, required this.status, @@ -26,13 +26,13 @@ class FilesItem extends StatelessWidget { final theme = Provider.of(context); final codeProvider = Provider.of(context); return Card( - color: theme.palette.background, + color: AntTheme.of(context).colorBackground, margin: const EdgeInsets.all(0), child: ExpansionTile( title: Text( filename!, style: TextStyle( - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, fontSize: 18, fontWeight: FontWeight.w600, ), diff --git a/lib/widgets/gists_item.dart b/lib/widgets/gists_item.dart index 8a1a1a9..53abcfb 100644 --- a/lib/widgets/gists_item.dart +++ b/lib/widgets/gists_item.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:from_css_color/from_css_color.dart'; import 'package:git_touch/models/theme.dart'; @@ -9,7 +10,6 @@ import 'package:provider/provider.dart'; import 'package:timeago/timeago.dart' as timeago; class GistsItem extends StatelessWidget { - const GistsItem({ required this.description, required this.login, @@ -56,14 +56,14 @@ class GistsItem extends StatelessWidget { text: '$login / ', style: TextStyle( fontSize: 18, - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, ), ), TextSpan( text: filenames[0], style: TextStyle( fontSize: 18, - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, fontWeight: FontWeight.w600, ), ), @@ -78,7 +78,7 @@ class GistsItem extends StatelessWidget { Text( description!, style: TextStyle( - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, fontSize: 16, ), ), @@ -89,13 +89,14 @@ class GistsItem extends StatelessWidget { 'Updated ${timeago.format(updatedAt!)}', style: TextStyle( fontSize: 14, - color: theme.palette.tertiaryText, + color: AntTheme.of(context).colorWeak, ), ), const SizedBox(height: 10), ], DefaultTextStyle( - style: TextStyle(color: theme.palette.text, fontSize: 14), + style: TextStyle( + color: AntTheme.of(context).colorText, fontSize: 14), child: Row( children: [ if (language != null) diff --git a/lib/widgets/issue_item.dart b/lib/widgets/issue_item.dart index 6da9426..c1e2c19 100644 --- a/lib/widgets/issue_item.dart +++ b/lib/widgets/issue_item.dart @@ -80,7 +80,7 @@ class IssueItem extends StatelessWidget { TextSpan( text: subtitle, style: TextStyle( - color: theme.palette.tertiaryText, + color: AntTheme.of(context).colorWeak, fontWeight: FontWeight.normal, ), ), @@ -88,7 +88,7 @@ class IssueItem extends StatelessWidget { ), style: TextStyle( fontSize: 17, - color: theme.palette.text, + color: AntTheme.of(context).colorText, fontWeight: FontWeight.w600, ), ), @@ -96,7 +96,7 @@ class IssueItem extends StatelessWidget { DefaultTextStyle( style: TextStyle( fontSize: 14, - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, ), child: Row( crossAxisAlignment: CrossAxisAlignment.center, @@ -118,14 +118,15 @@ class IssueItem extends StatelessWidget { ' opened ${timeago.format(updatedAt!)}', style: TextStyle( fontSize: 17, - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, ), overflow: TextOverflow.ellipsis, )), if (commentCount! > 0) ...[ const Expanded(child: SizedBox()), Icon(Octicons.comment, - size: 14, color: theme.palette.secondaryText), + size: 14, + color: AntTheme.of(context).colorTextSecondary), const SizedBox(width: 3), Text(numberFormat.format(commentCount)) ], diff --git a/lib/widgets/language_bar.dart b/lib/widgets/language_bar.dart index 583968e..199e132 100644 --- a/lib/widgets/language_bar.dart +++ b/lib/widgets/language_bar.dart @@ -40,7 +40,7 @@ class LanguageBar extends StatelessWidget { ); }, child: Container( - // color: theme.palette.background, + // color: AntTheme.of(context).background, padding: CommonStyle.padding.copyWith(top: 8, bottom: 8), child: ClipRRect( borderRadius: BorderRadius.circular(5), @@ -65,7 +65,7 @@ class LanguageBar extends StatelessWidget { Widget _buildPopup(BuildContext context) { final theme = Provider.of(context); return Container( - color: theme.palette.background, + color: AntTheme.of(context).colorBackground, padding: CommonStyle.padding, height: 300, child: SingleChildScrollView( @@ -87,10 +87,10 @@ class LanguageBar extends StatelessWidget { Text( edge.name!, style: TextStyle( - color: theme.palette.text, + color: AntTheme.of(context).colorText, fontSize: 18, decoration: TextDecoration.underline, - decorationColor: theme.palette.background, + decorationColor: AntTheme.of(context).colorBackground, ), ), ]), @@ -100,10 +100,10 @@ class LanguageBar extends StatelessWidget { child: Text( '${(edge.ratio! * 100).toStringAsFixed(1)}%', style: TextStyle( - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, fontSize: 18, decoration: TextDecoration.underline, - decorationColor: theme.palette.background, + decorationColor: AntTheme.of(context).colorBackground, ), ), ), diff --git a/lib/widgets/list_group.dart b/lib/widgets/list_group.dart index 62c62f9..990ea06 100644 --- a/lib/widgets/list_group.dart +++ b/lib/widgets/list_group.dart @@ -1,11 +1,10 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; -import 'package:provider/provider.dart'; - import 'package:git_touch/models/theme.dart'; import 'package:git_touch/widgets/empty.dart'; +import 'package:provider/provider.dart'; class ListGroup extends StatelessWidget { - const ListGroup({ required this.title, required this.items, @@ -21,7 +20,8 @@ class ListGroup extends StatelessWidget { final theme = Provider.of(context); return Container( decoration: BoxDecoration( - border: Border(top: BorderSide(color: theme.palette.border)), + border: + Border(top: BorderSide(color: AntTheme.of(context).colorBorder)), ), child: itemBuilder(entry.value, entry.key), ); @@ -34,7 +34,7 @@ class ListGroup extends StatelessWidget { padding: padding, child: Container( decoration: BoxDecoration( - border: Border.all(color: theme.palette.border), + border: Border.all(color: AntTheme.of(context).colorBorder), borderRadius: const BorderRadius.all(Radius.circular(3)), ), child: Column( diff --git a/lib/widgets/markdown_view.dart b/lib/widgets/markdown_view.dart index ca4aa37..7ba93cc 100644 --- a/lib/widgets/markdown_view.dart +++ b/lib/widgets/markdown_view.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_markdown/flutter_markdown.dart'; import 'package:git_touch/models/code.dart'; @@ -100,8 +101,8 @@ class MarkdownFlutterView extends StatelessWidget { Widget build(BuildContext context) { final theme = Provider.of(context); final code = Provider.of(context); - final basicStyle = - TextStyle(fontSize: 16, color: theme.palette.text, height: 1.5); + final basicStyle = TextStyle( + fontSize: 16, color: AntTheme.of(context).colorText, height: 1.5); final hStyle = basicStyle.copyWith(fontWeight: FontWeight.w600, height: 1.25); @@ -157,10 +158,10 @@ class MarkdownFlutterView extends StatelessWidget { launchStringUrl(url); }, styleSheet: MarkdownStyleSheet( - a: basicStyle.copyWith(color: theme.palette.primary), + a: basicStyle.copyWith(color: AntTheme.of(context).colorPrimary), p: basicStyle, code: basicStyle.copyWith( - backgroundColor: theme.palette.grayBackground, + backgroundColor: AntTheme.of(context).colorBox, fontSize: 16 * 0.85, height: 1.45, fontFamily: code.fontStyle.fontFamily, @@ -171,11 +172,12 @@ class MarkdownFlutterView extends StatelessWidget { h4: hStyle, h5: hStyle.copyWith(fontSize: 14), h6: hStyle.copyWith( - fontSize: 16 * 0.85, color: theme.palette.tertiaryText), + fontSize: 16 * 0.85, color: AntTheme.of(context).colorWeak), em: basicStyle.copyWith(fontStyle: FontStyle.italic), strong: basicStyle.copyWith(fontWeight: FontWeight.w600), del: const TextStyle(decoration: TextDecoration.lineThrough), - blockquote: basicStyle.copyWith(color: theme.palette.tertiaryText), + blockquote: + basicStyle.copyWith(color: AntTheme.of(context).colorWeak), img: basicStyle, checkbox: basicStyle, blockSpacing: 16, @@ -194,14 +196,14 @@ class MarkdownFlutterView extends StatelessWidget { ), codeblockPadding: const EdgeInsets.all(16), codeblockDecoration: BoxDecoration( - color: theme.palette.grayBackground, + color: AntTheme.of(context).colorBox, borderRadius: BorderRadius.circular(3), ), horizontalRuleDecoration: BoxDecoration( border: Border( top: BorderSide( width: 4, - color: theme.palette.grayBackground, + color: AntTheme.of(context).colorBox, ), ), ), diff --git a/lib/widgets/notification_item.dart b/lib/widgets/notification_item.dart index 7980fef..55f5af5 100644 --- a/lib/widgets/notification_item.dart +++ b/lib/widgets/notification_item.dart @@ -1,15 +1,14 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:git_touch/models/auth.dart'; import 'package:git_touch/models/github.dart'; +import 'package:git_touch/models/theme.dart'; import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/widgets/issue_icon.dart'; import 'package:git_touch/widgets/link.dart'; import 'package:provider/provider.dart'; -import 'package:git_touch/models/theme.dart'; - class NotificationItem extends StatefulWidget { - const NotificationItem({ Key? key, required this.payload, @@ -68,8 +67,9 @@ class _NotificationItemState extends State { final theme = Provider.of(context); return Icon( payload.unread! ? Ionicons.checkmark : Octicons.dot_fill, - color: - loading ? theme.palette.grayBackground : theme.palette.tertiaryText, + color: loading + ? AntTheme.of(context).colorBox + : AntTheme.of(context).colorWeak, size: 24, ); } @@ -133,7 +133,8 @@ class _NotificationItemState extends State { child: Text( payload.subject!.title!, overflow: TextOverflow.ellipsis, - style: TextStyle(fontSize: 15, color: theme.palette.text), + style: TextStyle( + fontSize: 15, color: AntTheme.of(context).colorText), ), ), LinkWidget(onTap: _markAsRead, child: _buildCheckIcon()), diff --git a/lib/widgets/release_item.dart b/lib/widgets/release_item.dart index db87ff2..a375642 100644 --- a/lib/widgets/release_item.dart +++ b/lib/widgets/release_item.dart @@ -47,7 +47,7 @@ class ReleaseItem extends StatelessWidget { Text( tagName!, style: TextStyle( - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, fontSize: 18, fontWeight: FontWeight.w600, ), @@ -57,7 +57,7 @@ class ReleaseItem extends StatelessWidget { const SizedBox(height: 6), DefaultTextStyle( style: TextStyle( - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, fontSize: 16, ), child: Text( @@ -74,13 +74,13 @@ class ReleaseItem extends StatelessWidget { const SizedBox(height: 10), ], Card( - color: theme.palette.grayBackground, + color: AntTheme.of(context).colorBox, margin: const EdgeInsets.all(0), child: ExpansionTile( title: Text( 'Assets (${releaseAssets?.nodes?.length ?? 0})', style: TextStyle( - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, fontSize: 18, fontWeight: FontWeight.w600, ), @@ -101,7 +101,7 @@ class ReleaseItem extends StatelessWidget { child: Text( asset.name, style: TextStyle( - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, fontSize: 14, fontWeight: FontWeight.w400, ), diff --git a/lib/widgets/repo_header.dart b/lib/widgets/repo_header.dart index a74e26b..2c2bcb7 100644 --- a/lib/widgets/repo_header.dart +++ b/lib/widgets/repo_header.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:git_touch/models/theme.dart'; import 'package:git_touch/utils/utils.dart'; @@ -47,7 +48,7 @@ class RepoHeader extends StatelessWidget { '$owner / $name', style: TextStyle( fontSize: 20, - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, ), overflow: TextOverflow.visible, ), @@ -59,7 +60,7 @@ class RepoHeader extends StatelessWidget { Text( description!, style: TextStyle( - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, fontSize: 17, ), ), @@ -69,7 +70,7 @@ class RepoHeader extends StatelessWidget { child: Text( homepageUrl!, style: TextStyle( - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, fontSize: 17, ), ), diff --git a/lib/widgets/repository_item.dart b/lib/widgets/repository_item.dart index 137c565..15684d7 100644 --- a/lib/widgets/repository_item.dart +++ b/lib/widgets/repository_item.dart @@ -165,14 +165,14 @@ class RepositoryItem extends StatelessWidget { text: '$owner / ', style: TextStyle( fontSize: 18, - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, ), ), TextSpan( text: name, style: TextStyle( fontSize: 18, - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, fontWeight: FontWeight.w600, ), // overflow: TextOverflow.ellipsis, @@ -184,9 +184,10 @@ class RepositoryItem extends StatelessWidget { if (iconData != null) ...[ const SizedBox(width: 6), DefaultTextStyle( - style: TextStyle(color: theme.palette.secondaryText), + style: + TextStyle(color: AntTheme.of(context).colorTextSecondary), child: Icon(iconData, - size: 18, color: theme.palette.secondaryText), + size: 18, color: AntTheme.of(context).colorTextSecondary), ), ] ], @@ -196,7 +197,7 @@ class RepositoryItem extends StatelessWidget { Text( description!, style: TextStyle( - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, fontSize: 16, ), ), @@ -207,13 +208,14 @@ class RepositoryItem extends StatelessWidget { note!, style: TextStyle( fontSize: 14, - color: theme.palette.tertiaryText, + color: AntTheme.of(context).colorWeak, ), ), const SizedBox(height: 10), ], DefaultTextStyle( - style: TextStyle(color: theme.palette.text, fontSize: 14), + style: + TextStyle(color: AntTheme.of(context).colorText, fontSize: 14), child: Row( children: [ if (primaryLanguageName != null) ...[ @@ -234,14 +236,15 @@ class RepositoryItem extends StatelessWidget { const SizedBox(width: 24), ], if (starCount! > 0) ...[ - Icon(Octicons.star, size: 16, color: theme.palette.text), + Icon(Octicons.star, + size: 16, color: AntTheme.of(context).colorText), const SizedBox(width: 2), Text(numberFormat.format(starCount)), const SizedBox(width: 24), ], if (forkCount! > 0) ...[ Icon(Octicons.repo_forked, - size: 16, color: theme.palette.text), + size: 16, color: AntTheme.of(context).colorText), const SizedBox(width: 2), Text(numberFormat.format(forkCount)), ], diff --git a/lib/widgets/text_field.dart b/lib/widgets/text_field.dart index 57afd74..410d3de 100644 --- a/lib/widgets/text_field.dart +++ b/lib/widgets/text_field.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/cupertino.dart'; import 'package:git_touch/models/theme.dart'; import 'package:provider/provider.dart'; @@ -14,7 +15,7 @@ class MyTextField extends StatelessWidget { return CupertinoTextField( controller: controller, placeholder: placeholder, - style: TextStyle(color: theme.palette.text), + style: TextStyle(color: AntTheme.of(context).colorText), ); } } diff --git a/lib/widgets/timeline_item.dart b/lib/widgets/timeline_item.dart index 9ebcf4a..854583c 100644 --- a/lib/widgets/timeline_item.dart +++ b/lib/widgets/timeline_item.dart @@ -40,7 +40,8 @@ class TimelineEventItem extends StatelessWidget { Expanded( child: Text.rich( TextSpan( - style: TextStyle(color: theme.palette.text, fontSize: 16), + style: TextStyle( + color: AntTheme.of(context).colorText, fontSize: 16), children: [ // TODO: actor is null createUserSpan(context, actor), @@ -415,12 +416,12 @@ class TimelineItem extends StatelessWidget { ' ${AppLocalizations.of(context)!.headRefForcedPushedEventSecondMessage} '), TextSpan( text: p.beforeCommit!.oid.substring(0, 7), - style: TextStyle(color: theme.palette.primary), + style: TextStyle(color: AntTheme.of(context).colorPrimary), ), TextSpan(text: ' ${AppLocalizations.of(context)!.to} '), TextSpan( text: p.afterCommit!.oid.substring(0, 7), - style: TextStyle(color: theme.palette.primary), + style: TextStyle(color: AntTheme.of(context).colorPrimary), ), ], ), @@ -441,12 +442,12 @@ class TimelineItem extends StatelessWidget { ' ${AppLocalizations.of(context)!.headRefForcedPushedEventSecondMessage} '), TextSpan( text: p.beforeCommit!.oid.substring(0, 7), - style: TextStyle(color: theme.palette.primary), + style: TextStyle(color: AntTheme.of(context).colorPrimary), ), TextSpan(text: ' ${AppLocalizations.of(context)!.to} '), TextSpan( text: p.afterCommit!.oid.substring(0, 7), - style: TextStyle(color: theme.palette.primary), + style: TextStyle(color: AntTheme.of(context).colorPrimary), ), ], ), diff --git a/lib/widgets/user_header.dart b/lib/widgets/user_header.dart index f585daf..872f8b1 100644 --- a/lib/widgets/user_header.dart +++ b/lib/widgets/user_header.dart @@ -1,3 +1,4 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:git_touch/models/theme.dart'; import 'package:git_touch/utils/utils.dart'; @@ -57,7 +58,7 @@ class UserHeader extends StatelessWidget { Text( name!, style: TextStyle( - color: theme.palette.text, + color: AntTheme.of(context).colorText, fontSize: 20, fontWeight: FontWeight.w600, ), @@ -67,7 +68,7 @@ class UserHeader extends StatelessWidget { Text( login!, style: TextStyle( - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, fontSize: 18, ), ), @@ -78,13 +79,13 @@ class UserHeader extends StatelessWidget { Icon( Octicons.clock, size: 16, - color: theme.palette.tertiaryText, + color: AntTheme.of(context).colorWeak, ), const SizedBox(width: 4), Text( 'Joined on ${dateFormat.format(createdAt!)}', style: TextStyle( - color: theme.palette.tertiaryText, + color: AntTheme.of(context).colorWeak, fontSize: 16, ), ), @@ -95,7 +96,7 @@ class UserHeader extends StatelessWidget { Text( bio!, style: TextStyle( - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, fontSize: 17, ), ) diff --git a/lib/widgets/user_item.dart b/lib/widgets/user_item.dart index 427b78f..7f37e5a 100644 --- a/lib/widgets/user_item.dart +++ b/lib/widgets/user_item.dart @@ -28,7 +28,7 @@ class GhBioWidget extends StatelessWidget { Icon( Octicons.location, size: 15, - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, ), const SizedBox(width: 4), Expanded(child: Text(location!, overflow: TextOverflow.ellipsis)), @@ -40,7 +40,7 @@ class GhBioWidget extends StatelessWidget { Icon( Octicons.clock, size: 15, - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, ), const SizedBox(width: 4), Expanded( @@ -146,7 +146,7 @@ class UserItem extends StatelessWidget { Text( name!, style: TextStyle( - color: theme.palette.text, + color: AntTheme.of(context).colorText, fontSize: 18, fontWeight: FontWeight.w500, ), @@ -157,7 +157,7 @@ class UserItem extends StatelessWidget { child: Text( login!, style: TextStyle( - color: theme.palette.text, + color: AntTheme.of(context).colorText, fontSize: 16, ), overflow: TextOverflow.ellipsis, @@ -169,7 +169,7 @@ class UserItem extends StatelessWidget { if (bio != null) DefaultTextStyle( style: TextStyle( - color: theme.palette.secondaryText, + color: AntTheme.of(context).colorTextSecondary, fontSize: 16, ), child: bio!, diff --git a/lib/widgets/user_name.dart b/lib/widgets/user_name.dart index a7bfe70..593697a 100644 --- a/lib/widgets/user_name.dart +++ b/lib/widgets/user_name.dart @@ -1,10 +1,10 @@ +import 'package:antd_mobile/antd_mobile.dart'; import 'package:flutter/widgets.dart'; import 'package:git_touch/models/theme.dart'; import 'package:git_touch/widgets/link.dart'; import 'package:provider/provider.dart'; class UserName extends StatelessWidget { - const UserName(this.login, this.prefix); final String? login; final String prefix; @@ -23,7 +23,7 @@ class UserName extends StatelessWidget { login!, style: TextStyle( fontWeight: FontWeight.w600, - color: theme.palette.primary, + color: AntTheme.of(context).colorPrimary, ), ), ),