mark shit code & remove shit code.

hmxc
小赖 4 years ago
parent 7e5cfc1013
commit a041bafee1

@ -7,7 +7,6 @@ import 'package:akuCommunity/base/assets_image.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/common_input.dart';
import 'package:akuCommunity/widget/single_image_up.dart';
class CertificationPage extends StatefulWidget {
CertificationPage({Key key}) : super(key: key);
@ -86,16 +85,16 @@ class _CertificationPageState extends State<CertificationPage> {
style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)),
),
SizedBox(height: 25.w),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: List.generate(
_uploadImageList.length,
(index) => SingleImageUp(
title: _uploadImageList[index]['title'],
imagePath: _uploadImageList[index]['imagePath'],
),
),
),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: List.generate(
// _uploadImageList.length,
// (index) => SingleImageUp(
// title: _uploadImageList[index]['title'],
// imagePath: _uploadImageList[index]['imagePath'],
// ),
// ),
// ),
],
),
);

@ -7,7 +7,7 @@ import 'package:akuCommunity/base/assets_image.dart';
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/common_input.dart';
import 'package:akuCommunity/widget/single_image_up.dart';
// import 'package:akuCommunity/widget/single_image_up.dart';
import 'common_select.dart';
class DecoratorInfo extends StatefulWidget {
@ -81,16 +81,16 @@ class _DecoratorInfoState extends State<DecoratorInfo> {
style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)),
),
SizedBox(height: 25.w),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: List.generate(
_uploadImageList.length,
(index) => SingleImageUp(
title: _uploadImageList[index]['title'],
imagePath: _uploadImageList[index]['imagePath'],
),
),
),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: List.generate(
// _uploadImageList.length,
// (index) => SingleImageUp(
// title: _uploadImageList[index]['title'],
// imagePath: _uploadImageList[index]['imagePath'],
// ),
// ),
// ),
],
),
);

@ -7,7 +7,7 @@ import 'package:akuCommunity/base/assets_image.dart';
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/common_input.dart';
import 'package:akuCommunity/widget/single_image_up.dart';
// import 'package:akuCommunity/widget/single_image_up.dart';
import 'decorator_info.dart';
import 'house_info.dart';
@ -114,42 +114,42 @@ class _DirectorManageState extends State<DirectorManage> {
style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)),
),
SizedBox(height: 25.w),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: List.generate(
2,
(index) => SingleImageUp(
title: _uploadImageList[index]['title'],
imagePath: _uploadImageList[index]['imagePath'],
),
),
),
SizedBox(height: 25.w),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: List.generate(
2,
(index) => SingleImageUp(
title: _uploadImageList.take(4).skip(2).toList()[index]
['title'],
imagePath: _uploadImageList.take(4).skip(2).toList()[index]
['imagePath'],
),
),
),
SizedBox(height: 25.w),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: List.generate(
1,
(index) => SingleImageUp(
title: _uploadImageList.take(5).skip(4).toList()[index]
['title'],
imagePath: _uploadImageList.take(5).skip(4).toList()[index]
['imagePath'],
),
),
),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: List.generate(
// 2,
// (index) => SingleImageUp(
// title: _uploadImageList[index]['title'],
// imagePath: _uploadImageList[index]['imagePath'],
// ),
// ),
// ),
// SizedBox(height: 25.w),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: List.generate(
// 2,
// (index) => SingleImageUp(
// title: _uploadImageList.take(4).skip(2).toList()[index]
// ['title'],
// imagePath: _uploadImageList.take(4).skip(2).toList()[index]
// ['imagePath'],
// ),
// ),
// ),
// SizedBox(height: 25.w),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: List.generate(
// 1,
// (index) => SingleImageUp(
// title: _uploadImageList.take(5).skip(4).toList()[index]
// ['title'],
// imagePath: _uploadImageList.take(5).skip(4).toList()[index]
// ['imagePath'],
// ),
// ),
// ),
],
),
);

