Skip to content

Commit

Permalink
ThemeData部分废弃属性迁移
Browse files Browse the repository at this point in the history
  • Loading branch information
simplezhli committed Jan 6, 2023
1 parent bee192e commit f9f00c6
Show file tree
Hide file tree
Showing 33 changed files with 76 additions and 76 deletions.
6 changes: 3 additions & 3 deletions lib/account/page/account_record_list_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@ class _AccountRecordListPageState extends State<AccountRecordListPage> {
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,
),
),
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),
),
],
),
Expand Down
4 changes: 2 additions & 2 deletions lib/account/page/add_withdrawal_account_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class _AddWithdrawalAccountPageState extends State<AddWithdrawalAccountPage> {

@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<Widget> children = <Widget>[
Gaps.vGap5,
SelectedItem(
Expand Down Expand Up @@ -99,7 +99,7 @@ class _AddWithdrawalAccountPageState extends State<AddWithdrawalAccountPage> {
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,
),
),
];
Expand Down
4 changes: 2 additions & 2 deletions lib/account/page/bank_select_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class _BankSelectPageState extends State<BankSelectPage> {
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),
),
),
Expand All @@ -112,7 +112,7 @@ class _BankSelectPageState extends State<BankSelectPage> {
children: <Widget>[
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(
Expand Down
2 changes: 1 addition & 1 deletion lib/account/page/city_select_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class _CitySelectPageState extends State<CitySelectPage> {
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),
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/account/page/withdrawal_account_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class _WithdrawalAccountPageState extends State<WithdrawalAccountPage> {
Gaps.line,
MyButton(
minHeight: 54.0,
textColor: Theme.of(context).errorColor,
textColor: Theme.of(context).colorScheme.error,
text: '确认解绑',
backgroundColor: Colors.transparent,
onPressed: () {
Expand Down
8 changes: 4 additions & 4 deletions lib/account/page/withdrawal_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class _WithdrawalPageState extends State<WithdrawalPage> {
children: <Widget>[
Text(_data.typeName),
Gaps.vGap8,
Text(_data.name, style: Theme.of(context).textTheme.subtitle2),
Text(_data.name, style: Theme.of(context).textTheme.titleSmall),
],
),
),
Expand Down Expand Up @@ -150,7 +150,7 @@ class _WithdrawalPageState extends State<WithdrawalPage> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text('最多可提现70元', style: Theme.of(context).textTheme.subtitle2),
Text('最多可提现70元', style: Theme.of(context).textTheme.titleSmall),
GestureDetector(
onTap: () {
_controller.text = '70';
Expand Down Expand Up @@ -219,14 +219,14 @@ class _WithdrawalPageState extends State<WithdrawalPage> {
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>[
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>[
TextSpan(text: 'T+1天到账(免手续费,T为工作日)', style: TextStyle(color: Colours.orange)),
],
Expand Down
4 changes: 2 additions & 2 deletions lib/account/page/withdrawal_record_list_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class _WithdrawalRecordListPageState extends State<WithdrawalRecordListPage> {
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,
Expand All @@ -65,7 +65,7 @@ class _WithdrawalRecordListPageState extends State<WithdrawalRecordListPage> {
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,
Expand Down
4 changes: 2 additions & 2 deletions lib/account/page/withdrawal_result_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ class _WithdrawalResultPageState extends State<WithdrawalResultPage> {
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(
Expand Down
2 changes: 1 addition & 1 deletion lib/account/widgets/withdrawal_password_setting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class _WithdrawalPasswordSettingState extends State<WithdrawalPasswordSetting> {
),
),
Gaps.vGap10,
Text('提现密码不可为连续、重复的数字。', style: Theme.of(context).textTheme.subtitle2),
Text('提现密码不可为连续、重复的数字。', style: Theme.of(context).textTheme.titleSmall),
],
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/demo/navigator/screen/book_details_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
],
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/goods/page/goods_edit_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class _GoodsEditPageState extends State<GoodsEditPage> {
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,
Expand Down
2 changes: 1 addition & 1 deletion lib/goods/page/goods_size_edit_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class _GoodsSizeEditPageState extends State<GoodsSizeEditPage> {
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,
Expand Down
6 changes: 3 additions & 3 deletions lib/goods/page/goods_size_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class _GoodsSizePageState extends State<GoodsSizePage> {
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>[
TextSpan(
text: '编辑',
Expand Down Expand Up @@ -179,7 +179,7 @@ class _GoodsSizePageState extends State<GoodsSizePage> {
children: <Widget>[
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,
Expand Down Expand Up @@ -237,7 +237,7 @@ class _GoodsSizePageState extends State<GoodsSizePage> {
extentRatio: 0.20,
children: [
CustomSlidableAction(
backgroundColor: Theme.of(context).errorColor,
backgroundColor: Theme.of(context).colorScheme.error,
child: Semantics(
label: '删除',
child: LoadAssetImage(
Expand Down
8 changes: 4 additions & 4 deletions lib/goods/widgets/goods_add_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class _GoodsAddMenuState extends State<GoodsAddMenu> 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)),
Expand All @@ -82,8 +82,8 @@ class _GoodsAddMenuState extends State<GoodsAddMenu> 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)),
Expand Down
2 changes: 1 addition & 1 deletion lib/goods/widgets/goods_delete_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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: () {
Expand Down
4 changes: 2 additions & 2 deletions lib/goods/widgets/goods_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
),
)
],
Expand Down
2 changes: 1 addition & 1 deletion lib/login/page/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class _LoginPageState extends State<LoginPage> with ChangeNotifierMixin<LoginPag
child: Text(
DeerLocalizations.of(context)!.forgotPasswordLink,
key: const Key('forgotPassword'),
style: Theme.of(context).textTheme.subtitle2,
style: Theme.of(context).textTheme.titleSmall,
),
onTap: () => NavigatorUtils.push(context, LoginRouter.resetPasswordPage),
),
Expand Down
6 changes: 3 additions & 3 deletions lib/login/page/sms_login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ class _SMSLoginPageState extends State<SMSLoginPage> with ChangeNotifierMixin<SM
child: RichText(
text: TextSpan(
text: DeerLocalizations.of(context)!.registeredTips,
style: Theme.of(context).textTheme.subtitle2?.copyWith(fontSize: Dimens.font_sp14),
style: Theme.of(context).textTheme.titleSmall?.copyWith(fontSize: Dimens.font_sp14),
children: <TextSpan>[
TextSpan(
text: DeerLocalizations.of(context)!.register,
style: TextStyle(
color: Theme.of(context).errorColor,
color: Theme.of(context).colorScheme.error,
),
recognizer: TapGestureRecognizer()
..onTap = () {
Expand All @@ -133,7 +133,7 @@ class _SMSLoginPageState extends State<SMSLoginPage> with ChangeNotifierMixin<SM
child: GestureDetector(
child: Text(
DeerLocalizations.of(context)!.forgotPasswordLink,
style: Theme.of(context).textTheme.subtitle2,
style: Theme.of(context).textTheme.titleSmall,
),
onTap: () => NavigatorUtils.push(context, LoginRouter.resetPasswordPage),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/login/page/update_password_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class _UpdatePasswordPageState extends State<UpdatePasswordPage> 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(
Expand Down
14 changes: 7 additions & 7 deletions lib/order/page/order_info_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class _OrderInfoPageState extends State<OrderInfoPage> {

@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(
Expand Down Expand Up @@ -176,7 +176,7 @@ class _OrderInfoPageState extends State<OrderInfoPage> {
padding: const EdgeInsets.symmetric(vertical: 4.0),
child: Row(
children: <Widget>[
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)
],
Expand Down Expand Up @@ -204,11 +204,11 @@ class _OrderInfoPageState extends State<OrderInfoPage> {
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: <Widget>[
_buildGoodsTag(Theme.of(context).errorColor, '立减2.50元'),
_buildGoodsTag(Theme.of(context).colorScheme.error, '立减2.50元'),
Gaps.hGap4,
Offstage(
offstage: index % 2 != 0,
Expand Down Expand Up @@ -264,7 +264,7 @@ class _OrderInfoPageState extends State<OrderInfoPage> {
children: <Widget>[
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
))
],
Expand Down Expand Up @@ -293,9 +293,9 @@ class _OrderInfoPageState extends State<OrderInfoPage> {
},
style: ButtonStyle(
// 按下高亮颜色
overlayColor: MaterialStateProperty.all<Color>(Theme.of(context).errorColor.withOpacity(0.2)),
overlayColor: MaterialStateProperty.all<Color>(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),),
),
],
);
Expand Down
2 changes: 1 addition & 1 deletion lib/order/page/order_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions lib/order/page/order_track_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ class _OrderTrackPageState extends State<OrderTrackPage> {
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代码修改一下。
Expand Down
Loading

0 comments on commit f9f00c6

Please sign in to comment.