|
|
|
@ -1,10 +1,15 @@
|
|
|
|
|
import 'dart:io'; |
|
|
|
|
|
|
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
|
import 'package:flutter/gestures.dart'; |
|
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
|
import 'package:huixiang/generated/l10n.dart'; |
|
|
|
|
import 'package:huixiang/utils/font_weight.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/border_text.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/round_button.dart'; |
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
import 'package:sharesdk_plugin/sharesdk_interface.dart'; |
|
|
|
|
|
|
|
|
|
class GuidePage extends StatefulWidget { |
|
|
|
|
@override |
|
|
|
@ -14,6 +19,34 @@ class GuidePage extends StatefulWidget {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class _GuidePage extends State<GuidePage> { |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void initState() { |
|
|
|
|
super.initState(); |
|
|
|
|
// isLogin(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
isLogin() async { |
|
|
|
|
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); |
|
|
|
|
|
|
|
|
|
if (sharedPreferences.getBool("isShowPrivacyPolicy") == null || |
|
|
|
|
!sharedPreferences.getBool("isShowPrivacyPolicy")) { |
|
|
|
|
showAlertDialog(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// if (sharedPreferences.containsKey('token') && |
|
|
|
|
// sharedPreferences.getString("token") != null && |
|
|
|
|
// sharedPreferences.getString("token") != "") { |
|
|
|
|
// Navigator.of(context).popAndPushNamed('/router/main_page'); |
|
|
|
|
// } else { |
|
|
|
|
// initController(); |
|
|
|
|
// |
|
|
|
|
// apiService = ApiService(Dio(), context: context); |
|
|
|
|
// isShowLogin = true; |
|
|
|
|
// setState(() {}); |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
return Scaffold( |
|
|
|
@ -373,6 +406,161 @@ class _GuidePage extends State<GuidePage> {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showAlertDialog() { |
|
|
|
|
//显示对话框 |
|
|
|
|
showDialog( |
|
|
|
|
context: context, |
|
|
|
|
builder: (BuildContext context) { |
|
|
|
|
return SimpleDialog( |
|
|
|
|
titlePadding: EdgeInsets.all(10), |
|
|
|
|
backgroundColor: Colors.transparent, |
|
|
|
|
elevation: 0, |
|
|
|
|
shape: RoundedRectangleBorder( |
|
|
|
|
borderRadius: BorderRadius.circular(6), |
|
|
|
|
), |
|
|
|
|
children: <Widget>[ |
|
|
|
|
Stack( |
|
|
|
|
alignment: Alignment.bottomCenter, |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
width: double.infinity, |
|
|
|
|
height: 305.h, |
|
|
|
|
padding: EdgeInsets.only(left: 16.w, right: 16.w), |
|
|
|
|
decoration: new BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(top: 24.h, bottom: 10.h), |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).xieyitanchuang, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xff4D4D4D), |
|
|
|
|
fontSize: 18.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Text.rich( |
|
|
|
|
TextSpan(children: [ |
|
|
|
|
TextSpan( |
|
|
|
|
text: S.of(context).yinsizhengce1, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
height: 1.3.h, |
|
|
|
|
color: Color(0xff727272), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
TextSpan( |
|
|
|
|
text: S.of(context).yinsixieyi, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
color: Color(0xff32A060)), |
|
|
|
|
recognizer: TapGestureRecognizer() |
|
|
|
|
..onTap = () { |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.popAndPushNamed('/router/treaty_page'); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
]), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 10.h, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
S.of(context).yinsizhengce2, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xff727272), |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
height: 1.3.h, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 16.h, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
|
children: [ |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
// exit(0); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
height: 40.h, |
|
|
|
|
alignment: Alignment.bottomCenter, |
|
|
|
|
margin: EdgeInsets.only(bottom: 20.h), |
|
|
|
|
child: BorderText( |
|
|
|
|
padding: EdgeInsets.only( |
|
|
|
|
top: 10.h, |
|
|
|
|
bottom: 10.h, |
|
|
|
|
left: 36.w, |
|
|
|
|
right: 36.w, |
|
|
|
|
), |
|
|
|
|
text: S.of(context).jujue, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
textColor: Color(0xFF32A060), |
|
|
|
|
borderColor: Color(0xFF32A060), |
|
|
|
|
borderWidth: 1.w, |
|
|
|
|
radius: 23, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 21.w, |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
height: 40.h, |
|
|
|
|
margin: EdgeInsets.only(bottom: 20.h), |
|
|
|
|
alignment: Alignment.bottomCenter, |
|
|
|
|
child: RoundButton( |
|
|
|
|
text: S.of(context).tongyibingjixu, |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
callback: () { |
|
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
|
value.setBool("isShowPrivacyPolicy", true); |
|
|
|
|
}); |
|
|
|
|
SharesdkPlugin.uploadPrivacyPermissionStatus( |
|
|
|
|
1, |
|
|
|
|
(success) => { |
|
|
|
|
Navigator.of(context).pop(), |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
padding: EdgeInsets.only( |
|
|
|
|
top: 10.h, |
|
|
|
|
bottom: 10.h, |
|
|
|
|
left: 21.5.w, |
|
|
|
|
right: 21.5.w, |
|
|
|
|
), |
|
|
|
|
backgroup: Color(0xff32A060), |
|
|
|
|
radius: 23, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
toNext() { |
|
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
|
value.setBool("isFirst", false); |
|
|
|
|