@ -2,6 +2,7 @@
import 'dart:math';
// Flutter imports:
import 'package:akuCommunity/widget/picker/grid_image_picker.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -13,7 +14,6 @@ import 'package:get/get.dart';
// Project imports:
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/common_image_picker.dart';
class FeedBackPage extends StatefulWidget {
FeedBackPage({Key key}) : super(key: key);
@ -130,7 +130,7 @@ class _FeedBackPageState extends State<FeedBackPage> {
style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)),
),
SizedBox(height: 24.w),
CommonImagePicker(),
GridImagePicker(onChange: (files) {}),
SizedBox(height: 76.w),
_inkWellSubmit(),
],

@ -1,4 +1,6 @@
// Flutter imports:
import 'package:akuCommunity/pages/setting_page/agreement_page/agreement_page.dart';
import 'package:akuCommunity/pages/setting_page/agreement_page/privacy_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -147,6 +149,14 @@ class _SettingsPageState extends State<SettingsPage> {
title: '账号管理',
onTap: AccountManagerPage().to,
),
_buildTile(
title: '小蜜蜂用户协议',
onTap: AgreementPage().to,
),
_buildTile(
title: '小蜜蜂隐私政策',
onTap: PrivacyPage().to,
),
].sepWidget(
separate: Divider(
indent: 32.w,

@ -1,300 +0,0 @@
// Flutter imports:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Project imports:
import 'package:akuCommunity/base/assets_image.dart';
import 'package:akuCommunity/routers/page_routers.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/common_image_picker.dart';
class ThingsCreatePage extends StatefulWidget {
final Bundle bundle;
ThingsCreatePage({Key key, this.bundle}) : super(key: key);
@override
_ThingsCreatePageState createState() => _ThingsCreatePageState();
}
class _ThingsCreatePageState extends State<ThingsCreatePage> {
TextEditingController _thingsContent = new TextEditingController();
String hintText = '您对我们的工作有什么建议吗?欢迎您提供给我们宝贵的建议,谢谢';
List<Map<String, dynamic>> _typeList = [];
@override
void initState() {
super.initState();
if (widget.bundle.getMap('create')['isIdea'] != null) {
_typeList = [
{
'title': widget.bundle.getMap('create')['isIdea'] ? '建议' : '投诉',
'image': widget.bundle.getMap('create')['isIdea']
? AssetsImage.PROPOSAL
: AssetsImage.COMPLAINT,
'isCheck': true
},
{
'title': widget.bundle.getMap('create')['isIdea'] ? '咨询' : '表扬',
'image': widget.bundle.getMap('create')['isIdea']
? AssetsImage.CONSULT
: AssetsImage.LIKE,
'isCheck': false
},
];
} else {
_typeList = [
{'title': '公区报修', 'isCheck': true},
{'title': '家庭维修', 'isCheck': false},
];
}
}
Widget _containerHouse() {
return Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Image.asset(
AssetsImage.HOUSE,
height: 60.w,
width: 60.w,
),
SizedBox(width: 40.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'深证华茂悦峰',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 34.sp,
color: Color(0xff333333)),
),
SizedBox(width: 10.w),
Text(
'1幢-1单元-702室',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 34.sp,
color: Color(0xff333333)),
)
],
),
],
),
);
}
Widget _inkWellType(String title, image, bool isCheck, int index) {
return InkWell(
onTap: () {
_typeList.forEach((item) {
item['isCheck'] = false;
});
_typeList[index]['isCheck'] = true;
setState(() {});
},
child: Container(
height: 72.w,
width: 176.w,
padding: EdgeInsets.symmetric(
vertical: 10.w,
),
decoration: BoxDecoration(
color: isCheck ? Color(0xfffff4d3) : Color(0xffffffff),
borderRadius: BorderRadius.all(Radius.circular(36)),
border: Border.all(
color: isCheck ? Color(0xffffc40c) : Color(0xff979797),
width: 1)),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
image != null
? Image.asset(
image,
height: 30.w,
width: 30.w,
color: isCheck ? Color(0xff333333) : Color(0xff979797),
)
: SizedBox(),
SizedBox(width: 9.w),
Text(
title,
style: TextStyle(
fontSize: 28.sp,
color: isCheck ? Color(0xff333333) : Color(0xff979797)),
),
],
),
),
);
}
Widget _containerTextField() {
return Container(
padding: EdgeInsets.only(top: 32.w, left: 22.w, right: 35.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(8)),
border: Border.all(color: Color(0xffd4cfbe), width: 1.0),
),
child: TextFormField(
cursorColor: Color(0xffffc40c),
style: TextStyle(
fontSize: 28.sp,
fontWeight: FontWeight.w600,
),
controller: _thingsContent,
onChanged: (String value) {},
maxLines: 8,
decoration: InputDecoration(
isDense: true,
contentPadding: EdgeInsets.only(
top: 0.w,
bottom: 0.w,
),
hintText: hintText,
border: InputBorder.none, //线
fillColor: Colors.white,
filled: true,
hintStyle: TextStyle(
color: Color(0xff999999),
fontSize: 28.sp,
fontWeight: FontWeight.normal,
),
),
),
);
}
Widget _positionedButton() {
return Positioned(
bottom: 0,
child: InkWell(
child: Container(
alignment: Alignment.center,
height: 98.w,
width: 750.w,
padding: EdgeInsets.symmetric(vertical: 26.5.w),
color: Color(0xffffc40c),
child: Text(
'确认提交',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 32.sp,
color: Color(0xff333333),
),
),
),
),
);
}
Widget _cardList(String title, Widget widget) {
return Container(
padding: EdgeInsets.only(
left: 36.w,
right: 36.w,
top: 32.w,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)),
),
SizedBox(height: 32.w),
widget,
SizedBox(height: 26.w),
// index == 0 ? Divider() : SizedBox(),
],
),
);
}
Widget _containerType() {
return Container(
child: Row(
children: [
_inkWellType(_typeList[0]['title'], _typeList[0]['image'],
_typeList[0]['isCheck'], 0),
SizedBox(width: 80.w),
_inkWellType(_typeList[1]['title'], _typeList[1]['image'],
_typeList[1]['isCheck'], 1),
],
),
);
}
@override
Widget build(BuildContext context) {
// List<Map<String, dynamic>> _listWidget = [
// {'title': '业主/租客房屋', 'widget': _containerHouse()},
// {'title': '您要选择的类型是?', 'widget': _containerType()},
// {'title': '请输入内容', 'widget': _containerTextField()},
// {'title': '添加图片信息(0/9)', 'widget': _containerAddImage()},
// ];
// List<Widget> _listView() {
// return _listWidget
// .asMap()
// .keys
// .map((index) => Container(
// padding: EdgeInsets.only(
// left: 36.w,
// right: 36.w,
// top: 32.w,
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// _listWidget[index]['title'],
// style: TextStyle(
// fontSize: 28.sp,
// color: Color(0xff333333)),
// ),
// SizedBox(height: 32.w),
// _listWidget[index]['widget'],
// SizedBox(height: 26.w),
// index == 0 ? Divider() : SizedBox(),
// ],
// ),
// ))
// .toList();
// }
return BeeScaffold(
title: '${widget.bundle.getMap('create')['title']}',
body: Container(
color: Colors.white,
child: Stack(
children: [
ListView(
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Column(
children: [
_cardList('业主/租客房屋', _containerHouse()),
_cardList('您要选择的类型是?', _containerType()),
_cardList('请输入内容', _containerTextField()),
_cardList('添加图片信息(0/9)', CommonImagePicker()),
],
),
),
],
),
_positionedButton(),
],
),
),
);
}
}

