Browse Source

在flutter3.0可以运行项目。 discount_zone.dart discountItem高度超了

dart3_last
Loki 2 years ago
parent
commit
c776a4f336
  1. BIN
      assets/image/2x/rechargeBtn.png
  2. BIN
      assets/image/3x/rechargeBtn.png
  3. BIN
      assets/image/rechargeBtn.png
  4. 4
      lib/home/home_view/discount_zone.dart
  5. 135
      lib/mine/mine_wallet_page.dart
  6. 3
      lib/retrofit/data/user_info.dart

BIN
assets/image/2x/rechargeBtn.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/image/3x/rechargeBtn.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
assets/image/rechargeBtn.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 726 B

4
lib/home/home_view/discount_zone.dart

@ -51,7 +51,7 @@ class _DiscountZone extends State<DiscountZone> {
)),
if(widget.coupon.length != 0)
Container(
height: 100.h,
height: 120.h,
margin: EdgeInsets.only(top: 10.h),
child: ListView.builder(
scrollDirection: Axis.horizontal,
@ -76,7 +76,7 @@ class _DiscountZone extends State<DiscountZone> {
Widget discountItem(Coupon coupon) {
return Container(
width: 290.w,
height: 100.h,
height: 120.h,
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,

135
lib/mine/mine_wallet_page.dart

@ -27,6 +27,7 @@ class MineWalletPage extends StatefulWidget {
class _MineWalletPage extends State<MineWalletPage> {
dynamic mBalance = 0;
dynamic mgreenMoney = 0;
@override
void initState() {
@ -45,7 +46,7 @@ class _MineWalletPage extends State<MineWalletPage> {
userInfo =
UserInfo.fromJson(jsonDecode(sharedPreferences.getString('user')));
mBalance = double.tryParse(userInfo.money);
mgreenMoney = double.tryParse(userInfo.greenMoney);
if (mounted) setState(() {});
String token = sharedPreferences.getString("token");
apiService = ApiService(Dio(), context: context, token: token);
@ -263,7 +264,139 @@ class _MineWalletPage extends State<MineWalletPage> {
);
}
//assets/image/recharge,Btn.png
Widget balance() {
return Container(
margin: EdgeInsets.fromLTRB(14.w, 16.h, 14.w, 8.h),
decoration: BoxDecoration(
color: Colors.green,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(25),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: IntrinsicHeight(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
//24.w, 24.h, 24.w, 24.h
Padding(
padding: EdgeInsets.only(
left: 24,
top: 24,
),
child: Text(
"总资产(元)",
style: TextStyle(color: Colors.white, fontSize: 16),
),
),
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 24,
),
Text(
"$mBalance",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 50,
color: Colors.white,
),
),
Spacer(
flex: 1,
),
InkWell(
onTap: (){
toRecharge();
},
child: SizedBox(
width: 87.w,
height: 46.h,
child: Stack(
children: [
Positioned.fill(
child: Image.asset(
"assets/image/rechargeBtn.png",
fit: BoxFit.fill,
),
),
Positioned(
left: 14.w,
top: 0,
bottom: 0,
child: Container(
alignment: Alignment.centerLeft,
child: Text(
"充值",
style: TextStyle(
fontSize: 18,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
)),
],
),
),
),
],
),
flex: 1,
),
if(userInfo != null && userInfo.greenMoney != null && userInfo.greenMoney.isNotEmpty && double.tryParse(userInfo.greenMoney) > 0)
SizedBox(
height: 22,
),
if(userInfo != null && userInfo.greenMoney != null && userInfo.greenMoney.isNotEmpty && double.tryParse(userInfo.greenMoney) > 0)
Padding(
padding: EdgeInsets.only(
left: 24,
),
child: Text(
"绿币余额",
style: TextStyle(
fontSize: 16,
fontWeight: MyFontWeight.semi_bold,
color: Colors.white,
),
),
),
if(userInfo != null && userInfo.greenMoney != null && userInfo.greenMoney.isNotEmpty && double.tryParse(userInfo.greenMoney) > 0)
SizedBox(
height: 8,
),
if(userInfo != null && userInfo.greenMoney != null && userInfo.greenMoney.isNotEmpty && double.tryParse(userInfo.greenMoney) > 0)
Padding(
padding: EdgeInsets.only(
left: 24,
),
child: Text(
"$mgreenMoney",
style: TextStyle(
fontSize: 24,
fontWeight: MyFontWeight.semi_bold,
color: Colors.white,
),
),
),
SizedBox(
height: 24,
),
],
),
),
);
}
Widget balance1() {
return Container(
width: double.infinity,
margin: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 8.h),

3
lib/retrofit/data/user_info.dart

@ -34,6 +34,7 @@ class UserInfo {
String money;
String expendAmount;
String points;
String greenMoney;
bool isBind;
String masterId;
int inviteNumber;
@ -64,6 +65,7 @@ class UserInfo {
..money = json['money'] as String
..expendAmount = json['expendAmount'] as String
..points = json['points'] as String
..greenMoney = json['greenMoney'] as String
..isBind = json['isBind'] as bool
..masterId = json['masterId'] as String
..inviteNumber = json['inviteNumber'] as int
@ -93,6 +95,7 @@ class UserInfo {
'money': this.money,
'expendAmount': this.expendAmount,
'points': this.points,
'greenMoney': this.greenMoney,
'isBind': this.isBind,
'masterId': this.masterId,
"inviteNumber": this.inviteNumber,

Loading…
Cancel
Save