| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- import 'package:flutter/material.dart';
- import 'package:get/get.dart';
- import 'package:trackoffical_app/generated/assets.dart';
- import 'package:trackoffical_app/screen.dart';
- import 'package:trackoffical_app/service/app.dart';
- import 'package:trackoffical_app/service/mock.dart';
- import 'package:trackoffical_app/view/ingame/dialog/dialog_base.dart';
- import '../../../styles/theme.dart';
- import '../ingame/dialog/dialog_button.dart';
- class DialogSpecialWarn extends StatefulWidget {
- const DialogSpecialWarn({super.key});
- @override
- State<StatefulWidget> createState() {
- return DialogSpecialWarnState();
- }
- }
- class DialogSpecialWarnState extends State<DialogSpecialWarn> {
- @override
- Widget build(BuildContext context) {
- const title = '特别提醒';
- const titleColor = Color(0xFFce0000);
- return dialogTitle(
- title,
- titleColor,
- Column(children: [
- Card(
- color: Colors.white,
- surfaceTintColor: Colors.white,
-
- child: Padding(
- padding: EdgeInsets.all(5.86.wp),
- child: Column(
- children: [
- Text('未成年人需在家长陪护下参与', style: TextStyle(fontSize: 4.58.wp)),
- SizedBox(height: 7.89.wp),
- Image.asset(Assets.imagesIcSpecialWarn, height: 34.93.wp),
- ],
- )
- ) ,
- ),
- GestureDetector(
- onTap: () {
- setState(() {
- App.to.userProfile.isEnableHomeSpecialWarn.val =
- !App.to.userProfile.isEnableHomeSpecialWarn.val;
- });
- },
- child: Row(children: [
- Container(
- width: 10.36.wp,
- height: 10.36.wp,
- padding: EdgeInsets.all(2.0.wp),
- child: Stack(
- children: [
- Image.asset(Assets.imagesIcSelectRect),
- !App.to.userProfile.isEnableHomeSpecialWarn.val
- ? Image.asset(Assets.imagesIcSelectRectSelected)
- : const SizedBox()
- ],
- )),
- Text('下次不再提醒', style: TextStyle(fontSize: 3.58.wp),),
- ])),
- SizedBox(height: 4.0.wp),
- dialogButton('我已阅读', () {
- Get.back();
- })
- ]));
- }
- }
- Future<void> dialogHomeSpecialWarn() async{
- await Get.dialog(const DialogSpecialWarn(), barrierDismissible: true);
- return;
- }
- class _Empty extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- SizeFit.screenInit(context);
- return Scaffold(
- floatingActionButton: FloatingActionButton(onPressed: () {
- dialogHomeSpecialWarn();
- }),
- );
- }
- }
- void main() async {
- Mock.initServices();
- runApp(GetMaterialApp(theme: appThemeData(), home: _Empty()));
- }
|