@ -1,146 +0,0 @@
// Dart imports:
import 'dart:async';
// Flutter imports:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_icons/flutter_icons.dart';
import 'package:multi_image_picker/multi_image_picker.dart';
// Project imports:
import 'package:akuCommunity/base/assets_image.dart';
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/utils/headers.dart';
class CommonImagePicker extends StatefulWidget {
CommonImagePicker({Key key}) : super(key: key);
@override
_CommonImagePickerState createState() => _CommonImagePickerState();
}
class _CommonImagePickerState extends State<CommonImagePicker> {
//
List images = [];
String error = 'No error Dectected';
List resultList;
//
Future<void> uploadImages() async {
try {
resultList = await MultiImagePicker.pickImages(
//
maxImages: 9,
//
enableCamera: true,
materialOptions: MaterialOptions(
//,false
// actionBarColor: '#fff',
// statusBarColor: '#fff',
// actionBarTitleColor: '#333',
startInAllView: true,
allViewTitle: "相册",
useDetailsView: false,
textOnNothingSelected: "没有选择照片",
),
);
} on Exception catch (e) {
error = e.toString();
print(error);
}
if (!mounted) return;
setState(() {
// images = (resultList == null) ? [] : resultList;
if (resultList != null) {
images.addAll(resultList);
}
});
//
for (int i = 0; i < images.length; i++) {
//byteData
// ByteData byteData = await images[i].getByteData();
// List<int> imageData = byteData.buffer.asUint8List();
//MultipartFile multipartFile = MultipartFile.fromBytes(
//imageData,
//
//filename: "some-file-name.jpg",
//
//contentType:MediaType("image","jpg")
//);
//FormData formData = FormData.fromMap({
//
//"files": multipartFile
//});
// url
//String url = ''
//
//Map<String, dynamic> params = Map();
// 使 dio
//var response = await dio.post(url, data: formData, queryParameters: params);
}
}
@override
Widget build(BuildContext context) {
return Container(
child: GridView.builder(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
mainAxisSpacing: 5.0,
crossAxisSpacing: 5.0,
crossAxisCount: 3,
),
itemBuilder: (BuildContext context, int index) {
return index == images.length
? InkWell(
onTap: () {
uploadImages();
},
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(6)),
child: Image.asset(
AssetsImage.IMAGEADD,
width: 218.w,
height: 218.w,
),
),
)
: Stack(
children: [
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(6)),
child: AssetThumb(
asset: images[index],
width: 300,
height: 300,
),
),
Positioned(
top: 0,
right: 0,
child: InkWell(
onTap: () {
setState(() {
images.removeAt(index);
});
},
child: Icon(
AntDesign.closecircle,
color: BaseStyle.colorffc40c,
size: 36.sp,
),
),
),
],
);
},
itemCount: images.length == 9 ? images.length : images.length + 1,
),
);
}
}

