app-starlock/lib/talk/starChart/views/guide/permission_guidance_page.dart

110 lines
3.2 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/tools/titleAppBar.dart';
class PermissionGuidancePage extends StatefulWidget {
const PermissionGuidancePage({Key? key}) : super(key: key);
@override
State<PermissionGuidancePage> createState() => _PermissionGuidancePageState();
}
class _PermissionGuidancePageState extends State<PermissionGuidancePage> {
final PageController _pageController = PageController();
int _currentPage = 0;
final List<Map<String, String>> _stepsData = [
{
'image': 'images/guide/1.png',
'text': '步骤1打开应用信息点击通知管理选项',
},
{
'image': 'images/guide/2.png',
'text': '步骤2下滑点击呼叫提醒的通知选项',
},
{
'image': 'images/guide/3.png',
'text': '步骤3选择在锁定屏幕上的选项设置',
},
{
'image': 'images/guide/4.png',
'text': '步骤4设置为显示通知及其内容',
},
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: TitleAppBar(
barTitle: '锁屏通知开启方式'.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
backAction: () {
Get.back();
},
),
body: Column(
children: [
Expanded(
child: PageView.builder(
controller: _pageController,
onPageChanged: (index) {
setState(() {
_currentPage = index;
});
},
itemCount: _stepsData.length,
itemBuilder: (context, index) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
_stepsData[index]['image']!,
width: 1.sw,
height: 0.55.sh,
fit: BoxFit.contain,
),
SizedBox(height: 32.h),
Text(
_stepsData[index]['text']!,
style: TextStyle(fontSize: 28.sp),
textAlign: TextAlign.center,
),
],
);
},
),
),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: List.generate(_stepsData.length, (index) {
return Container(
margin: EdgeInsets.symmetric(horizontal: 4),
width: 10,
height: 10,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _currentPage == index
? AppColors.mainColor
: Colors.grey[300],
),
);
}),
),
SizedBox(height: 24),
],
),
);
}
@override
void dispose() {
_pageController.dispose();
super.dispose();
}
}