Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm_flutter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林生雨
gm_flutter
Commits
625289d1
Commit
625289d1
authored
Jun 30, 2020
by
杜欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二级方案
parent
d18aa2b8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
29 deletions
+35
-29
ClueRouter.dart
lib/ClueModel/ClueRouter.dart
+5
-5
ClueRouterImpl.dart
lib/ClueModel/ClueRouterImpl.dart
+5
-0
LevelTwoPage.dart
lib/ClueModel/page/levelTwo/LevelTwoPage.dart
+15
-16
main.dart
lib/main.dart
+10
-8
No files found.
lib/ClueModel/ClueRouter.dart
View file @
625289d1
...
@@ -8,8 +8,9 @@ import 'package:flutter_common/Annotations/anno/Router.dart';
...
@@ -8,8 +8,9 @@ import 'package:flutter_common/Annotations/anno/Router.dart';
import
'package:flutter_common/Annotations/anno/RouterCenter.dart'
;
import
'package:flutter_common/Annotations/anno/RouterCenter.dart'
;
import
'package:gm_flutter/ClueModel/ClueRouterImpl.dart'
;
import
'package:gm_flutter/ClueModel/ClueRouterImpl.dart'
;
@Router
(
"ClueRouter"
,
ClueRouterImpl
,
true
)
@Router
(
"ClueRouter"
,
ClueRouterImpl
,
true
)
abstract
class
ClueRouter
implements
RouterBaser
{
abstract
class
ClueRouter
implements
RouterBaser
{
Widget
getLevelOnePage
();
Widget
getLevelOnePage
();
}
\ No newline at end of file
Widget
getLevelTwoPage
();
}
lib/ClueModel/ClueRouterImpl.dart
View file @
625289d1
...
@@ -5,10 +5,15 @@
...
@@ -5,10 +5,15 @@
import
'package:flutter/src/widgets/framework.dart'
;
import
'package:flutter/src/widgets/framework.dart'
;
import
'package:gm_flutter/ClueModel/ClueRouter.dart'
;
import
'package:gm_flutter/ClueModel/ClueRouter.dart'
;
import
'package:gm_flutter/ClueModel/page/levelOne/LevelOnePage.dart'
;
import
'package:gm_flutter/ClueModel/page/levelOne/LevelOnePage.dart'
;
import
'package:gm_flutter/ClueModel/page/levelTwo/LevelTwoPage.dart'
;
class
ClueRouterImpl
implements
ClueRouter
{
class
ClueRouterImpl
implements
ClueRouter
{
@override
@override
Widget
getLevelOnePage
()
{
Widget
getLevelOnePage
()
{
return
LevelOnePage
();
return
LevelOnePage
();
}
}
Widget
getLevelTwoPage
()
{
return
LevelTwoPage
();
}
}
}
lib/ClueModel/page/levelTwo/LevelTwoPage.dart
View file @
625289d1
...
@@ -7,10 +7,6 @@ import 'package:flutter/material.dart';
...
@@ -7,10 +7,6 @@ import 'package:flutter/material.dart';
import
'package:gm_flutter/commonModel/base/BaseState.dart'
;
import
'package:gm_flutter/commonModel/base/BaseState.dart'
;
class
LevelTwoPage
extends
StatefulWidget
{
class
LevelTwoPage
extends
StatefulWidget
{
final
String
title
;
LevelTwoPage
({
Key
key
,
this
.
title
})
:
super
(
key:
key
);
@override
@override
_LevelTwoPageState
createState
()
=>
_LevelTwoPageState
();
_LevelTwoPageState
createState
()
=>
_LevelTwoPageState
();
}
}
...
@@ -34,23 +30,26 @@ class _LevelTwoPageState extends BaseState<LevelTwoPage>
...
@@ -34,23 +30,26 @@ class _LevelTwoPageState extends BaseState<LevelTwoPage>
pinned:
true
,
pinned:
true
,
elevation:
0
,
elevation:
0
,
expandedHeight:
250
,
expandedHeight:
250
,
flexibleSpace:
FlexibleSpaceBar
(
flexibleSpace:
FlexibleSpaceBar
(
title:
Text
(
'二级方案'
)),
title:
Text
(
this
.
widget
.
title
),
background:
Image
.
network
(
'http://img1.mukewang.com/5c18cf540001ac8206000338.jpg'
,
fit:
BoxFit
.
cover
,
),
),
),
),
SliverPersistentHeader
(
SliverPersistentHeader
(
pinned:
true
,
pinned:
true
,
delegate:
StickyTabBarDelegate
(
delegate:
StickyTabBarDelegate
(
child:
TabBar
(
child:
TabBar
(
labelColor:
Colors
.
black
,
labelColor:
Color
(
0xff282828
),
labelStyle:
TextStyle
(
fontSize:
15.0
,
fontWeight:
FontWeight
.
bold
),
labelPadding:
EdgeInsets
.
only
(
top:
15.0
),
unselectedLabelColor:
Color
(
0xffB5B5B5
),
unselectedLabelStyle:
TextStyle
(
fontSize:
15.0
),
indicatorColor:
Color
(
0xff4ABAB4
),
indicatorWeight:
3.0
,
indicatorSize:
TabBarIndicatorSize
.
label
,
indicatorPadding:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
),
controller:
this
.
tabController
,
controller:
this
.
tabController
,
tabs:
<
Widget
>[
tabs:
<
Widget
>[
Tab
(
text:
'
Home
'
),
Tab
(
text:
'
医院
'
),
Tab
(
text:
'
Profile
'
),
Tab
(
text:
'
医生
'
),
],
],
),
),
),
),
...
@@ -59,8 +58,8 @@ class _LevelTwoPageState extends BaseState<LevelTwoPage>
...
@@ -59,8 +58,8 @@ class _LevelTwoPageState extends BaseState<LevelTwoPage>
child:
TabBarView
(
child:
TabBarView
(
controller:
this
.
tabController
,
controller:
this
.
tabController
,
children:
<
Widget
>[
children:
<
Widget
>[
Center
(
child:
Text
(
'
Content of Home
'
)),
Center
(
child:
Text
(
'
医院列表
'
)),
Center
(
child:
Text
(
'
Content of Profile
'
)),
Center
(
child:
Text
(
'
医生列表
'
)),
],
],
),
),
),
),
...
...
lib/main.dart
View file @
625289d1
...
@@ -58,8 +58,8 @@ class MyApp extends State<MyAppWidget> {
...
@@ -58,8 +58,8 @@ class MyApp extends State<MyAppWidget> {
return
DemoPage1
();
return
DemoPage1
();
},
},
});
});
FlutterBoost
.
singleton
.
addBoostContainerLifeCycleObserver
((
state
,
FlutterBoost
.
singleton
settings
)
{
.
addBoostContainerLifeCycleObserver
((
state
,
settings
)
{
print
(
"LSY
${state}
"
);
print
(
"LSY
${state}
"
);
});
});
// FlutterBoost.singleton.addBoostNavigatorObserver(TestBoostNavigatorObserver());
// FlutterBoost.singleton.addBoostNavigatorObserver(TestBoostNavigatorObserver());
...
@@ -71,12 +71,14 @@ class MyApp extends State<MyAppWidget> {
...
@@ -71,12 +71,14 @@ class MyApp extends State<MyAppWidget> {
return
MaterialApp
(
return
MaterialApp
(
theme:
ThemeData
(),
theme:
ThemeData
(),
builder:
FlutterBoost
.
init
(
postPush:
_onRoutePushed
),
builder:
FlutterBoost
.
init
(
postPush:
_onRoutePushed
),
home:
RouterCenterImpl
().
findClueRouter
().
getLevel
One
Page
());
home:
RouterCenterImpl
().
findClueRouter
().
getLevel
Two
Page
());
}
}
void
_onRoutePushed
(
String
pageName
,
void
_onRoutePushed
(
String
uniqueId
,
String
pageName
,
Map
<
String
,
dynamic
>
params
,
String
uniqueId
,
Route
<
dynamic
>
route
,
Map
<
String
,
dynamic
>
params
,
Future
<
dynamic
>
_
,)
{}
Route
<
dynamic
>
route
,
Future
<
dynamic
>
_
,
)
{}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment