| | |
| | | |
| | | import 'package:flutter/cupertino.dart'; |
| | | import 'package:flutter/material.dart'; |
| | | import 'package:locations/api/http.dart'; |
| | | import 'package:locations/ui/widget/nav.dart'; |
| | | |
| | | import 'package:locations/utils/string_util.dart'; |
| | | import 'package:locations/utils/ui_utils.dart'; |
| | | |
| | | void main() { |
| | | runApp(MyApp()); |
| | |
| | | with SingleTickerProviderStateMixin { |
| | | List<String> questions = ["账号问题", "定位问题", "其他问题"]; |
| | | |
| | | final TextEditingController _contentController = TextEditingController(); |
| | | |
| | | @override |
| | | void initState() { |
| | | super.initState(); |
| | |
| | | @override |
| | | Widget build(BuildContext context) { |
| | | return Scaffold( |
| | | resizeToAvoidBottomInset: false, |
| | | backgroundColor: Color(0xFFFFFFFF), |
| | | body: Container( |
| | | child: Flex( |
| | |
| | | children: [ |
| | | TopNavBar(title: "提意见"), |
| | | Container( |
| | | padding: EdgeInsets.fromLTRB(17.5, 15, 17.5, 15), |
| | | padding: const EdgeInsets.fromLTRB(17.5, 15, 17.5, 15), |
| | | decoration: BoxDecoration( |
| | | color: Color(0xFFFAFAFA), |
| | | color: const Color(0xFFFAFAFA), |
| | | border: Border.all(color: Color(0xFFDBDBDB))), |
| | | child: Flex( |
| | | direction: Axis.vertical, |
| | |
| | | ), |
| | | Container( |
| | | child: TextField( |
| | | controller: _contentController, |
| | | maxLines: 9, |
| | | maxLength: 200, |
| | | decoration: InputDecoration( |
| | | decoration: const InputDecoration( |
| | | focusedBorder: InputBorder.none, |
| | | border: InputBorder.none, |
| | | counterStyle: TextStyle(color: Color(0xFF666666)), |
| | |
| | | margin: EdgeInsets.fromLTRB(18, 50, 18, 0), |
| | | child: InkWell( |
| | | onTap: () { |
| | | print("提交反馈"); |
| | | var content = _contentController.text; |
| | | if (StringUtil.isNullOrEmpty(content)) { |
| | | ToastUtil.toast("请填写问题"); |
| | | return; |
| | | } |
| | | var type; |
| | | if (checkIndex > -1) { |
| | | type = questions[checkIndex]; |
| | | } |
| | | |
| | | FeedBackApiUtil.advice(context, type, content).then((value) { |
| | | if (value == null) { |
| | | return; |
| | | } |
| | | if (value["code"] == 0) { |
| | | Navigator.of(context).pop(); |
| | | } else { |
| | | ToastUtil.toast(value["msg"]); |
| | | } |
| | | }); |
| | | }, |
| | | child: Container( |
| | | height: 42.5, |
| | | alignment: Alignment.center, |
| | | decoration: BoxDecoration( |
| | | decoration: const BoxDecoration( |
| | | color: Color(0xFF0E96FF), |
| | | borderRadius: BorderRadius.all(Radius.circular(10))), |
| | | child: Text( |
| | | child: const Text( |
| | | "提交反馈", |
| | | style: TextStyle(color: Colors.white, fontSize: 18), |
| | | ), |