Commit 8c38171c authored by tongzifang's avatar tongzifang

add setting

parent 828b184d
......@@ -14,4 +14,7 @@ class UserFeedBackString{
static String get feedback_content_none=> "请输入不少于5个字的描述";
static String get feedback_finish=> "你的反馈是对我们最大的支持\n谢谢反馈";
static String get feedback_count=> "完成(";
static String get feedback_set=> "反馈设置";
static String get feedback_set_tag=> "截图反馈";
static String get feedback_set_content=> "开启时,APP截图时弹出反馈动画,可快速反馈";
}
\ No newline at end of file
......@@ -45,7 +45,21 @@ class _UserFeedBackPageState extends State<UserFeedBackPage> {
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: CommonColor.colorF5,
appBar: PageUtils.navigator(context, title: UserFeedBackString.title),
appBar: PageUtils.navigator(context,
title: UserFeedBackString.title,
actions: [
IconButton(
icon: Icon(Icons.settings_outlined),
onPressed: () {
BoostNavigator.instance.push(
"user_feedback_setting", //required
withContainer: false,
arguments: {},
opaque: true, //optional,default value is true
);
},
),
]),
body: Stack(
children: [
Positioned(
......
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:base_data_channel/config/common_colors.dart';
import 'package:base_data_channel/utils/page_utils.dart';
import 'config/user_feedback_strings.dart';
import 'package:flutter_boost/flutter_boost.dart';
import 'package:sp_util/sp_util.dart';
class UserFeedbackSetting extends StatefulWidget {
UserFeedbackSetting({Key? key}) : super(key: key);
@override
State<UserFeedbackSetting> createState() => _UserFeedbackSettingState();
}
class _UserFeedbackSettingState extends State<UserFeedbackSetting> {
int openScreenshot = 0;
@override
void initState() {
super.initState();
openScreenshot = SpUtil.getInt("openScreenshot") ?? 0;
}
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: CommonColor.colorF5,
appBar:
PageUtils.navigator(context, title: UserFeedBackString.feedback_set),
body: Container(
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(12)),
padding: EdgeInsets.only(left: 12, right: 12, bottom: 12, top: 6),
margin: EdgeInsets.all(12),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
UserFeedBackString.feedback_set_tag,
style: TextStyle(
color: CommonColor.color33,
fontSize: 16,
fontWeight: FontWeight.w500),
),
Spacer(),
CupertinoSwitch(
value: openScreenshot == 1,
onChanged: (value) {
setState(() {
openScreenshot = value ? 1 : 0;
BoostChannel.instance
.sendEventToNative("publicMonitoring", {
"method": "screenshotSetting",
"openScreenshot": openScreenshot,
});
});
},
),
],
),
Text(
UserFeedBackString.feedback_set_content,
style: TextStyle(color: CommonColor.color99, fontSize: 13),
)
],
),
),
);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment