意见反馈逻辑修改

hmxc
小赖 4 years ago
parent 80ca5b741e
commit 69bcbfb6c8

@ -1,5 +1,6 @@
import 'dart:math'; import 'dart:math';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:akuCommunity/utils/screenutil.dart'; import 'package:akuCommunity/utils/screenutil.dart';
@ -75,10 +76,22 @@ class _FeedBackPageState extends State<FeedBackPage> {
Widget _inkWellSubmit() { Widget _inkWellSubmit() {
return InkWell( return InkWell(
onTap: () { onTap: () {
Navigator.pop(context); if (TextUtil.isEmpty(_ideaContent.text))
Future.delayed(Duration(milliseconds:1000+ Random().nextInt(1000)), () { showToast('意见不能为空');
showToast('提交成功!'); else {
}); showDialog(
context: context,
child: Center(
child: CupertinoActivityIndicator(),
),
);
Future.delayed(Duration(milliseconds: 1000 + Random().nextInt(1000)),
() {
showToast('意见提交成功');
Navigator.pop(context);
Navigator.pop(context);
});
}
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -111,47 +124,47 @@ class _FeedBackPageState extends State<FeedBackPage> {
preferredSize: Size.fromHeight(kToolbarHeight), preferredSize: Size.fromHeight(kToolbarHeight),
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
color: Colors.white, color: Colors.white,
child: GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
FocusScope.of(context).requestFocus(FocusNode()); FocusScope.of(context).requestFocus(FocusNode());
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: Screenutil.length(32), horizontal: Screenutil.length(32),
vertical: Screenutil.length(36), vertical: Screenutil.length(36),
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: Screenutil.length(76)), SizedBox(height: Screenutil.length(76)),
Text( Text(
'意见反馈', '意见反馈',
style: TextStyle( style: TextStyle(
fontSize: Screenutil.size(28), fontSize: Screenutil.size(28),
color: Color(0xff333333)), color: Color(0xff333333)),
), ),
SizedBox(height: Screenutil.length(24)), SizedBox(height: Screenutil.length(24)),
_containerTextField(), _containerTextField(),
SizedBox(height: Screenutil.length(24)), SizedBox(height: Screenutil.length(24)),
Text( Text(
'添加图片信息(0/9)', '添加图片信息(0/9)',
style: TextStyle( style: TextStyle(
fontSize: Screenutil.size(28), fontSize: Screenutil.size(28),
color: Color(0xff333333)), color: Color(0xff333333)),
), ),
SizedBox(height: Screenutil.length(24)), SizedBox(height: Screenutil.length(24)),
CommonImagePicker(), CommonImagePicker(),
SizedBox(height: Screenutil.length(76)), SizedBox(height: Screenutil.length(76)),
_inkWellSubmit(), _inkWellSubmit(),
], ],
),
), ),
), ),
), ),
), ),
),
); );
} }
} }

Loading…
Cancel
Save