74 lines
2.4 KiB
Dart
74 lines
2.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:talk/network/NetworkConfig.dart';
|
|
|
|
class TeenageModePage extends StatefulWidget {
|
|
const TeenageModePage({super.key});
|
|
|
|
@override
|
|
State<TeenageModePage> createState() => _TeenageModePageState();
|
|
}
|
|
|
|
class _TeenageModePageState extends State<TeenageModePage> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final size = MediaQuery.of(context).size;
|
|
final t43 = size.width / 8.3720930232558;
|
|
final w98 = size.width / 3.6734693877551;
|
|
final w246 = size.width / 1.4634146341463;
|
|
final h45 = size.width / 8;
|
|
|
|
return Scaffold(
|
|
backgroundColor: const Color(0xFF121213),
|
|
appBar: AppBar(
|
|
backgroundColor: const Color(0xFF121213),
|
|
scrolledUnderElevation: 0.0,
|
|
title: const Text(
|
|
'青少年模式开启须知',
|
|
style: TextStyle(fontSize: 16, color: Colors.white),
|
|
),
|
|
centerTitle: true,
|
|
leading: IconButton(
|
|
iconSize: 18,
|
|
icon: const Icon(Icons.arrow_back_ios_sharp),
|
|
color: Colors.white,
|
|
onPressed: () {
|
|
// 处理返回操作
|
|
Navigator.pop(context);
|
|
},
|
|
),
|
|
),
|
|
body: Column(
|
|
children: [
|
|
Container(
|
|
margin: EdgeInsets.only(top: t43),
|
|
alignment: Alignment.center,
|
|
child: Image(width: w98, image: const AssetImage('assets/images/ic_teenage.png')),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top: t43),
|
|
alignment: Alignment.center,
|
|
child: Image(width: w246, image: const AssetImage('assets/images/teenage_explain.png')),
|
|
),
|
|
GestureDetector(
|
|
onTap: () {
|
|
if (NetworkConfig.isTeenage) {
|
|
Navigator.pushNamed(context, '/CloseTeenageModePage');
|
|
} else {
|
|
Navigator.pushNamed(context, '/TeenagePasswordPage');
|
|
}
|
|
},
|
|
child: Container(
|
|
width: double.infinity,
|
|
height: h45,
|
|
alignment: Alignment.center,
|
|
margin: const EdgeInsets.only(left: 16, right: 16, top: 60),
|
|
decoration: const BoxDecoration(color: Color(0xFFFF9000), borderRadius: BorderRadius.all(Radius.circular(10))),
|
|
child: Text(NetworkConfig.isTeenage ? "关闭青少年模式" : "开启青少年模式"),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|