123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import 'package:flutter/material.dart';
- import 'package:flutter_chinese_chees/routes.dart';
- /// Description: 闪屏页
- /// Time : 04/28/2023 Friday
- /// Author : liuyuqi.gov@msn.cn
- class SplashPage extends StatefulWidget {
- const SplashPage({super.key});
- @override
- State<SplashPage> createState() => _SplashPageState();
- }
- class _SplashPageState extends State<SplashPage> {
- bool isAd = false; // 是否显示广告
- Widget showAd(bool isAd) {
- if (isAd) {
- return const Text("广告");
- } else {
- return const Text("无广告");
- }
- }
- // after 3s go to main page
- void goMain() {
- Future.delayed(const Duration(seconds: 3), () {
- Navigator.pushNamed(context, Routes.home);
- });
- }
- @override
- Widget build(BuildContext context) {
- goMain();
- return const Scaffold(
- body: SafeArea(
- child: Center(
- child: Text("splash page"),
- ),
- ));
- }
- }
|