From 1257b68c04414d812b3e6fac5df8c5b7ac72d2d4 Mon Sep 17 00:00:00 2001 From: zhang <494089941@qq.com> Date: Tue, 2 Feb 2021 17:47:57 +0800 Subject: [PATCH] add select my house page --- .gitignore | 4 +- lib/pages/life_pay/life_pay_page.dart | 5 +- lib/pages/life_pay/widget/my_house_page.dart | 84 ++++++++++++++++++++ 3 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 lib/pages/life_pay/widget/my_house_page.dart diff --git a/.gitignore b/.gitignore index 62531705..69906469 100644 --- a/.gitignore +++ b/.gitignore @@ -58,4 +58,6 @@ coverage/ !**/ios/**/default.mode2v3 !**/ios/**/default.pbxuser !**/ios/**/default.perspectivev3 -!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages \ No newline at end of file +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages +commit.csv +.~lock.commit.csv# diff --git a/lib/pages/life_pay/life_pay_page.dart b/lib/pages/life_pay/life_pay_page.dart index d16598ab..913564a4 100644 --- a/lib/pages/life_pay/life_pay_page.dart +++ b/lib/pages/life_pay/life_pay_page.dart @@ -3,6 +3,7 @@ import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/const/resource.dart'; import 'package:akuCommunity/constants/api.dart'; import 'package:akuCommunity/model/manager/life_pay_model.dart'; +import 'package:akuCommunity/pages/life_pay/widget/my_house_page.dart'; import 'package:akuCommunity/pages/personal/widget/order_card.dart'; import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart'; import 'package:akuCommunity/provider/user_provider.dart'; @@ -58,7 +59,9 @@ class _LifePayPageState extends State { '当前房屋'.text.black.size(28.sp).make(), 32.w.heightBox, GestureDetector( - onTap: () {}, + onTap: () { + MyHousePage().to(); + }, child: Row( children: [ Image.asset( diff --git a/lib/pages/life_pay/widget/my_house_page.dart b/lib/pages/life_pay/widget/my_house_page.dart new file mode 100644 index 00000000..c9f73687 --- /dev/null +++ b/lib/pages/life_pay/widget/my_house_page.dart @@ -0,0 +1,84 @@ +import 'package:akuCommunity/base/base_style.dart'; +import 'package:akuCommunity/pages/goods_deto_page/deto_create_page/widget/common_radio.dart'; +import 'package:akuCommunity/widget/bee_divider.dart'; +import 'package:akuCommunity/widget/bee_scaffold.dart'; +import 'package:akuCommunity/widget/buttons/radio_button.dart'; +import 'package:flutter/material.dart'; +import 'package:akuCommunity/utils/headers.dart'; + +class MyHousePage extends StatefulWidget { + final List estateNames; + MyHousePage({Key key, this.estateNames}) : super(key: key); + + @override + _MyHousePageState createState() => _MyHousePageState(); +} + +Widget _currentHouseTag() { + return Container( + padding: EdgeInsets.symmetric(vertical: 12.w, horizontal: 20.w), + constraints: BoxConstraints(minWidth: 120.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(36.w), + color: Color(0xFFFFF4D3), + border: Border.all(width: 2.w, color: Color(0xFFFFC40C))), + child: '当前房屋'.text.color(ktextPrimary).size(20.sp).make(), + ); +} + +Widget _unPaidTag() { + return Container( + padding: EdgeInsets.symmetric(vertical: 12.w, horizontal: 20.w), + constraints: BoxConstraints(minWidth: 120.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(36.w), + color: Color(0xFFFFEBE8), + border: Border.all(width: 2.w, color: Color(0xFFFC361D))), + child: '当前房屋'.text.color(Color(0xFFFC361D)).size(20.sp).make(), + ); +} + +class _MyHousePageState extends State { + int _select; + Widget _buildCard(bool currentHouse, {bool paid = false}) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w), + child: Row( + children: [ + CommonRadio( + value: 1, + groupValue: _select, + size: 32.w, + ), + 24.w.widthBox, + Column( + mainAxisSize: MainAxisSize.min, + children: [ + kEstateName.text.size(24.sp).color(ktextSubColor).bold.make(), + 16.w.heightBox, + ''.text.color(ktextPrimary).size(28.sp).bold.make(), + ], + ), + Spacer(), + currentHouse + ? _currentHouseTag() + : paid + ? _unPaidTag() + : SizedBox() + ], + ), + ); + } + + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: '我的房屋', + body: ListView( + children: [ + _buildCard(true), + ].sepWidget(separate: BeeDivider.horizontal()), + ), + ); + } +}