From 8b828ada08d03a8f4fcddfbf334e8d4870019c51 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Mon, 2 Nov 2020 10:44:13 +0800 Subject: [PATCH] add feedback page --- lib/style/app_style.dart | 14 +++-- lib/ui/settings/setting_feedback_page.dart | 64 ++++++++++++++++++++++ lib/ui/settings/settings_page.dart | 5 ++ lib/ui/widgets/common/aku_scaffold.dart | 4 ++ 4 files changed, 82 insertions(+), 5 deletions(-) create mode 100644 lib/ui/settings/setting_feedback_page.dart diff --git a/lib/style/app_style.dart b/lib/style/app_style.dart index 79324b2..5e81c07 100644 --- a/lib/style/app_style.dart +++ b/lib/style/app_style.dart @@ -1,13 +1,17 @@ import 'package:flutter/material.dart'; + class AppStyle { //颜色,渐变主颜色和次级颜色 - static const primaryColor =Color(0xFFFDCF12); - static const minorColor=Color(0xFFFFDF5D); + static const primaryColor = Color(0xFFFDCF12); + static const minorColor = Color(0xFFFFDF5D); //字体 ///主字体颜色 - static const primaryTextColor=Color(0xFF333333); + static const primaryTextColor = Color(0xFF333333); + ///次字体颜色 - static const minorTextColor=Color(0xFF999999); + static const minorTextColor = Color(0xFF999999); -} \ No newline at end of file + ///背景色 + static const backgroundColor = Color(0xFFF9F9F9); +} diff --git a/lib/ui/settings/setting_feedback_page.dart b/lib/ui/settings/setting_feedback_page.dart new file mode 100644 index 0000000..4fb4478 --- /dev/null +++ b/lib/ui/settings/setting_feedback_page.dart @@ -0,0 +1,64 @@ +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +import 'package:aku_ui/common_widgets/aku_material_button.dart'; +import 'package:flutter/material.dart'; +import 'package:aku_community_manager/tools/screen_tool.dart'; + +class SettingFeedBackPage extends StatefulWidget { + SettingFeedBackPage({Key key}) : super(key: key); + + @override + _SettingFeedBackPageState createState() => _SettingFeedBackPageState(); +} + +class _SettingFeedBackPageState extends State { + @override + Widget build(BuildContext context) { + return AkuScaffold( + title: '意见反馈', + backgroundColor: Colors.white, + body: ListView( + children: [ + Container( + height: 20.w, + color: AppStyle.backgroundColor, + ), + Container( + margin: EdgeInsets.symmetric( + vertical: 24.w, + horizontal: 32.w, + ), + padding: EdgeInsets.all(24.w), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + TextField( + minLines: 5, + maxLines: 99, + decoration: InputDecoration( + border: InputBorder.none, + contentPadding: EdgeInsets.zero, + hintText: '请输入你的意见和建议', + hintStyle: TextStyle( + color: Color(0xFF999999), + fontSize: 28.sp, + ), + ), + ), + ], + ), + decoration: BoxDecoration( + color: AppStyle.backgroundColor, + borderRadius: BorderRadius.circular(16.w), + ), + ), + ], + ), + bottom: AkuMaterialButton( + onPressed: () {}, + child: Text('提交'), + color: AppStyle.minorColor, + ), + ); + } +} diff --git a/lib/ui/settings/settings_page.dart b/lib/ui/settings/settings_page.dart index 79ca379..d2d5458 100644 --- a/lib/ui/settings/settings_page.dart +++ b/lib/ui/settings/settings_page.dart @@ -1,8 +1,11 @@ +import 'package:aku_community_manager/ui/settings/setting_feedback_page.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_tile.dart'; +import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:aku_community_manager/tools/screen_tool.dart'; +import 'package:get/get.dart'; class SettingsPage extends StatefulWidget { SettingsPage({Key key}) : super(key: key); @@ -38,11 +41,13 @@ class _SettingsPageState extends State { AkuTile( title: Text('意见反馈'), arrow: true, + onTap: () => Get.to(SettingFeedBackPage()), ), Divider(height: 1.w), AkuTile( title: Text('清理缓存'), arrow: true, + onTap: () => BotToast.showText(text: '缓存清理完成'), ), ], ), diff --git a/lib/ui/widgets/common/aku_scaffold.dart b/lib/ui/widgets/common/aku_scaffold.dart index c34817c..62445a4 100644 --- a/lib/ui/widgets/common/aku_scaffold.dart +++ b/lib/ui/widgets/common/aku_scaffold.dart @@ -35,6 +35,8 @@ class AkuScaffold extends StatefulWidget { ///body final Widget body; + final Widget bottom; + ///背景色 /// ///默认`0xFFF9F9F9` @@ -48,6 +50,7 @@ class AkuScaffold extends StatefulWidget { this.brightness = Brightness.light, this.body, this.backgroundColor = const Color(0XFFF9F9F9), + this.bottom, }) : super(key: key); @override @@ -76,6 +79,7 @@ class _AkuScaffoldState extends State { ), ), body: widget.body, + bottomNavigationBar: widget.bottom, ); } }