import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class WalletCoupon extends StatefulWidget { @override State createState() { return _WalletCoupon(); } } class _WalletCoupon extends State { @override Widget build(BuildContext context) { return Container( margin: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 6.h), padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(8), boxShadow: [ BoxShadow( color: Colors.black.withAlpha(12), offset: Offset(0, 3), blurRadius: 14, spreadRadius: 0, ), ], ), child: (Theme.of(context).platform == TargetPlatform.android) ? GestureDetector( onTap: () { SharedPreferences.getInstance().then((value) { if (value.getString("token") == null || value.getString("token") == "") { LoginTipsDialog().show(context); return; } Navigator.of(context).pushNamed('/router/roll_center_page'); }); }, child: Row( children: [ Image.asset( "assets/image/icon_mine_invoice_assistant.webp", width: 48.h, height: 48.h, ), SizedBox( width: 12.w, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( S.of(context).lingquanzhongxin, overflow: TextOverflow.ellipsis, style: TextStyle( fontWeight: MyFontWeight.medium, fontSize: 16.sp, color: Color(0xFF353535), ), ), SizedBox( height: 3, ), Text( "联盟下单享不停、海量优惠券等你来领!", overflow: TextOverflow.ellipsis, style: TextStyle( fontWeight: MyFontWeight.medium, fontSize: 12.sp, color: Color(0xFF7B7B7B), ), ), ], ), ) ], )) : Row( children: [ Expanded( flex: 1, child: GestureDetector( onTap: () { SharedPreferences.getInstance().then((value) { if (value.getString("token") == null || value.getString("token") == "") { LoginTipsDialog().show(context); return; } Navigator.of(context) .pushNamed('/router/roll_center_page'); }); }, child: Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( "assets/image/icon_mine_invoice_assistant.webp", width: 48.h, height: 48.h, ), SizedBox( width: 12.w, ), Expanded( child: Text( S.of(context).lingquanzhongxin, overflow: TextOverflow.ellipsis, style: TextStyle( fontWeight: MyFontWeight.medium, fontSize: 16.sp, color: Color(0xFF353535), ), ), flex: 1, ), ], ), ), ), Container( width: 2.w, height: 32.h, margin: EdgeInsets.only(left: 20.w, right: 20.w), color: Color(0xFFF7F7F7), ), Expanded( flex: 1, child: GestureDetector( onTap: () { SharedPreferences.getInstance().then((value) { if (value.getString("token") == null || value.getString("token") == "") { LoginTipsDialog().show(context); return; } Navigator.of(context).pushNamed('/router/mine_wallet'); }); }, child: Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( "assets/image/icon_mine_wallet.webp", width: 48.h, height: 48.h, ), SizedBox( width: 12.w, ), Expanded( child: Text( S.of(context).wodeqianbao, overflow: TextOverflow.ellipsis, style: TextStyle( fontWeight: MyFontWeight.medium, fontSize: 16.sp, color: Color(0xFF353535), ), ), flex: 1, ), ], ), ), ), ], ), ); } }