admin
2022-03-31 02f1c9fd2c594323f772f8e8f0f2187a285c1749
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
 
class SplashPage extends StatefulWidget {
  SplashPage({Key? key, required this.title}) : super(key: key);
 
  final String title;
 
  @override
  _SplashPageState createState() => _SplashPageState();
}
 
class _SplashPageState extends State<SplashPage>
    with SingleTickerProviderStateMixin {
  int index = 1;
 
  @override
  void initState() {
    super.initState();
  }
 
  @override
  Widget build(BuildContext context) {
    return MaterialApp(home: WillPopScope(
        onWillPop: () async {
          return false;
        },
        child: Scaffold(
            backgroundColor: Colors.red,
            body: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Text("$index"),
                InkWell(
                  onTap: () {
                    setState(() {
                      index += 1;
                    });
                  },
                  child: const Text("点击事件"),
                )
              ],
            ))));
  }
}