1
1
import 'package:flutter/material.dart' ;
2
- import 'dart:io' show Platform;
3
-
4
2
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart' ;
5
3
6
4
import '../constants.dart' as CONSTANTS;
7
5
import '../utils.dart' as Utils;
8
6
7
+ import '../component/list.dart' ;
8
+ import '../component/logout.dart' ;
9
+
9
10
class HomePage extends StatefulWidget {
10
11
HomePage ({Key key, this .title}) : super (key: key);
11
12
@@ -19,23 +20,11 @@ class HomePage extends StatefulWidget {
19
20
20
21
class HomePageState extends State <HomePage > {
21
22
int _currentIndex = 0 ;
22
- var a = WebviewScaffold (
23
- url: "https://www.youku.com" ,
24
- hidden: true ,
25
- );
26
23
27
- var b = WebviewScaffold (
28
- url: "https://www.baidu.com" ,
29
- hidden: true ,
30
- );
31
24
@override
32
25
Widget build (BuildContext context) {
33
- String os = Platform .operatingSystem;
34
- String osString = '${os [0 ].toUpperCase ()}${os .substring (1 )}' ;
35
-
36
- final List <Widget > _children = [
37
- a,
38
- b,
26
+ var _children = [
27
+ ListComponent (),
39
28
WebviewScaffold (
40
29
url: CONSTANTS .TEST_URL ,
41
30
hidden: true ,
@@ -46,6 +35,7 @@ class HomePageState extends State<HomePage> {
46
35
hidden: true ,
47
36
withLocalStorage: true ,
48
37
),
38
+ LogoutComponent (),
49
39
];
50
40
return Scaffold (
51
41
appBar: new AppBar (
@@ -60,45 +50,6 @@ class HomePageState extends State<HomePage> {
60
50
backgroundColor: Colors .white,
61
51
),
62
52
body: _children[_currentIndex],
63
- /*
64
- new Container(
65
- padding: const EdgeInsets.all(20.0),
66
- child: Column(
67
- mainAxisAlignment: MainAxisAlignment.center,
68
- children: <Widget>[
69
- Text(
70
- '$osString Flutter Bootstrap',
71
- style: new TextStyle(
72
- fontSize: 20.0,
73
- color: Colors.black
74
- ),
75
- ),
76
- new Container(
77
- width: MediaQuery.of(context).size.width,
78
- margin: const EdgeInsets.only(top: 80.0),
79
- decoration: new BoxDecoration(
80
- color: Color(Utils.getColorHexFromStr(CONSTANTS.COLOR_1)),
81
- borderRadius: new BorderRadius.circular(4.0),
82
- ),
83
- child: FlatButton(
84
- child: Text(
85
- 'list',
86
- textAlign: TextAlign.center,
87
- style: new TextStyle(
88
- fontSize: 20.0,
89
- color: Color(Utils.getColorHexFromStr('#ffffff'))
90
- ),
91
- ),
92
- onPressed: () {
93
- Navigator.pushNamed(context, '/list');
94
- }
95
- )
96
- )
97
- ],
98
- ),
99
- ),
100
- */
101
-
102
53
bottomNavigationBar: BottomNavigationBar (
103
54
type: BottomNavigationBarType .fixed,
104
55
items: < BottomNavigationBarItem > [
0 commit comments