diff --git a/lib/account/page/account_record_list_page.dart b/lib/account/page/account_record_list_page.dart index dcc818e41..fbc0cc038 100644 --- a/lib/account/page/account_record_list_page.dart +++ b/lib/account/page/account_record_list_page.dart @@ -62,7 +62,7 @@ class _AccountRecordListPageState extends State { right: 0.0, child: Text(i.isEven ? '+10.00' : '-10.00', style: i.isEven ? TextStyle( - color: Theme.of(context).errorColor, + color: Theme.of(context).colorScheme.error, fontWeight: FontWeight.bold, ) : TextStyles.textBold14, ), @@ -70,12 +70,12 @@ class _AccountRecordListPageState extends State { Positioned( bottom: 0.0, left: 0.0, - child: Text(i.isEven ? '18:20:10' : '08:20:11', style: Theme.of(context).textTheme.subtitle2), + child: Text(i.isEven ? '18:20:10' : '08:20:11', style: Theme.of(context).textTheme.titleSmall), ), Positioned( bottom: 0.0, right: 0.0, - child: Text('余额:20.00', style: Theme.of(context).textTheme.subtitle2), + child: Text('余额:20.00', style: Theme.of(context).textTheme.titleSmall), ), ], ), diff --git a/lib/account/page/add_withdrawal_account_page.dart b/lib/account/page/add_withdrawal_account_page.dart index a62ebb7bc..607fd2673 100644 --- a/lib/account/page/add_withdrawal_account_page.dart +++ b/lib/account/page/add_withdrawal_account_page.dart @@ -31,7 +31,7 @@ class _AddWithdrawalAccountPageState extends State { @override Widget build(BuildContext context) { - final TextStyle? style = Theme.of(context).textTheme.subtitle2?.copyWith(fontSize: Dimens.font_sp14); + final TextStyle? style = Theme.of(context).textTheme.titleSmall?.copyWith(fontSize: Dimens.font_sp14); final List children = [ Gaps.vGap5, SelectedItem( @@ -99,7 +99,7 @@ class _AddWithdrawalAccountPageState extends State { padding: const EdgeInsets.only(top: 8.0, left: 16.0), child: Text( _isWechat ? '绑定本机当前登录的微信号' : '绑定持卡人本人的银行卡', - style: Theme.of(context).textTheme.subtitle2, + style: Theme.of(context).textTheme.titleSmall, ), ), ]; diff --git a/lib/account/page/bank_select_page.dart b/lib/account/page/bank_select_page.dart index c52c1f6f4..7a834e7e0 100644 --- a/lib/account/page/bank_select_page.dart +++ b/lib/account/page/bank_select_page.dart @@ -96,7 +96,7 @@ class _BankSelectPageState extends State { indexHintWidth: 96, indexHintHeight: 96, indexHintTextStyle: const TextStyle(fontSize: 26.0, color: Colors.white), - textStyle: Theme.of(context).textTheme.subtitle2!, + textStyle: Theme.of(context).textTheme.titleSmall!, downTextStyle: context.isDark ? TextStyles.textSize12 : const TextStyle(fontSize: 12.0, color: Colors.black), ), ), @@ -112,7 +112,7 @@ class _BankSelectPageState extends State { children: [ Padding( padding: const EdgeInsets.only(top: 5.0, bottom: 5.0, left: 16.0), - child: Text('常用', style: Theme.of(context).textTheme.subtitle2), + child: Text('常用', style: Theme.of(context).textTheme.titleSmall), ), Expanded( child: ListView.builder( diff --git a/lib/account/page/city_select_page.dart b/lib/account/page/city_select_page.dart index 7f9fe298c..da381e39a 100644 --- a/lib/account/page/city_select_page.dart +++ b/lib/account/page/city_select_page.dart @@ -82,7 +82,7 @@ class _CitySelectPageState extends State { indexHintWidth: 96, indexHintHeight: 96, indexHintTextStyle: const TextStyle(fontSize: 26.0, color: Colors.white), - textStyle: Theme.of(context).textTheme.subtitle2!, + textStyle: Theme.of(context).textTheme.titleSmall!, downTextStyle: context.isDark ? TextStyles.textSize12 : const TextStyle(fontSize: 12.0, color: Colors.black), ), ), diff --git a/lib/account/page/withdrawal_account_page.dart b/lib/account/page/withdrawal_account_page.dart index f1beee2de..e49ff9a37 100644 --- a/lib/account/page/withdrawal_account_page.dart +++ b/lib/account/page/withdrawal_account_page.dart @@ -122,7 +122,7 @@ class _WithdrawalAccountPageState extends State { Gaps.line, MyButton( minHeight: 54.0, - textColor: Theme.of(context).errorColor, + textColor: Theme.of(context).colorScheme.error, text: '确认解绑', backgroundColor: Colors.transparent, onPressed: () { diff --git a/lib/account/page/withdrawal_page.dart b/lib/account/page/withdrawal_page.dart index d261040b0..667fe92f9 100644 --- a/lib/account/page/withdrawal_page.dart +++ b/lib/account/page/withdrawal_page.dart @@ -92,7 +92,7 @@ class _WithdrawalPageState extends State { children: [ Text(_data.typeName), Gaps.vGap8, - Text(_data.name, style: Theme.of(context).textTheme.subtitle2), + Text(_data.name, style: Theme.of(context).textTheme.titleSmall), ], ), ), @@ -150,7 +150,7 @@ class _WithdrawalPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text('最多可提现70元', style: Theme.of(context).textTheme.subtitle2), + Text('最多可提现70元', style: Theme.of(context).textTheme.titleSmall), GestureDetector( onTap: () { _controller.text = '70'; @@ -219,14 +219,14 @@ class _WithdrawalPageState extends State { child: RichText( text: type == 0 ? TextSpan( text: '手续费按', - style: Theme.of(context).textTheme.bodyText2?.copyWith(fontSize: Dimens.font_sp12), + style: Theme.of(context).textTheme.bodyMedium?.copyWith(fontSize: Dimens.font_sp12), children: const [ TextSpan(text: '0.3%', style: TextStyle(color: Colours.orange)), TextSpan(text: '收取'), ], ) : TextSpan( text: '预计', - style: Theme.of(context).textTheme.bodyText2?.copyWith(fontSize: Dimens.font_sp12), + style: Theme.of(context).textTheme.bodyMedium?.copyWith(fontSize: Dimens.font_sp12), children: const [ TextSpan(text: 'T+1天到账(免手续费,T为工作日)', style: TextStyle(color: Colours.orange)), ], diff --git a/lib/account/page/withdrawal_record_list_page.dart b/lib/account/page/withdrawal_record_list_page.dart index cda9c618b..c9fd22cf9 100644 --- a/lib/account/page/withdrawal_record_list_page.dart +++ b/lib/account/page/withdrawal_record_list_page.dart @@ -56,7 +56,7 @@ class _WithdrawalRecordListPageState extends State { Positioned( bottom: 0.0, left: 0.0, - child: Text(i.isEven ? '12:40:20' : '12:50:20', style: Theme.of(context).textTheme.subtitle2), + child: Text(i.isEven ? '12:40:20' : '12:50:20', style: Theme.of(context).textTheme.titleSmall), ), Positioned( bottom: 0.0, @@ -65,7 +65,7 @@ class _WithdrawalRecordListPageState extends State { i.isEven ? '审核失败' : '待审核', style: i.isEven ? TextStyle( fontSize: Dimens.font_sp12, - color: Theme.of(context).errorColor, + color: Theme.of(context).colorScheme.error, ) : const TextStyle( fontSize: Dimens.font_sp12, color: Colours.orange, diff --git a/lib/account/page/withdrawal_result_page.dart b/lib/account/page/withdrawal_result_page.dart index 7fca24291..313d62da5 100644 --- a/lib/account/page/withdrawal_result_page.dart +++ b/lib/account/page/withdrawal_result_page.dart @@ -38,12 +38,12 @@ class _WithdrawalResultPageState extends State { Gaps.vGap8, Text( '2021-02-21 15:20:10', - style: Theme.of(context).textTheme.subtitle2, + style: Theme.of(context).textTheme.titleSmall, ), Gaps.vGap8, Text( '5秒后返回提现页面', - style: Theme.of(context).textTheme.subtitle2, + style: Theme.of(context).textTheme.titleSmall, ), Gaps.vGap24, MyButton( diff --git a/lib/account/widgets/withdrawal_password_setting.dart b/lib/account/widgets/withdrawal_password_setting.dart index 12cb77625..d51b60039 100644 --- a/lib/account/widgets/withdrawal_password_setting.dart +++ b/lib/account/widgets/withdrawal_password_setting.dart @@ -76,7 +76,7 @@ class _WithdrawalPasswordSettingState extends State { ), ), Gaps.vGap10, - Text('提现密码不可为连续、重复的数字。', style: Theme.of(context).textTheme.subtitle2), + Text('提现密码不可为连续、重复的数字。', style: Theme.of(context).textTheme.titleSmall), ], ), ), diff --git a/lib/demo/navigator/screen/book_details_screen.dart b/lib/demo/navigator/screen/book_details_screen.dart index c38702e37..1c44aa930 100644 --- a/lib/demo/navigator/screen/book_details_screen.dart +++ b/lib/demo/navigator/screen/book_details_screen.dart @@ -24,8 +24,8 @@ class BookDetailsScreen extends StatelessWidget { }, child: const Text('Back'), ), - Text(book.title, style: Theme.of(context).textTheme.headline6), - Text(book.author, style: Theme.of(context).textTheme.subtitle1), + Text(book.title, style: Theme.of(context).textTheme.titleLarge), + Text(book.author, style: Theme.of(context).textTheme.titleMedium), ], ), ), diff --git a/lib/goods/page/goods_edit_page.dart b/lib/goods/page/goods_edit_page.dart index b0b68fdc8..ad3c6ca5d 100644 --- a/lib/goods/page/goods_edit_page.dart +++ b/lib/goods/page/goods_edit_page.dart @@ -102,7 +102,7 @@ class _GoodsEditPageState extends State { Center( child: Text( '点击添加商品图片', - style: Theme.of(context).textTheme.subtitle2?.copyWith(fontSize: Dimens.font_sp14), + style: Theme.of(context).textTheme.titleSmall?.copyWith(fontSize: Dimens.font_sp14), ), ), Gaps.vGap16, diff --git a/lib/goods/page/goods_size_edit_page.dart b/lib/goods/page/goods_size_edit_page.dart index 55af77057..94acb3ce1 100644 --- a/lib/goods/page/goods_size_edit_page.dart +++ b/lib/goods/page/goods_size_edit_page.dart @@ -49,7 +49,7 @@ class _GoodsSizeEditPageState extends State { Center( child: Text( '点击添加分类图片', - style: Theme.of(context).textTheme.subtitle2?.copyWith(fontSize: Dimens.font_sp14), + style: Theme.of(context).textTheme.titleSmall?.copyWith(fontSize: Dimens.font_sp14), ), ), Gaps.vGap16, diff --git a/lib/goods/page/goods_size_page.dart b/lib/goods/page/goods_size_page.dart index 67e1de43c..5c17a8553 100644 --- a/lib/goods/page/goods_size_page.dart +++ b/lib/goods/page/goods_size_page.dart @@ -105,7 +105,7 @@ class _GoodsSizePageState extends State { key: const Key('name_edit'), text: TextSpan( text: '先对名称进行', - style: Theme.of(context).textTheme.subtitle2?.copyWith(fontSize: Dimens.font_sp14), + style: Theme.of(context).textTheme.titleSmall?.copyWith(fontSize: Dimens.font_sp14), children: [ TextSpan( text: '编辑', @@ -179,7 +179,7 @@ class _GoodsSizePageState extends State { children: [ Offstage( offstage: _goodsSizeList[index].reducePrice.isEmpty, - child: _buildGoodsTag(Theme.of(context).errorColor, '立减${_goodsSizeList[index].reducePrice}元'), + child: _buildGoodsTag(Theme.of(context).colorScheme.error, '立减${_goodsSizeList[index].reducePrice}元'), ), Opacity( opacity: _goodsSizeList[index].currencyPrice.isEmpty ? 0.0 : 1.0, @@ -237,7 +237,7 @@ class _GoodsSizePageState extends State { extentRatio: 0.20, children: [ CustomSlidableAction( - backgroundColor: Theme.of(context).errorColor, + backgroundColor: Theme.of(context).colorScheme.error, child: Semantics( label: '删除', child: LoadAssetImage( diff --git a/lib/goods/widgets/goods_add_menu.dart b/lib/goods/widgets/goods_add_menu.dart index dc6a4718d..56e90e302 100644 --- a/lib/goods/widgets/goods_add_menu.dart +++ b/lib/goods/widgets/goods_add_menu.dart @@ -62,8 +62,8 @@ class _GoodsAddMenuState extends State with SingleTickerProviderSt icon: LoadAssetImage('goods/scanning', width: 16.0, height: 16.0, color: iconColor,), label: const Text('扫码添加'), style: TextButton.styleFrom( - foregroundColor: Theme.of(context).textTheme.bodyText2?.color, - disabledForegroundColor: Theme.of(context).textTheme.bodyText2?.color?.withOpacity(0.12), + foregroundColor: Theme.of(context).textTheme.bodyMedium?.color, + disabledForegroundColor: Theme.of(context).textTheme.bodyMedium?.color?.withOpacity(0.12), backgroundColor: backgroundColor, shape: const RoundedRectangleBorder( borderRadius: BorderRadius.only(topLeft: Radius.circular(8.0), topRight: Radius.circular(8.0)), @@ -82,8 +82,8 @@ class _GoodsAddMenuState extends State with SingleTickerProviderSt icon: LoadAssetImage('goods/add2', width: 16.0, height: 16.0, color: iconColor,), label: const Text('添加商品'), style: TextButton.styleFrom( - foregroundColor: Theme.of(context).textTheme.bodyText2?.color, - disabledForegroundColor: Theme.of(context).textTheme.bodyText2?.color?.withOpacity(0.12), + foregroundColor: Theme.of(context).textTheme.bodyMedium?.color, + disabledForegroundColor: Theme.of(context).textTheme.bodyMedium?.color?.withOpacity(0.12), backgroundColor: backgroundColor, shape: const RoundedRectangleBorder( borderRadius: BorderRadius.only(bottomLeft: Radius.circular(8.0), bottomRight: Radius.circular(8.0)), diff --git a/lib/goods/widgets/goods_delete_bottom_sheet.dart b/lib/goods/widgets/goods_delete_bottom_sheet.dart index 76ad0068f..7118667fd 100644 --- a/lib/goods/widgets/goods_delete_bottom_sheet.dart +++ b/lib/goods/widgets/goods_delete_bottom_sheet.dart @@ -32,7 +32,7 @@ class GoodsDeleteBottomSheet extends StatelessWidget { Gaps.line, MyButton( minHeight: 54.0, - textColor: Theme.of(context).errorColor, + textColor: Theme.of(context).colorScheme.error, text: '确认删除', backgroundColor: Colors.transparent, onPressed: () { diff --git a/lib/goods/widgets/goods_item.dart b/lib/goods/widgets/goods_item.dart index eebf2ae43..752d2df0a 100644 --- a/lib/goods/widgets/goods_item.dart +++ b/lib/goods/widgets/goods_item.dart @@ -68,7 +68,7 @@ class GoodsItem extends StatelessWidget { visible: item.type % 3 == 0, child: _GoodsItemTag( text: '立减', - color: Theme.of(context).errorColor, + color: Theme.of(context).colorScheme.error, ), ), Opacity( @@ -109,7 +109,7 @@ class GoodsItem extends StatelessWidget { padding: const EdgeInsets.only(top: 10.0), child: Text( '特产美味', - style: Theme.of(context).textTheme.subtitle2, + style: Theme.of(context).textTheme.titleSmall, ), ) ], diff --git a/lib/login/page/login_page.dart b/lib/login/page/login_page.dart index 63f139151..7e4fe15d3 100644 --- a/lib/login/page/login_page.dart +++ b/lib/login/page/login_page.dart @@ -132,7 +132,7 @@ class _LoginPageState extends State with ChangeNotifierMixin NavigatorUtils.push(context, LoginRouter.resetPasswordPage), ), diff --git a/lib/login/page/sms_login_page.dart b/lib/login/page/sms_login_page.dart index 9e0df1c97..50a8b6aa8 100644 --- a/lib/login/page/sms_login_page.dart +++ b/lib/login/page/sms_login_page.dart @@ -105,12 +105,12 @@ class _SMSLoginPageState extends State with ChangeNotifierMixin[ TextSpan( text: DeerLocalizations.of(context)!.register, style: TextStyle( - color: Theme.of(context).errorColor, + color: Theme.of(context).colorScheme.error, ), recognizer: TapGestureRecognizer() ..onTap = () { @@ -133,7 +133,7 @@ class _SMSLoginPageState extends State with ChangeNotifierMixin NavigatorUtils.push(context, LoginRouter.resetPasswordPage), ), diff --git a/lib/login/page/update_password_page.dart b/lib/login/page/update_password_page.dart index 8c6362663..188d6bf0c 100644 --- a/lib/login/page/update_password_page.dart +++ b/lib/login/page/update_password_page.dart @@ -78,7 +78,7 @@ class _UpdatePasswordPageState extends State with ChangeNoti Gaps.vGap8, Text( '设置账号 15000000000', - style: Theme.of(context).textTheme.subtitle2?.copyWith(fontSize: Dimens.font_sp12), + style: Theme.of(context).textTheme.titleSmall?.copyWith(fontSize: Dimens.font_sp12), ), Gaps.vGap32, MyTextField( diff --git a/lib/order/page/order_info_page.dart b/lib/order/page/order_info_page.dart index 70d8d865e..0755f35fd 100644 --- a/lib/order/page/order_info_page.dart +++ b/lib/order/page/order_info_page.dart @@ -26,7 +26,7 @@ class _OrderInfoPageState extends State { @override Widget build(BuildContext context) { - final Color red = Theme.of(context).errorColor; + final Color red = Theme.of(context).colorScheme.error; final bool isDark = context.isDark; final Widget bottomMenu = Container( @@ -176,7 +176,7 @@ class _OrderInfoPageState extends State { padding: const EdgeInsets.symmetric(vertical: 4.0), child: Row( children: [ - Text(title, style: Theme.of(context).textTheme.subtitle2?.copyWith(fontSize: Dimens.font_sp14)), + Text(title, style: Theme.of(context).textTheme.titleSmall?.copyWith(fontSize: Dimens.font_sp14)), Gaps.hGap8, Text(content) ], @@ -204,11 +204,11 @@ class _OrderInfoPageState extends State { overflow: TextOverflow.ellipsis, ), Gaps.vGap4, - Text(index.isEven ? '玫瑰香 520ml' : '125ml', style: Theme.of(context).textTheme.subtitle2), + Text(index.isEven ? '玫瑰香 520ml' : '125ml', style: Theme.of(context).textTheme.titleSmall), Gaps.vGap8, Row( children: [ - _buildGoodsTag(Theme.of(context).errorColor, '立减2.50元'), + _buildGoodsTag(Theme.of(context).colorScheme.error, '立减2.50元'), Gaps.hGap4, Offstage( offstage: index % 2 != 0, @@ -264,7 +264,7 @@ class _OrderInfoPageState extends State { children: [ Text(title), Text(content, style: TextStyle( - color: contentTextColor ?? Theme.of(context).textTheme.bodyText2?.color, + color: contentTextColor ?? Theme.of(context).textTheme.bodyMedium?.color, fontWeight: FontWeight.bold )) ], @@ -293,9 +293,9 @@ class _OrderInfoPageState extends State { }, style: ButtonStyle( // 按下高亮颜色 - overlayColor: MaterialStateProperty.all(Theme.of(context).errorColor.withOpacity(0.2)), + overlayColor: MaterialStateProperty.all(Theme.of(context).colorScheme.error.withOpacity(0.2)), ), - child: Text('拨打', style: TextStyle(color: Theme.of(context).errorColor),), + child: Text('拨打', style: TextStyle(color: Theme.of(context).colorScheme.error),), ), ], ); diff --git a/lib/order/page/order_page.dart b/lib/order/page/order_page.dart index 4e682b897..f840ef1b9 100644 --- a/lib/order/page/order_page.dart +++ b/lib/order/page/order_page.dart @@ -260,7 +260,7 @@ class _TabView extends StatelessWidget { right: 0.0, child: index < 3 ? DecoratedBox( decoration: BoxDecoration( - color: Theme.of(context).errorColor, + color: Theme.of(context).colorScheme.error, borderRadius: BorderRadius.circular(11.0), ), child: const Padding( diff --git a/lib/order/page/order_track_page.dart b/lib/order/page/order_track_page.dart index edfa87232..fdc03dc10 100644 --- a/lib/order/page/order_track_page.dart +++ b/lib/order/page/order_track_page.dart @@ -62,12 +62,12 @@ class _OrderTrackPageState extends State { child: Text(_titleList[index], style: index == 0 ? TextStyle( fontSize: Dimens.font_sp14, color: primaryColor, - ) : Theme.of(context).textTheme.bodyText2), + ) : Theme.of(context).textTheme.bodyMedium), ), subtitle: Text(_timeList[index], style: index == 0 ? TextStyle( fontSize: Dimens.font_sp12, color: primaryColor, - ) : Theme.of(context).textTheme.subtitle2), + ) : Theme.of(context).textTheme.titleSmall), content: const Text(''), isActive: index == 0, // TODO(weilu): 这里的状态图标无法修改,暂时使用原生的。应该可以复制Step代码修改一下。 diff --git a/lib/order/widgets/order_item.dart b/lib/order/widgets/order_item.dart index 37f4e1583..dc03995e3 100644 --- a/lib/order/widgets/order_item.dart +++ b/lib/order/widgets/order_item.dart @@ -42,7 +42,7 @@ class OrderItem extends StatelessWidget { } Widget _buildContent(BuildContext context) { - final TextStyle? textTextStyle = Theme.of(context).textTheme.bodyText2?.copyWith(fontSize: Dimens.font_sp12); + final TextStyle? textTextStyle = Theme.of(context).textTheme.bodyMedium?.copyWith(fontSize: Dimens.font_sp12); final bool isDark = context.isDark; return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -56,7 +56,7 @@ class OrderItem extends StatelessWidget { '货到付款', style: TextStyle( fontSize: Dimens.font_sp12, - color: Theme.of(context).errorColor, + color: Theme.of(context).colorScheme.error, ), ), ], @@ -64,7 +64,7 @@ class OrderItem extends StatelessWidget { Gaps.vGap8, Text( '西安市雁塔区 鱼化寨街道唐兴路唐兴数码3楼318', - style: Theme.of(context).textTheme.subtitle2, + style: Theme.of(context).textTheme.titleSmall, ), Gaps.vGap8, Gaps.line, @@ -74,7 +74,7 @@ class OrderItem extends StatelessWidget { style: textTextStyle, children: [ const TextSpan(text: '清凉一度抽纸'), - TextSpan(text: ' x1', style: Theme.of(context).textTheme.subtitle2), + TextSpan(text: ' x1', style: Theme.of(context).textTheme.titleSmall), ], ), ), @@ -84,7 +84,7 @@ class OrderItem extends StatelessWidget { style: textTextStyle, children: [ const TextSpan(text: '清凉一度抽纸'), - TextSpan(text: ' x2', style: Theme.of(context).textTheme.subtitle2), + TextSpan(text: ' x2', style: Theme.of(context).textTheme.titleSmall), ], ), ), @@ -97,7 +97,7 @@ class OrderItem extends StatelessWidget { style: textTextStyle, children: [ TextSpan(text: Utils.formatPrice('20.00', format: MoneyFormat.NORMAL)), - TextSpan(text: ' 共3件商品', style: Theme.of(context).textTheme.subtitle2?.copyWith(fontSize: Dimens.font_sp10)), + TextSpan(text: ' 共3件商品', style: Theme.of(context).textTheme.titleSmall?.copyWith(fontSize: Dimens.font_sp10)), ], ), ), @@ -172,9 +172,9 @@ class OrderItem extends StatelessWidget { }, style: ButtonStyle( // 按下高亮颜色 - overlayColor: MaterialStateProperty.all(Theme.of(context).errorColor.withOpacity(0.2)), + overlayColor: MaterialStateProperty.all(Theme.of(context).colorScheme.error.withOpacity(0.2)), ), - child: Text('拨打', style: TextStyle(color: Theme.of(context).errorColor),), + child: Text('拨打', style: TextStyle(color: Theme.of(context).colorScheme.error),), ), ], ); diff --git a/lib/setting/provider/theme_provider.dart b/lib/setting/provider/theme_provider.dart index 9fd864458..e53c1ba3e 100644 --- a/lib/setting/provider/theme_provider.dart +++ b/lib/setting/provider/theme_provider.dart @@ -11,7 +11,7 @@ extension ThemeModeExtension on ThemeMode { } class ThemeProvider extends ChangeNotifier { - + void syncTheme() { final String theme = SpUtil.getString(Constant.theme) ?? ''; if (theme.isNotEmpty && theme != ThemeMode.system.value) { @@ -38,11 +38,11 @@ class ThemeProvider extends ChangeNotifier { ThemeData getTheme({bool isDarkMode = false}) { return ThemeData( - errorColor: isDarkMode ? Colours.dark_red : Colours.red, primaryColor: isDarkMode ? Colours.dark_app_main : Colours.app_main, colorScheme: ColorScheme.fromSwatch().copyWith( brightness: isDarkMode ? Brightness.dark : Brightness.light, secondary: isDarkMode ? Colours.dark_app_main : Colours.app_main, + error: isDarkMode ? Colours.dark_red : Colours.red, ), // Tab指示器颜色 indicatorColor: isDarkMode ? Colours.dark_app_main : Colours.app_main, @@ -61,10 +61,10 @@ class ThemeProvider extends ChangeNotifier { ), textTheme: TextTheme( // TextField输入文字颜色 - subtitle1: isDarkMode ? TextStyles.textDark : TextStyles.text, + titleMedium: isDarkMode ? TextStyles.textDark : TextStyles.text, // Text文字样式 - bodyText2: isDarkMode ? TextStyles.textDark : TextStyles.text, - subtitle2: isDarkMode ? TextStyles.textDarkGray12 : TextStyles.textGray12, + bodyMedium: isDarkMode ? TextStyles.textDark : TextStyles.text, + titleSmall: isDarkMode ? TextStyles.textDarkGray12 : TextStyles.textGray12, ), inputDecorationTheme: InputDecorationTheme( hintStyle: isDarkMode ? TextStyles.textHint14 : TextStyles.textDarkGray14, diff --git a/lib/shop/page/freight_config_page.dart b/lib/shop/page/freight_config_page.dart index 511bc556e..8830ea571 100644 --- a/lib/shop/page/freight_config_page.dart +++ b/lib/shop/page/freight_config_page.dart @@ -137,7 +137,7 @@ class _FreightConfigPageState extends State { _getPriceText(index).isEmpty ? '订单金额' : _getPriceText(index), key: Key('订单金额$index'), textAlign: TextAlign.end, - style: _getPriceText(index).isEmpty ? Theme.of(context).textTheme.subtitle2?.copyWith(fontSize: Dimens.font_sp14) : null, + style: _getPriceText(index).isEmpty ? Theme.of(context).textTheme.titleSmall?.copyWith(fontSize: Dimens.font_sp14) : null, ), ), )), @@ -195,7 +195,7 @@ class _FreightConfigPageState extends State { child: Text( _list[index].price.isEmpty ? (_list[index].type == 1 ? '运费比率' : '运费金额'): _list[index].price, textAlign: TextAlign.end, - style: _list[index].price.isEmpty ? Theme.of(context).textTheme.subtitle2?.copyWith(fontSize: Dimens.font_sp14) : null, + style: _list[index].price.isEmpty ? Theme.of(context).textTheme.titleSmall?.copyWith(fontSize: Dimens.font_sp14) : null, ), ), )), diff --git a/lib/shop/page/message_page.dart b/lib/shop/page/message_page.dart index 4f3cb5909..993850d32 100644 --- a/lib/shop/page/message_page.dart +++ b/lib/shop/page/message_page.dart @@ -56,7 +56,7 @@ class _MessageItemState extends State<_MessageItem> { return Column( children: [ Gaps.vGap15, - Text('2021-5-31 17:19:36', style: Theme.of(context).textTheme.subtitle2), + Text('2021-5-31 17:19:36', style: Theme.of(context).textTheme.titleSmall), Gaps.vGap8, MyCard( child: Padding( diff --git a/lib/statistics/page/goods_statistics_page.dart b/lib/statistics/page/goods_statistics_page.dart index 1b51f79c2..2fca564fe 100644 --- a/lib/statistics/page/goods_statistics_page.dart +++ b/lib/statistics/page/goods_statistics_page.dart @@ -175,7 +175,7 @@ class _GoodsStatisticsPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ const Text('那鲁火多饮料', maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle(fontWeight: FontWeight.bold, fontSize: Dimens.font_sp12)), - Text('250ml', style: Theme.of(context).textTheme.subtitle2), + Text('250ml', style: Theme.of(context).textTheme.titleSmall), ], ), ), @@ -186,8 +186,8 @@ class _GoodsStatisticsPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text('100件', style: Theme.of(context).textTheme.subtitle2), - Text('未支付', style: Theme.of(context).textTheme.subtitle2), + Text('100件', style: Theme.of(context).textTheme.titleSmall), + Text('未支付', style: Theme.of(context).textTheme.titleSmall), ], ), ), @@ -196,8 +196,8 @@ class _GoodsStatisticsPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: _type ? MainAxisAlignment.center : MainAxisAlignment.spaceBetween, children: [ - Text('400件', style: Theme.of(context).textTheme.subtitle2), - Visibility(visible: !_type, child: Text('已支付', style: Theme.of(context).textTheme.subtitle2)), + Text('400件', style: Theme.of(context).textTheme.titleSmall), + Visibility(visible: !_type, child: Text('已支付', style: Theme.of(context).textTheme.titleSmall)), ], ), ], diff --git a/lib/statistics/page/order_statistics_page.dart b/lib/statistics/page/order_statistics_page.dart index bea1a6004..421dc62bc 100644 --- a/lib/statistics/page/order_statistics_page.dart +++ b/lib/statistics/page/order_statistics_page.dart @@ -139,7 +139,7 @@ class _OrderStatisticsPageState extends State with TickerPr Gaps.vGap16, _buildChart(const Color(0xFFFFAA33), const Color(0x80FFAA33), '完成订单', '2000'), Gaps.vGap16, - _buildChart(Theme.of(context).errorColor, const Color(0x80FF4759), '取消订单', '1000'), + _buildChart(Theme.of(context).colorScheme.error, const Color(0x80FF4759), '取消订单', '1000'), Gaps.vGap16, ], ) @@ -274,7 +274,7 @@ class _OrderStatisticsPageState extends State with TickerPr final List widgets = []; void addWidget(String str) { widgets.add(Center( - child: Text(str, style: Theme.of(context).textTheme.subtitle2), + child: Text(str, style: Theme.of(context).textTheme.titleSmall), )); } _weeks.forEach(addWidget); diff --git a/lib/statistics/page/statistics_page.dart b/lib/statistics/page/statistics_page.dart index ca28ab859..4f608e089 100644 --- a/lib/statistics/page/statistics_page.dart +++ b/lib/statistics/page/statistics_page.dart @@ -172,7 +172,7 @@ class _StatisticsTab extends StatelessWidget { children: [ LoadAssetImage('statistic/$img', width: 40.0, height: 40.0), Gaps.vGap4, - Text(title, style: Theme.of(context).textTheme.subtitle2), + Text(title, style: Theme.of(context).textTheme.titleSmall), Gaps.vGap8, Text(content, style: const TextStyle(fontSize: Dimens.font_sp18)), ], diff --git a/lib/store/page/store_audit_page.dart b/lib/store/page/store_audit_page.dart index 8733ff6bd..121c65490 100644 --- a/lib/store/page/store_audit_page.dart +++ b/lib/store/page/store_audit_page.dart @@ -111,7 +111,7 @@ class _StoreAuditPageState extends State { Center( child: Text( '店主手持身份证或营业执照', - style: Theme.of(context).textTheme.subtitle2?.copyWith(fontSize: Dimens.font_sp14), + style: Theme.of(context).textTheme.titleSmall?.copyWith(fontSize: Dimens.font_sp14), ), ), Gaps.vGap16, diff --git a/lib/store/page/store_audit_result_page.dart b/lib/store/page/store_audit_result_page.dart index 5258d4f3a..05672e8f0 100644 --- a/lib/store/page/store_audit_result_page.dart +++ b/lib/store/page/store_audit_result_page.dart @@ -39,12 +39,12 @@ class _StoreAuditResultPageState extends State { Gaps.vGap8, Text( '2021-02-21 15:20:10', - style: Theme.of(context).textTheme.subtitle2, + style: Theme.of(context).textTheme.titleSmall, ), Gaps.vGap8, Text( '预计完成时间:02月28日', - style: Theme.of(context).textTheme.subtitle2, + style: Theme.of(context).textTheme.titleSmall, ), Gaps.vGap24, MyButton( diff --git a/lib/widgets/click_item.dart b/lib/widgets/click_item.dart index adcb8c53e..eece1f2ca 100644 --- a/lib/widgets/click_item.dart +++ b/lib/widgets/click_item.dart @@ -34,7 +34,7 @@ class ClickItem extends StatelessWidget { maxLines: maxLines, textAlign: maxLines == 1 ? TextAlign.right : textAlign, overflow: TextOverflow.ellipsis, - style: Theme.of(context).textTheme.subtitle2?.copyWith(fontSize: Dimens.font_sp14), + style: Theme.of(context).textTheme.titleSmall?.copyWith(fontSize: Dimens.font_sp14), ), ), Gaps.hGap8, diff --git a/lib/widgets/state_layout.dart b/lib/widgets/state_layout.dart index 6fd4464f4..9e76afa9e 100644 --- a/lib/widgets/state_layout.dart +++ b/lib/widgets/state_layout.dart @@ -35,7 +35,7 @@ class StateLayout extends StatelessWidget { const SizedBox(width: double.infinity, height: Dimens.gap_dp16,), Text( hintText ?? type.hintText, - style: Theme.of(context).textTheme.subtitle2?.copyWith(fontSize: Dimens.font_sp14), + style: Theme.of(context).textTheme.titleSmall?.copyWith(fontSize: Dimens.font_sp14), ), Gaps.vGap50, ],