|
@@ -1,29 +1,79 @@
|
1
|
1
|
import 'package:flutter/material.dart';
|
2
|
2
|
import 'package:get/get.dart';
|
|
3
|
+import 'package:flutter_screenutil/flutter_screenutil.dart';
|
3
|
4
|
|
4
|
|
-class Home extends StatelessWidget {
|
|
5
|
+class Home extends StatefulWidget {
|
|
6
|
+ const Home({Key? key}) : super(key: key);
|
|
7
|
+
|
|
8
|
+ @override
|
|
9
|
+ _Home createState() => _Home();
|
|
10
|
+}
|
|
11
|
+class _Home extends State<Home> {
|
|
12
|
+
|
|
13
|
+ List images = [
|
|
14
|
+ ['images/index/index.png', 'images/index/indexActive.png'],
|
|
15
|
+ ['images/index/job.png', 'images/index/jobActive.png'],
|
|
16
|
+ ['images/index/user.png', 'images/index/userActive.png'],
|
|
17
|
+ ];
|
|
18
|
+
|
|
19
|
+ final List _titles = ['首页', '好物', '双11'];
|
|
20
|
+ int _currentIndex = 0;
|
5
|
21
|
@override
|
6
|
22
|
Widget build(BuildContext context) {
|
7
|
|
- // controller.person
|
8
|
23
|
return Scaffold(
|
9
|
24
|
appBar: AppBar(
|
10
|
|
- title: Text('首页'),
|
11
|
|
- ),
|
12
|
|
- body: GestureDetector(
|
13
|
|
- onTap: () {
|
14
|
|
- Get.snackbar(
|
15
|
|
- "Hey i'm a Get SnackBar!", // title
|
16
|
|
- "It's unbelievable! I'm using SnackBar without context, without boilerplate, without Scaffold, it is something truly amazing!", // message
|
17
|
|
- icon: Icon(Icons.alarm),
|
18
|
|
- shouldIconPulse: true,
|
19
|
|
- barBlur: 20,
|
20
|
|
- isDismissible: true,
|
21
|
|
- duration: Duration(seconds: 3),
|
22
|
|
- );
|
23
|
|
- // Get.snackbar('Hi', 'i am a modern snackbar');
|
24
|
|
- },
|
25
|
|
- child: const Text("首页内容"),
|
|
25
|
+ elevation: 0,
|
|
26
|
+ centerTitle: true,
|
|
27
|
+ backgroundColor: Colors.white,
|
|
28
|
+ title: Text(
|
|
29
|
+ '首页',
|
|
30
|
+ style:
|
|
31
|
+ TextStyle(color: Colors.black, fontSize: 17.sp, letterSpacing: 2),
|
|
32
|
+ ),
|
26
|
33
|
),
|
|
34
|
+
|
27
|
35
|
);
|
28
|
36
|
}
|
29
|
|
-}
|
|
37
|
+ }
|
|
38
|
+// class Home extends StatelessWidget {
|
|
39
|
+// @override
|
|
40
|
+// Widget build(BuildContext context) {
|
|
41
|
+// // controller.person
|
|
42
|
+// return Scaffold(
|
|
43
|
+// appBar: AppBar(
|
|
44
|
+// elevation: 0,
|
|
45
|
+// centerTitle: true,
|
|
46
|
+// backgroundColor: Colors.white,
|
|
47
|
+// title: Text(
|
|
48
|
+// '首页',
|
|
49
|
+// style:
|
|
50
|
+// TextStyle(color: Colors.black, fontSize: 17.sp, letterSpacing: 2),
|
|
51
|
+// ),
|
|
52
|
+// ),
|
|
53
|
+// body: GestureDetector(
|
|
54
|
+// onTap: () {
|
|
55
|
+// Get.snackbar(
|
|
56
|
+// "Hey i'm a Get SnackBar!", // title
|
|
57
|
+// "It's unbelievable! I'm using SnackBar without context, without boilerplate, without Scaffold, it is something truly amazing!", // message
|
|
58
|
+// icon: Icon(Icons.alarm),
|
|
59
|
+// shouldIconPulse: true,
|
|
60
|
+// barBlur: 20,
|
|
61
|
+// isDismissible: true,
|
|
62
|
+// duration: Duration(seconds: 3),
|
|
63
|
+// );
|
|
64
|
+// // Get.snackbar('Hi', 'i am a modern snackbar');
|
|
65
|
+// },
|
|
66
|
+// child: const Text("首页内容"),
|
|
67
|
+// ),
|
|
68
|
+// bottomNavigationBar: BottomNavigationBar(
|
|
69
|
+// items: const <BottomNavigationBarItem>[
|
|
70
|
+// BottomNavigationBarItem(title: Text('首页'),icon: Icon(Icons.home)),
|
|
71
|
+// BottomNavigationBarItem(title: Text('书籍'),icon: Icon(Icons.book)),
|
|
72
|
+// BottomNavigationBarItem(title: Text('我的'),icon: Icon(Icons.perm_identity)),
|
|
73
|
+// ],
|
|
74
|
+// ),
|
|
75
|
+// );
|
|
76
|
+// }
|
|
77
|
+// }
|
|
78
|
+
|
|
79
|
+
|