|
|
@ -1,12 +1,30 @@
|
|
|
|
|
|
|
|
// Flutter imports:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Dart imports:
|
|
|
|
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
|
|
// Flutter imports:
|
|
|
|
// Flutter imports:
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Package imports:
|
|
|
|
|
|
|
|
import 'package:flustars/flustars.dart';
|
|
|
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
// Project imports:
|
|
|
|
// Project imports:
|
|
|
|
import 'package:akuCommunity/base/assets_image.dart';
|
|
|
|
import 'package:akuCommunity/base/base_style.dart';
|
|
|
|
|
|
|
|
import 'package:akuCommunity/const/resource.dart';
|
|
|
|
|
|
|
|
import 'package:akuCommunity/provider/user_provider.dart';
|
|
|
|
import 'package:akuCommunity/utils/headers.dart';
|
|
|
|
import 'package:akuCommunity/utils/headers.dart';
|
|
|
|
|
|
|
|
import 'package:akuCommunity/widget/bee_divider.dart';
|
|
|
|
import 'package:akuCommunity/widget/bee_scaffold.dart';
|
|
|
|
import 'package:akuCommunity/widget/bee_scaffold.dart';
|
|
|
|
import 'package:akuCommunity/widget/bottom_button.dart';
|
|
|
|
import 'package:akuCommunity/widget/buttons/bee_check_box.dart';
|
|
|
|
|
|
|
|
import 'package:akuCommunity/widget/buttons/bee_check_button.dart';
|
|
|
|
|
|
|
|
import 'package:akuCommunity/widget/buttons/bottom_button.dart';
|
|
|
|
|
|
|
|
import 'package:akuCommunity/widget/buttons/radio_button.dart';
|
|
|
|
|
|
|
|
import 'package:akuCommunity/widget/picker/bee_custom_picker.dart';
|
|
|
|
|
|
|
|
import 'package:akuCommunity/widget/picker/bee_date_picker.dart';
|
|
|
|
import 'package:akuCommunity/widget/picker/grid_image_picker.dart';
|
|
|
|
import 'package:akuCommunity/widget/picker/grid_image_picker.dart';
|
|
|
|
import 'widget/common_picker.dart';
|
|
|
|
import 'widget/common_picker.dart';
|
|
|
|
import 'widget/common_radio.dart';
|
|
|
|
import 'widget/common_radio.dart';
|
|
|
@ -19,18 +37,36 @@ class DetoCreatePage extends StatefulWidget {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _DetoCreatePageState extends State<DetoCreatePage> {
|
|
|
|
class _DetoCreatePageState extends State<DetoCreatePage> {
|
|
|
|
List<Map<String, dynamic>> _listWeight = [
|
|
|
|
List<File> _files = [];
|
|
|
|
{'title': '< 50kg', 'isCheck': true},
|
|
|
|
UserProvider get userProvider => Provider.of<UserProvider>(context);
|
|
|
|
{'title': '50kg-100kg', 'isCheck': false},
|
|
|
|
String get firstEstateName {
|
|
|
|
{'title': '> 100kg', 'isCheck': false}
|
|
|
|
return userProvider.userDetailModel.estateNames.isEmpty
|
|
|
|
|
|
|
|
? ''
|
|
|
|
|
|
|
|
: userProvider.userDetailModel.estateNames[0];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String _itemName;
|
|
|
|
|
|
|
|
DateTime _date;
|
|
|
|
|
|
|
|
int _selectWeight;
|
|
|
|
|
|
|
|
List<String> _listWeight = [
|
|
|
|
|
|
|
|
'< 50kg',
|
|
|
|
|
|
|
|
'50kg-100kg',
|
|
|
|
|
|
|
|
'> 100kg',
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
int _selectApproach;
|
|
|
|
|
|
|
|
List<String> _listMode = [
|
|
|
|
|
|
|
|
'自己搬运',
|
|
|
|
|
|
|
|
'搬家公司',
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, dynamic>> _listMode = [
|
|
|
|
List<String> _itemClass = [
|
|
|
|
{'title': '自己搬运', 'isCheck': true},
|
|
|
|
'全部',
|
|
|
|
{'title': '搬家公司', 'isCheck': false},
|
|
|
|
'家纺',
|
|
|
|
|
|
|
|
'家具',
|
|
|
|
|
|
|
|
'电器',
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
bool isCheck = false;
|
|
|
|
bool needMoveCompany = false;
|
|
|
|
|
|
|
|
|
|
|
|
Widget _houseAddress(String title, subtitle) {
|
|
|
|
Widget _houseAddress(String title, subtitle) {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
@ -60,7 +96,7 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(right: 42.w),
|
|
|
|
margin: EdgeInsets.only(right: 42.w),
|
|
|
|
child: Image.asset(
|
|
|
|
child: Image.asset(
|
|
|
|
AssetsImage.HOUSEATTESTATION,
|
|
|
|
R.ASSETS_IMAGES_HOUSE_ATTESTATION_PNG,
|
|
|
|
height: 59.w,
|
|
|
|
height: 59.w,
|
|
|
|
width: 59.w,
|
|
|
|
width: 59.w,
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -99,17 +135,15 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.only(bottom: 24.w),
|
|
|
|
padding: EdgeInsets.only(bottom: 24.w),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Checkbox(
|
|
|
|
BeeCheckBox(
|
|
|
|
value: this.isCheck,
|
|
|
|
onChange: (value) {
|
|
|
|
activeColor: Color(0xffffc40c),
|
|
|
|
needMoveCompany = value;
|
|
|
|
onChanged: (bool val) {
|
|
|
|
|
|
|
|
this.setState(() {
|
|
|
|
|
|
|
|
this.isCheck = !this.isCheck;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
10.w.widthBox,
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
'是否需要物业提供搬家公司联系方式',
|
|
|
|
'是否需要物业提供搬家公司联系方式',
|
|
|
@ -125,82 +159,233 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget _checkCard(String title, List<Map<String, dynamic>> list) {
|
|
|
|
Widget _getWeight() {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
height: 96.w,
|
|
|
|
// margin: EdgeInsets.fromLTRB(0, 40.w, 0, 40.w),
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 28.w),
|
|
|
|
// child: Row(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
// children: [
|
|
|
|
border:
|
|
|
|
// Container(
|
|
|
|
Border(bottom: BorderSide(color: Color(0xffeeeeee), width: 0.5)),
|
|
|
|
// margin: EdgeInsets.only(right: 30.w),
|
|
|
|
|
|
|
|
// child: Text(
|
|
|
|
|
|
|
|
// '物品重量',
|
|
|
|
|
|
|
|
// style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ...List.generate(
|
|
|
|
|
|
|
|
// _listWeight.length,
|
|
|
|
|
|
|
|
// (index) => GestureDetector(
|
|
|
|
|
|
|
|
// onTap: () {
|
|
|
|
|
|
|
|
// setState(() {
|
|
|
|
|
|
|
|
// _selectWeight = index;
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// child: CommonRadio(
|
|
|
|
|
|
|
|
// size: 30.w,
|
|
|
|
|
|
|
|
// text: _listWeight[index]
|
|
|
|
|
|
|
|
// .text
|
|
|
|
|
|
|
|
// .color(ktextPrimary)
|
|
|
|
|
|
|
|
// .size(28.sp)
|
|
|
|
|
|
|
|
// .make(),
|
|
|
|
|
|
|
|
// value: index,
|
|
|
|
|
|
|
|
// groupValue: _selectWeight,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// )),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
'物品重量'.text.color(ktextPrimary).size(28.sp).make(),
|
|
|
|
|
|
|
|
24.w.heightBox,
|
|
|
|
|
|
|
|
Wrap(
|
|
|
|
|
|
|
|
spacing: 40.w,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
..._listWeight
|
|
|
|
|
|
|
|
.map((e) => BeeCheckButton(
|
|
|
|
|
|
|
|
title: e,
|
|
|
|
|
|
|
|
value: _listWeight.indexOf(e),
|
|
|
|
|
|
|
|
groupValue: _selectWeight,
|
|
|
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
|
|
|
_selectWeight = value;
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
.toList()
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget _getApproach() {
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
'搬运方式'.text.color(ktextPrimary).size(28.sp).make(),
|
|
|
|
margin: EdgeInsets.only(right: 30.w),
|
|
|
|
24.w.heightBox,
|
|
|
|
child: Text(
|
|
|
|
Wrap(
|
|
|
|
title,
|
|
|
|
spacing: 40.w,
|
|
|
|
style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)),
|
|
|
|
children: [
|
|
|
|
),
|
|
|
|
..._listMode
|
|
|
|
|
|
|
|
.map((e) => BeeCheckButton(
|
|
|
|
|
|
|
|
title: e,
|
|
|
|
|
|
|
|
value: _listMode.indexOf(e),
|
|
|
|
|
|
|
|
groupValue: _selectApproach,
|
|
|
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
|
|
|
_selectApproach = value;
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
.toList()
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
CommonRadio(
|
|
|
|
|
|
|
|
commonlist: list,
|
|
|
|
|
|
|
|
fun: (int index) {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
list.forEach((item) {
|
|
|
|
|
|
|
|
item['isCheck'] = false;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
list[index]['isCheck'] = true;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget _itemPicker(String title, String select, VoidCallback onTap) {
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
40.w.heightBox,
|
|
|
|
|
|
|
|
title.text.color(ktextPrimary).size(28.sp).make(),
|
|
|
|
|
|
|
|
16.w.widthBox,
|
|
|
|
|
|
|
|
Padding(
|
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 30.w),
|
|
|
|
|
|
|
|
child: InkWell(
|
|
|
|
|
|
|
|
onTap: onTap,
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
(select.isEmptyOrNull ? '请选择' : select)
|
|
|
|
|
|
|
|
.text
|
|
|
|
|
|
|
|
.color(select.isEmptyOrNull ? ktextSubColor : ktextPrimary)
|
|
|
|
|
|
|
|
.size(36.sp)
|
|
|
|
|
|
|
|
.fontWeight(select.isEmptyOrNull
|
|
|
|
|
|
|
|
? FontWeight.normal
|
|
|
|
|
|
|
|
: FontWeight.bold)
|
|
|
|
|
|
|
|
.make(),
|
|
|
|
|
|
|
|
Spacer(),
|
|
|
|
|
|
|
|
Icon(
|
|
|
|
|
|
|
|
CupertinoIcons.chevron_right,
|
|
|
|
|
|
|
|
size: 30.w,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
BeeDivider.horizontal(),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_showItmePicker() async {
|
|
|
|
|
|
|
|
_itemName = await Get.bottomSheet(
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
child: Material(
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.vertical(
|
|
|
|
|
|
|
|
top: Radius.circular(20.w),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
..._itemClass
|
|
|
|
|
|
|
|
.map((e) => Material(
|
|
|
|
|
|
|
|
child: InkWell(
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
Get.back(result: e);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
|
|
|
height: 112.w,
|
|
|
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
|
|
|
child: e.text
|
|
|
|
|
|
|
|
.color(ktextPrimary)
|
|
|
|
|
|
|
|
.isIntrinsic
|
|
|
|
|
|
|
|
.size(28.sp)
|
|
|
|
|
|
|
|
.make()),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
.toList(),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
height: 16.w,
|
|
|
|
|
|
|
|
color: Color(0xFFF7F7F7),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Material(
|
|
|
|
|
|
|
|
child: InkWell(
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
Get.back();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
|
|
|
height: 112.w,
|
|
|
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
|
|
|
child: '取消'
|
|
|
|
|
|
|
|
.text
|
|
|
|
|
|
|
|
.color(ktextPrimary)
|
|
|
|
|
|
|
|
.isIntrinsic
|
|
|
|
|
|
|
|
.size(28.sp)
|
|
|
|
|
|
|
|
.make()),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return BeeScaffold(
|
|
|
|
return BeeScaffold(
|
|
|
|
title: '物品出户',
|
|
|
|
title: '物品出户',
|
|
|
|
body: Container(
|
|
|
|
body: ListView(
|
|
|
|
color: Colors.white,
|
|
|
|
padding: EdgeInsets.all(32.w),
|
|
|
|
child: Stack(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
_houseAddress(kEstateName, firstEstateName),
|
|
|
|
Container(
|
|
|
|
_getWeight(),
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
_itemPicker(
|
|
|
|
left: 32.w,
|
|
|
|
'出户时间', DateUtil.formatDate(_date, format: "yyyy-MM-dd HH:mm:ss"),
|
|
|
|
right: 32.w,
|
|
|
|
() async {
|
|
|
|
top: 32.w,
|
|
|
|
_date = await BeeDatePicker.timePicker(DateTime.now());
|
|
|
|
),
|
|
|
|
setState(() {});
|
|
|
|
child: ListView(
|
|
|
|
}),
|
|
|
|
children: [
|
|
|
|
_itemPicker('物品名称', _itemName, () {
|
|
|
|
_houseAddress('宁波华茂悦峰', '1幢-1单元-702室'),
|
|
|
|
_showItmePicker();
|
|
|
|
_checkCard('物品重量', _listWeight),
|
|
|
|
}),
|
|
|
|
CommonPicker(title: '出户时间'),
|
|
|
|
_getApproach(),
|
|
|
|
CommonPicker(title: '物品名称'),
|
|
|
|
_selectApproach == 0 ? SizedBox() : _inkWellCheckbox(),
|
|
|
|
_checkCard('搬运方式', _listMode),
|
|
|
|
Container(
|
|
|
|
_inkWellCheckbox(),
|
|
|
|
margin: EdgeInsets.only(top: 54.w, bottom: 24.w),
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
margin: EdgeInsets.only(top: 54.w, bottom: 24.w),
|
|
|
|
'添加图片信息(${_files.length}/9)',
|
|
|
|
child: Text(
|
|
|
|
style: TextStyle(
|
|
|
|
'添加图片信息(0/9)',
|
|
|
|
fontSize: 28.sp,
|
|
|
|
style: TextStyle(
|
|
|
|
color: Color(0xff333333),
|
|
|
|
fontSize: 28.sp,
|
|
|
|
|
|
|
|
color: Color(0xff333333),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
GridImagePicker(onChange: (files) {}),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
),
|
|
|
|
bottom: 0,
|
|
|
|
GridImagePicker(onChange: (files) {
|
|
|
|
child: BottomButton(title: '确认提交'),
|
|
|
|
_files = files;
|
|
|
|
)
|
|
|
|
setState(() {});
|
|
|
|
],
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
bottomNavi: BottomButton(
|
|
|
|
|
|
|
|
child: '确认提交'.text.color(ktextPrimary).bold.make(),
|
|
|
|
|
|
|
|
onPressed: () {},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
// Positioned(
|
|
|
|
|
|
|
|
// bottom: 0,
|
|
|
|
|
|
|
|
// child: BottomButton(title: '确认提交'),
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|