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
aceea30b
Commit
aceea30b
authored
Jun 30, 2020
by
杜欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二级方案
parent
bb8430c3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
94 additions
and
0 deletions
+94
-0
LevelTwoPage.dart
lib/ClueModel/page/levelTwo/LevelTwoPage.dart
+94
-0
No files found.
lib/ClueModel/page/levelTwo/LevelTwoPage.dart
0 → 100644
View file @
aceea30b
/*
* @author dx
* @date 2020-06-29
**/
import
'package:flutter/material.dart'
;
import
'package:gm_flutter/commonModel/base/BaseState.dart'
;
class
LevelTwoPage
extends
StatefulWidget
{
final
String
title
;
LevelTwoPage
({
Key
key
,
this
.
title
})
:
super
(
key:
key
);
@override
_LevelTwoPageState
createState
()
=>
_LevelTwoPageState
();
}
class
_LevelTwoPageState
extends
BaseState
<
LevelTwoPage
>
with
SingleTickerProviderStateMixin
{
TabController
tabController
;
@override
void
initState
()
{
super
.
initState
();
this
.
tabController
=
TabController
(
length:
2
,
vsync:
this
);
}
@override
Widget
buildItem
(
BuildContext
context
)
{
return
Scaffold
(
body:
CustomScrollView
(
slivers:
<
Widget
>[
SliverAppBar
(
pinned:
true
,
elevation:
0
,
expandedHeight:
250
,
flexibleSpace:
FlexibleSpaceBar
(
title:
Text
(
this
.
widget
.
title
),
background:
Image
.
network
(
'http://img1.mukewang.com/5c18cf540001ac8206000338.jpg'
,
fit:
BoxFit
.
cover
,
),
),
),
SliverPersistentHeader
(
pinned:
true
,
delegate:
StickyTabBarDelegate
(
child:
TabBar
(
labelColor:
Colors
.
black
,
controller:
this
.
tabController
,
tabs:
<
Widget
>[
Tab
(
text:
'Home'
),
Tab
(
text:
'Profile'
),
],
),
),
),
SliverFillRemaining
(
child:
TabBarView
(
controller:
this
.
tabController
,
children:
<
Widget
>[
Center
(
child:
Text
(
'Content of Home'
)),
Center
(
child:
Text
(
'Content of Profile'
)),
],
),
),
],
),
);
}
}
class
StickyTabBarDelegate
extends
SliverPersistentHeaderDelegate
{
final
TabBar
child
;
StickyTabBarDelegate
({
@required
this
.
child
});
@override
Widget
build
(
BuildContext
context
,
double
shrinkOffset
,
bool
overlapsContent
)
{
return
this
.
child
;
}
@override
double
get
maxExtent
=>
this
.
child
.
preferredSize
.
height
;
@override
double
get
minExtent
=>
this
.
child
.
preferredSize
.
height
;
@override
bool
shouldRebuild
(
SliverPersistentHeaderDelegate
oldDelegate
)
{
return
true
;
}
}
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