|
|
|
@ -26,16 +26,17 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
bVoiceRemind = g_bVoiceRemind;
|
|
|
|
|
|
|
|
|
|
|
|
getListView();
|
|
|
|
getListView();
|
|
|
|
|
|
|
|
|
|
|
|
//监听 g_bVoiceRemind 更新事件
|
|
|
|
// //监听 g_bVoiceRemind 更新事件
|
|
|
|
eventBus.on<VoiceRemindUpdate>().listen((event) async {
|
|
|
|
// eventBus.on<VoiceRemindUpdate>().listen((event) async {
|
|
|
|
print(event.str + ", g_bVoiceRemind = $g_bVoiceRemind");
|
|
|
|
// print(event.str + ", g_bVoiceRemind = $g_bVoiceRemind");
|
|
|
|
setState(() {
|
|
|
|
// setState(() {
|
|
|
|
getListView();
|
|
|
|
// getListView();
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
////////
|
|
|
|
////////
|
|
|
|
@ -103,10 +104,10 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
|
|
|
|
|
|
|
|
OnTap_Remind() {
|
|
|
|
OnTap_Remind() {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
g_bVoiceRemind = !g_bVoiceRemind;
|
|
|
|
bVoiceRemind = !bVoiceRemind;
|
|
|
|
print("bVoiceRemind = $g_bVoiceRemind");
|
|
|
|
print("bVoiceRemind = $bVoiceRemind");
|
|
|
|
Storage.setBool('bVoiceRemind', g_bVoiceRemind);
|
|
|
|
// Storage.setBool('bVoiceRemind', bVoiceRemind);
|
|
|
|
if (g_bVoiceRemind) {
|
|
|
|
if (bVoiceRemind) {
|
|
|
|
print("播放语音提醒");
|
|
|
|
print("播放语音提醒");
|
|
|
|
AudioCache().play(File('audio/语音提醒.mp3').path); //语音提醒
|
|
|
|
AudioCache().play(File('audio/语音提醒.mp3').path); //语音提醒
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -114,6 +115,8 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool bVoiceRemind;
|
|
|
|
|
|
|
|
|
|
|
|
getListView() {
|
|
|
|
getListView() {
|
|
|
|
_listViewUser.clear();
|
|
|
|
_listViewUser.clear();
|
|
|
|
_listViewUser = [
|
|
|
|
_listViewUser = [
|
|
|
|
@ -130,9 +133,9 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
_getListTile('待审提醒',
|
|
|
|
_getListTile('待审提醒',
|
|
|
|
leadPath: 'assets/images/语音提醒.png',
|
|
|
|
leadPath: 'assets/images/语音提醒.png',
|
|
|
|
leadColor: _deepGreyColor,
|
|
|
|
leadColor: _deepGreyColor,
|
|
|
|
textColor: g_bVoiceRemind ? Colors.blue : null,
|
|
|
|
textColor: bVoiceRemind ? Colors.blue : null,
|
|
|
|
onTapFun: OnTap_Remind,
|
|
|
|
onTapFun: OnTap_Remind,
|
|
|
|
trailWidget: g_bVoiceRemind
|
|
|
|
trailWidget: bVoiceRemind
|
|
|
|
? Icon(Icons.check_box, color: Colors.blue)
|
|
|
|
? Icon(Icons.check_box, color: Colors.blue)
|
|
|
|
: Icon(Icons.check_box_outline_blank, color: Colors.blueAccent)),
|
|
|
|
: Icon(Icons.check_box_outline_blank, color: Colors.blueAccent)),
|
|
|
|
_getListTile('提醒间隔(秒)',
|
|
|
|
_getListTile('提醒间隔(秒)',
|
|
|
|
@ -150,12 +153,16 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
text: "确认",
|
|
|
|
text: "确认",
|
|
|
|
color: Colors.blueAccent,
|
|
|
|
color: Colors.blueAccent,
|
|
|
|
onTop: () {
|
|
|
|
onTop: () {
|
|
|
|
if (g_bVoiceRemind) {
|
|
|
|
g_bVoiceRemind = bVoiceRemind;
|
|
|
|
g_remindGap = _gap;
|
|
|
|
print("g_bVoiceRemind = $g_bVoiceRemind");
|
|
|
|
print("g_remindGap = $g_remindGap");
|
|
|
|
Storage.setBool('bVoiceRemind', g_bVoiceRemind);
|
|
|
|
Storage.setInt('nRemindGap', g_remindGap);
|
|
|
|
|
|
|
|
setRemindTimer();
|
|
|
|
g_remindGap = _gap;
|
|
|
|
}
|
|
|
|
print("g_remindGap = $g_remindGap");
|
|
|
|
|
|
|
|
Storage.setInt('nRemindGap', g_remindGap);
|
|
|
|
|
|
|
|
setRemindTimer(enable: g_bVoiceRemind);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AudioCache().play(File('audio/yinxiao1064.mp3').path); //音效提醒
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -180,7 +187,7 @@ class _LoginPageState extends State<page7_setRemind> {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
width: ScreenUtil().setWidth(150),
|
|
|
|
width: ScreenUtil().setWidth(150),
|
|
|
|
child: TextField(
|
|
|
|
child: TextField(
|
|
|
|
readOnly: !g_bVoiceRemind,
|
|
|
|
readOnly: !bVoiceRemind,
|
|
|
|
focusNode: FocusNode(),
|
|
|
|
focusNode: FocusNode(),
|
|
|
|
textAlignVertical: TextAlignVertical(y: 1.0),
|
|
|
|
textAlignVertical: TextAlignVertical(y: 1.0),
|
|
|
|
controller: TextEditingController.fromValue(TextEditingValue(
|
|
|
|
controller: TextEditingController.fromValue(TextEditingValue(
|
|
|
|
|