|
|
@ -2,6 +2,8 @@ import 'package:flutter/material.dart'; |
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
import 'package:get/get.dart'; |
|
|
import 'package:get/get.dart'; |
|
|
|
|
|
|
|
|
|
|
|
import '../../../../data/services/db/sqflite_api.dart'; |
|
|
|
|
|
import '../../controllers/meeting_controller.dart'; |
|
|
import '../../utils/meeting_ui_utils.dart'; |
|
|
import '../../utils/meeting_ui_utils.dart'; |
|
|
|
|
|
|
|
|
class MeetingCloudView extends StatefulWidget { |
|
|
class MeetingCloudView extends StatefulWidget { |
|
|
@ -12,21 +14,41 @@ class MeetingCloudView extends StatefulWidget { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
class _MeetingCloudViewState extends State<MeetingCloudView> { |
|
|
class _MeetingCloudViewState extends State<MeetingCloudView> { |
|
|
|
|
|
final _controller = Get.put(MeetingController()); |
|
|
|
|
|
|
|
|
|
|
|
bool _isSync = false; |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
|
void initState() { |
|
|
|
|
|
super.initState(); |
|
|
|
|
|
_isSync = _controller.user['privatecloud'] == 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@override |
|
|
@override |
|
|
Widget build(BuildContext context) { |
|
|
Widget build(BuildContext context) { |
|
|
final isDarkMode = Theme.of(context).brightness == Brightness.dark; |
|
|
final isDarkMode = Theme.of(context).brightness == Brightness.dark; |
|
|
|
|
|
|
|
|
return Scaffold( |
|
|
return PopScope( |
|
|
backgroundColor: MeetingUIUtils.getBackgroundColor(isDarkMode), |
|
|
onPopInvokedWithResult: (didPop, result) { |
|
|
appBar: _buildAppBar(isDarkMode), |
|
|
int privatecloud = _isSync ? 1 : 0; |
|
|
body: _buildBody(isDarkMode), |
|
|
if (privatecloud != _controller.user['privatecloud']) { |
|
|
|
|
|
_controller.user['privatecloud'] = privatecloud; |
|
|
|
|
|
SqfliteApi.editUser(_controller.user['id'], |
|
|
|
|
|
Map<String, Object?>.from(_controller.user)); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
child: Scaffold( |
|
|
|
|
|
backgroundColor: MeetingUIUtils.getBackgroundColor(isDarkMode), |
|
|
|
|
|
appBar: _buildAppBar(isDarkMode), |
|
|
|
|
|
body: _buildBody(isDarkMode), |
|
|
|
|
|
), |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 构建应用栏 |
|
|
// 构建应用栏 |
|
|
PreferredSizeWidget _buildAppBar(bool isDarkMode) { |
|
|
PreferredSizeWidget _buildAppBar(bool isDarkMode) { |
|
|
return AppBar( |
|
|
return AppBar( |
|
|
backgroundColor: isDarkMode ? Colors.black : Colors.white, |
|
|
backgroundColor: MeetingUIUtils.getBackgroundColor(isDarkMode), |
|
|
surfaceTintColor: Colors.transparent, |
|
|
surfaceTintColor: Colors.transparent, |
|
|
elevation: 0.5, |
|
|
elevation: 0.5, |
|
|
leading: IconButton( |
|
|
leading: IconButton( |
|
|
@ -50,6 +72,88 @@ class _MeetingCloudViewState extends State<MeetingCloudView> { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Widget _buildBody(bool isDarkMode) { |
|
|
Widget _buildBody(bool isDarkMode) { |
|
|
return Container(); |
|
|
return Column( |
|
|
|
|
|
children: [ |
|
|
|
|
|
Container( |
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 20.w), |
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 12.w, vertical: 15.w), |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
color: MeetingUIUtils.getCardColor(isDarkMode), |
|
|
|
|
|
borderRadius: BorderRadius.circular(12.w), |
|
|
|
|
|
boxShadow: MeetingUIUtils.getCardShadow(isDarkMode), |
|
|
|
|
|
), |
|
|
|
|
|
child: Column( |
|
|
|
|
|
children: [ |
|
|
|
|
|
Container( |
|
|
|
|
|
width: 60.w, |
|
|
|
|
|
height: 60.w, |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
borderRadius: BorderRadius.circular(12.w), |
|
|
|
|
|
border: Border.all( |
|
|
|
|
|
color: Colors.grey, |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
child: Icon( |
|
|
|
|
|
Icons.phone_android, |
|
|
|
|
|
size: 40.w, |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
Padding( |
|
|
|
|
|
padding: EdgeInsets.only(top: 20.w, bottom: 10.w), |
|
|
|
|
|
child: Text( |
|
|
|
|
|
'同步到云端', |
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
|
|
fontSize: 18.sp, |
|
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
Text( |
|
|
|
|
|
'自动将你的录音同步到云端,你可以通过任意VOITRANS APP或VOITRANS Web(web.voitrans.com)播放、管理和分享录音。', |
|
|
|
|
|
textAlign: TextAlign.center, |
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
Container( |
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 2.w), |
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 12.w), |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
color: MeetingUIUtils.getCardColor(isDarkMode), |
|
|
|
|
|
borderRadius: BorderRadius.circular(12.w), |
|
|
|
|
|
boxShadow: MeetingUIUtils.getCardShadow(isDarkMode), |
|
|
|
|
|
), |
|
|
|
|
|
child: Row( |
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
|
children: [ |
|
|
|
|
|
Text( |
|
|
|
|
|
'同步VOITRANS APP', |
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
Transform.scale( |
|
|
|
|
|
scale: 0.9, |
|
|
|
|
|
alignment: Alignment.centerRight, |
|
|
|
|
|
child: Switch( |
|
|
|
|
|
value: _isSync, |
|
|
|
|
|
onChanged: (bool value) { |
|
|
|
|
|
setState(() { |
|
|
|
|
|
_isSync = value; |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|