|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:huixiang/generated/l10n.dart';
|
|
|
|
import 'package:huixiang/view_widget/border_text.dart';
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
|
|
class GuidePage extends StatefulWidget {
|
|
|
|
@override
|
|
|
|
State<StatefulWidget> createState() {
|
|
|
|
return _GuidePage();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class _GuidePage extends State<GuidePage> {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
body: PageView(
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
reverse: false,
|
|
|
|
controller: PageController(
|
|
|
|
initialPage: 0,
|
|
|
|
viewportFraction: 1,
|
|
|
|
keepPage: true,
|
|
|
|
),
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
pageSnapping: true,
|
|
|
|
onPageChanged: (index) {
|
|
|
|
//监听事件
|
|
|
|
print('index=====$index');
|
|
|
|
},
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Center(
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.only(top: 120.h, left: 19.w, right: 19.w),
|
|
|
|
child: Stack(
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Image.asset(
|
|
|
|
"assets/image/icon_guide_1.png",
|
|
|
|
// height: 307,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
height: 66.h,
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: 37.w, right: 37.w),
|
|
|
|
child: Text(
|
|
|
|
S.of(context).yindaoye1,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 24.sp,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Color(0XFF32A060)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
height: 23.h,
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: 19.w, right: 19.w),
|
|
|
|
child: Text(
|
|
|
|
S.of(context).yindao1,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.sp,
|
|
|
|
height: 1.5.h,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
color: Color(0XFF727272)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
"●",
|
|
|
|
style: TextStyle(fontSize: 8, color: Colors.black),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
width: 10.w,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
"●",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 8.sp, color: Color(0xffB2B2B2)),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
width: 10.w,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
"●",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 8.sp, color: Color(0xffB2B2B2)),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
height: 108.h,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Center(
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.only(top: 120.h, left: 19.w, right: 19.w),
|
|
|
|
child: Stack(
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Image.asset(
|
|
|
|
"assets/image/icon_guide_2.png",
|
|
|
|
// height: 307,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
height: 66.h,
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: 37.w, right: 37.w),
|
|
|
|
child: Text(
|
|
|
|
S.of(context).yindaoye2,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 24.sp,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Color(0XFF32A060)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
height: 23.h,
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: 19.w, right: 19.w),
|
|
|
|
child: Text(
|
|
|
|
S.of(context).yindao2,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.sp,
|
|
|
|
height: 1.5.h,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
color: Color(0XFF727272)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
"●",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 8.sp, color: Color(0xffB2B2B2)),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
width: 10.w,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
"●",
|
|
|
|
style:
|
|
|
|
TextStyle(fontSize: 8.sp, color: Colors.black),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
width: 10.w,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
"●",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 8, color: Color(0xffB2B2B2)),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
height: 108.h,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Center(
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.only(top: 120.h, left: 19.w, right: 19.w),
|
|
|
|
child: Stack(
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Image.asset(
|
|
|
|
"assets/image/icon_guide_3.png",
|
|
|
|
// height: 307,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
height: 66,
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: 37.w, right: 37.w),
|
|
|
|
child: Text(
|
|
|
|
S.of(context).yindaoye3,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 24.sp,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Color(0XFF32A060)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
height: 23,
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: 19.w, right: 19.w),
|
|
|
|
child: Text(
|
|
|
|
S.of(context).yindao3,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.sp,
|
|
|
|
height: 1.5.h,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
color: Color(0XFF727272)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
"●",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 8.sp, color: Color(0xffB2B2B2)),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
width: 10.w,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
"●",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 8.sp, color: Color(0xffB2B2B2)),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
width: 10.w,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
"●",
|
|
|
|
style:
|
|
|
|
TextStyle(fontSize: 8.sp, color: Colors.black),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
height: 108.h,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Center(
|
|
|
|
child: Container(
|
|
|
|
child: Stack(
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
"assets/image/icon_guide_4.png",
|
|
|
|
width: double.infinity,
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
height: 66.h,
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: 104.w, right: 104.w),
|
|
|
|
child: Text(
|
|
|
|
S.of(context).yindaoye4,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 24.sp,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Color(0XFF32A060)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
height: 23.h,
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: 52.w, right: 52.w),
|
|
|
|
child: Text(
|
|
|
|
S.of(context).yindao4,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.sp,
|
|
|
|
height: 1.5.h,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
color: Color(0XFF727272)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
child: GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
toNext();
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
height: 50.h,
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
left: 71.w, right: 71.w, bottom: 55.h),
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
child: BorderText(
|
|
|
|
padding: EdgeInsets.all(11),
|
|
|
|
text: S.of(context).lijitiyan,
|
|
|
|
fontSize: 20.sp,
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
textColor: Color(0xFF32A060),
|
|
|
|
borderColor: Color(0xFF32A060),
|
|
|
|
borderWidth: 1.w,
|
|
|
|
radius: 26.5,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
toNext() {
|
|
|
|
SharedPreferences.getInstance().then((value) {
|
|
|
|
value.setBool("isFirst", false);
|
|
|
|
String token = value.getString("token");
|
|
|
|
if (token == null || token == "") {
|
|
|
|
Navigator.of(context).popAndPushNamed('/router/login_page');
|
|
|
|
} else {
|
|
|
|
Navigator.of(context).popAndPushNamed('/router/main_page');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|