update deto create page

hmxc
张萌 4 years ago
parent e736b13fc1
commit 3b5ada0858

@ -1,28 +1,33 @@
// Flutter imports: // Flutter imports:
// Dart imports:
import 'dart:io'; import 'dart:io';
// Flutter imports:
import 'package:flutter/cupertino.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:
import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/const/resource.dart';
import 'package:akuCommunity/provider/user_provider.dart'; import 'package:akuCommunity/provider/user_provider.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_divider.dart'; import 'package:akuCommunity/widget/bee_divider.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/buttons/bee_check_box.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/bottom_button.dart';
import 'package:akuCommunity/widget/buttons/radio_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_custom_picker.dart';
import 'package:akuCommunity/widget/picker/bee_date_picker.dart'; import 'package:akuCommunity/widget/picker/bee_date_picker.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Project imports:
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/picker/grid_image_picker.dart'; import 'package:akuCommunity/widget/picker/grid_image_picker.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'widget/common_picker.dart'; import 'widget/common_picker.dart';
import 'widget/common_radio.dart'; import 'widget/common_radio.dart';
import 'package:akuCommunity/const/resource.dart';
class DetoCreatePage extends StatefulWidget { class DetoCreatePage extends StatefulWidget {
DetoCreatePage({Key key}) : super(key: key); DetoCreatePage({Key key}) : super(key: key);
@ -156,40 +161,58 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
Widget _getWeight() { 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(
child: Row( // '物品重量',
// 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: [ children: [
Container( '物品重量'.text.color(ktextPrimary).size(28.sp).make(),
margin: EdgeInsets.only(right: 30.w), 24.w.heightBox,
child: Text( Wrap(
'物品重量', spacing: 40.w,
style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)), children: [
), ..._listWeight
.map((e) => BeeCheckButton(
title: e,
value: _listWeight.indexOf(e),
groupValue: _selectWeight,
onChange: (value) {
_selectWeight = value;
setState(() {});
},
))
.toList()
],
), ),
...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,
),
)),
], ],
), ),
); );
@ -197,40 +220,27 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
Widget _getApproach() { Widget _getApproach() {
return Container( return Container(
height: 96.w, child: Column(
padding: EdgeInsets.symmetric(vertical: 28.w), crossAxisAlignment: CrossAxisAlignment.start,
decoration: BoxDecoration(
border:
Border(bottom: BorderSide(color: Color(0xffeeeeee), width: 0.5)),
),
child: Row(
children: [ children: [
Container( '搬运方式'.text.color(ktextPrimary).size(28.sp).make(),
margin: EdgeInsets.only(right: 30.w), 24.w.heightBox,
child: Text( Wrap(
'搬运方式', 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()
],
), ),
...List.generate(
_listMode.length,
(index) => GestureDetector(
onTap: () {
setState(() {
_selectApproach = index;
});
},
child: CommonRadio(
size: 30.w,
text: _listMode[index]
.text
.color(ktextPrimary)
.size(28.sp)
.make(),
value: index,
groupValue: _selectApproach,
),
)),
], ],
), ),
); );
@ -241,18 +251,22 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
40.w.heightBox,
title.text.color(ktextPrimary).size(28.sp).make(),
16.w.widthBox,
Padding( Padding(
padding: EdgeInsets.symmetric(vertical: 28.w), padding: EdgeInsets.symmetric(vertical: 30.w),
child: InkWell( child: InkWell(
onTap: onTap, onTap: onTap,
child: Row( child: Row(
children: [ children: [
title.text.color(ktextPrimary).size(28.sp).make(),
36.w.widthBox,
(select.isEmptyOrNull ? '请选择' : select) (select.isEmptyOrNull ? '请选择' : select)
.text .text
.color(select.isEmptyOrNull ? ktextSubColor : ktextPrimary) .color(select.isEmptyOrNull ? ktextSubColor : ktextPrimary)
.size(28.sp) .size(36.sp)
.fontWeight(select.isEmptyOrNull
? FontWeight.normal
: FontWeight.bold)
.make(), .make(),
Spacer(), Spacer(),
Icon( Icon(

@ -10,6 +10,7 @@ import 'package:flutter_picker/flutter_picker.dart';
// Project imports: // Project imports:
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/picker/bee_date_picker.dart'; import 'package:akuCommunity/widget/picker/bee_date_picker.dart';
@Deprecated('s**t code should be remove') @Deprecated('s**t code should be remove')
class CommonPicker extends StatefulWidget { class CommonPicker extends StatefulWidget {
final String title; final String title;

@ -1,7 +1,10 @@
import 'package:akuCommunity/base/base_style.dart'; // Flutter imports:
import 'package:akuCommunity/widget/animated/animated_scale.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Project imports:
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/animated/animated_scale.dart';
class CommonRadio<T> extends StatefulWidget { class CommonRadio<T> extends StatefulWidget {
final T value; final T value;

@ -1,12 +1,13 @@
// Flutter imports: // Flutter imports:
import 'package:akuCommunity/base/base_style.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Package imports: // Package imports:
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:velocity_x/velocity_x.dart';
// Project imports: // Project imports:
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/constants/api.dart'; import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/manager/goods_out_model.dart'; import 'package:akuCommunity/model/manager/goods_out_model.dart';
import 'package:akuCommunity/pages/goods_deto_page/deto_create_page/deto_create_page.dart'; import 'package:akuCommunity/pages/goods_deto_page/deto_create_page/deto_create_page.dart';
@ -14,7 +15,7 @@ import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'widget/goods_info_card.dart'; import 'widget/goods_info_card.dart';
import 'package:velocity_x/velocity_x.dart';
class GoodsDetoPage extends StatefulWidget { class GoodsDetoPage extends StatefulWidget {
GoodsDetoPage({Key key}) : super(key: key); GoodsDetoPage({Key key}) : super(key: key);

@ -1,5 +1,4 @@
// Flutter imports: // Flutter imports:
import 'package:akuCommunity/base/base_style.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -8,6 +7,7 @@ import 'package:flutter_icons/flutter_icons.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart';
// Project imports: // Project imports:
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/routers/page_routers.dart';
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart';

@ -1,11 +1,9 @@
// Flutter imports: // Flutter imports:
import 'package:akuCommunity/pages/things_page/widget/fixed_evaluate_page.dart';
import 'package:akuCommunity/utils/network/base_model.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Package imports: // Package imports:
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -16,8 +14,10 @@ import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/const/resource.dart'; import 'package:akuCommunity/const/resource.dart';
import 'package:akuCommunity/model/manager/fixed_detail_model.dart'; import 'package:akuCommunity/model/manager/fixed_detail_model.dart';
import 'package:akuCommunity/pages/manager_func.dart'; import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/pages/things_page/widget/fixed_evaluate_page.dart';
import 'package:akuCommunity/utils/bee_map.dart'; import 'package:akuCommunity/utils/bee_map.dart';
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/utils/network/base_model.dart';
import 'package:akuCommunity/widget/bee_divider.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/views/horizontal_image_view.dart'; import 'package:akuCommunity/widget/views/horizontal_image_view.dart';

@ -1,15 +1,20 @@
import 'package:akuCommunity/base/base_style.dart'; // Flutter imports:
import 'package:akuCommunity/model/manager/fixed_detail_model.dart';
import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/utils/network/base_model.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Package imports:
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
// Project imports:
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/model/manager/fixed_detail_model.dart';
import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/utils/network/base_model.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
class FixedEvaluatePage extends StatefulWidget { class FixedEvaluatePage extends StatefulWidget {
final FixedDetailModel model; final FixedDetailModel model;

@ -1,6 +1,9 @@
import 'package:akuCommunity/base/base_style.dart'; // Flutter imports:
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Project imports:
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
class BeeCheckBox extends StatefulWidget { class BeeCheckBox extends StatefulWidget {

@ -0,0 +1,40 @@
// Flutter imports:
import 'package:flutter/material.dart';
// Project imports:
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/utils/headers.dart';
class BeeCheckButton<T> extends StatefulWidget {
final Function(T value) onChange;
final T value;
final T groupValue;
final String title;
BeeCheckButton(
{Key key, this.onChange, this.value, this.groupValue, this.title})
: super(key: key);
@override
_BeeCheckButtonState createState() => _BeeCheckButtonState();
}
class _BeeCheckButtonState extends State<BeeCheckButton> {
bool get isSelect => widget.groupValue == widget.value;
@override
Widget build(BuildContext context) {
return FlatButton(
onPressed: () {
widget.onChange(widget.value);
},
child: widget.title.text
.color(isSelect ? ktextPrimary : Color(0xFF979797))
.size(32.sp)
.make(),
padding: EdgeInsets.symmetric(horizontal: 34.w, vertical: 14.w),
shape: RoundedRectangleBorder(
side: BorderSide(
color: isSelect ? kPrimaryColor : ktextSubColor, width: 3.w),
borderRadius: BorderRadius.circular(36.w)),
);
}
}

@ -0,0 +1,48 @@
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:get/get.dart';
// Project imports:
import 'package:akuCommunity/utils/headers.dart';
class BeeCustomPicker extends StatefulWidget {
final Widget body;
final VoidCallback onPressed;
BeeCustomPicker({Key key, this.body, this.onPressed}) : super(key: key);
@override
_BeeCustomPickerState createState() => _BeeCustomPickerState();
}
class _BeeCustomPickerState extends State<BeeCustomPicker> {
@override
Widget build(BuildContext context) {
return SizedBox(
child: Material(
borderRadius: BorderRadius.vertical(top: Radius.circular(10)),
child: Column(
children: [
SizedBox(
height: 48,
child: NavigationToolbar(
leading: TextButton(
onPressed: Get.back,
child: '取消'.text.black.make(),
),
trailing: TextButton(
onPressed: widget.onPressed,
child: '确定'.text.black.make(),
),
),
),
widget.body,
],
),
),
height: Get.height / 3,
);
}
}
Loading…
Cancel
Save