@ -1,241 +0,0 @@
// Dart imports:
import 'dart:async';
// Flutter imports:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_icons/flutter_icons.dart';
import 'package:multi_image_picker/multi_image_picker.dart';
// Project imports:
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/utils/headers.dart';
class SingleImageUp extends StatefulWidget {
final String title, imagePath;
SingleImageUp({Key key, this.title, this.imagePath}) : super(key: key);
@override
_SingleImageUpState createState() => _SingleImageUpState();
}
class _SingleImageUpState extends State<SingleImageUp> {
//
List images = [];
String error = 'No error Dectected';
List resultList;
//
Future<void> uploadImages() async {
try {
resultList = await MultiImagePicker.pickImages(
//
maxImages: 1,
//
enableCamera: true,
materialOptions: MaterialOptions(
//,false
// actionBarColor: '#fff',
// statusBarColor: '#fff',
// actionBarTitleColor: '#333',
startInAllView: true,
allViewTitle: "相册",
useDetailsView: false,
textOnNothingSelected: "没有选择照片",
),
);
} on Exception catch (e) {
error = e.toString();
print(error);
}
if (!mounted) return;
setState(() {
// images = (resultList == null) ? [] : resultList;
if (resultList != null) {
images.addAll(resultList);
}
});
//
for (int i = 0; i < images.length; i++) {
//byteData
//MultipartFile multipartFile = MultipartFile.fromBytes(
//imageData,
//
//filename: "some-file-name.jpg",
//
//contentType:MediaType("image","jpg")
//);
//FormData formData = FormData.fromMap({
//
//"files": multipartFile
//});
// url
//String url = ''
//
//Map<String, dynamic> params = Map();
// 使 dio
//var response = await dio.post(url, data: formData, queryParameters: params);
}
}
@override
Widget build(BuildContext context) {
return Container(
child: InkWell(
onTap: images.length == 0
? () {
uploadImages();
}
: null,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Stack(
children: [
Container(
width: 328.w,
height: 180.w,
decoration: BoxDecoration(
border: Border.all(
color: Color(0xffe8e8e8),
width: images.length == 0 ? 0 : 4.w),
borderRadius: BorderRadius.all(Radius.circular(6.w)),
),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(6.w)),
child: images.length == 0
? Image.asset(
widget.imagePath,
width: 328.w,
height: 180.w,
)
: AssetThumb(asset: images[0], width: 328, height: 180),
),
),
images.length == 0
? SizedBox()
: Positioned(
top: 0,
right: 0,
child: InkWell(
onTap: () {
setState(() {
images.removeAt(0);
});
},
child: Icon(
AntDesign.closecircle,
color: BaseStyle.colorffc40c,
size: 36.sp,
),
),
),
],
),
SizedBox(height: 16.w),
Text(
widget.title,
style: TextStyle(
fontSize: BaseStyle.fontSize24, color: BaseStyle.color999999),
),
],
),
),
// GridView.builder(
// shrinkWrap: true,
// physics: NeverScrollableScrollPhysics(),
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 2,
// mainAxisSpacing: 30.w,
// crossAxisSpacing: 32.w,
// childAspectRatio: 328.w / 230.w,
// ),
// itemBuilder: (BuildContext context, int index) {
// return index == images.length
// ? InkWell(
// onTap: () {
// uploadImages();
// },
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// ClipRRect(
// borderRadius: BorderRadius.all(
// Radius.circular(6.w)),
// child: Image.asset(
// widget.imagePath,
// width: 328.w,
// height: 180.w,
// ),
// ),
// SizedBox(height: 16.w),
// Text(
// widget.title,
// style: TextStyle(
// fontSize: BaseStyle.fontSize24,
// color: BaseStyle.color999999),
// ),
// ],
// ),
// )
// : Stack(
// children: [
// Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// ClipRRect(
// borderRadius: BorderRadius.all(
// Radius.circular(6.w)),
// child: AssetThumb(
// asset: images[index],
// width: 328,
// height: 180,
// ),
// // Image.asset(
// // widget.imagePath,
// // width: 328.w,
// // height: 180.w,
// // ),
// ),
// SizedBox(height: 16.w),
// Text(
// widget.title,
// style: TextStyle(
// fontSize: BaseStyle.fontSize24,
// color: BaseStyle.color999999),
// ),
// ],
// ),
// Positioned(
// top: 0,
// right: 0,
// child: InkWell(
// onTap: () {
// setState(() {
// images.removeAt(index);
// });
// },
// child: Icon(
// AntDesign.closecircle,
// color: BaseStyle.colorffc40c,
// size: 36.sp,
// ),
// ),
// ),
// ],
// );
// },
// itemCount: 1,
// ),
);
}
}

@ -672,13 +672,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0-nullsafety.3"
multi_image_picker:
dependency: "direct main"
description:
name: multi_image_picker
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.7.14"
nested:
dependency: transitive
description:

@ -54,8 +54,6 @@ dependencies:
bot_toast: ^3.0.5
#加载html
flutter_html: ^1.0.2
#图片多选
multi_image_picker: ^4.7.13
#上拉滑动
sliding_up_panel: ^1.0.2
#经纬度

Loading…
Cancel
Save