Browse Source

update scroll behavior action list

master
daivph 5 years ago
parent
commit
dd4a6c7b5f
1 changed files with 35 additions and 35 deletions
  1. +35
    -35
      lib/presentation/screens/plot_detail/sc_plot_action.dart

+ 35
- 35
lib/presentation/screens/plot_detail/sc_plot_action.dart View File

headerSliverBuilder: (context, innerBoxScrolled) => [ headerSliverBuilder: (context, innerBoxScrolled) => [
SliverAppBar( SliverAppBar(
floating: false, floating: false,
pinned: true,
pinned: false,
backgroundColor: Colors.white, backgroundColor: Colors.white,
leading: Container(), leading: Container(),
title: _showTitle(context) ? Text(plot_detail_title) : null,
title: null,
// title: _showTitle(context) ? Text(plot_detail_title) : null,
//Height flexibleSpace : WidthScreen /2 * 6/16 * 6(row) + 8(space) *4 //Height flexibleSpace : WidthScreen /2 * 6/16 * 6(row) + 8(space) *4
expandedHeight: MediaQuery.of(context).size.width * 1.125 + 32, expandedHeight: MediaQuery.of(context).size.width * 1.125 + 32,
flexibleSpace: _showTitle(context) flexibleSpace: _showTitle(context)
).toList()), ).toList()),
), ),
), ),
SliverList(
delegate: SliverChildListDelegate([
_showTitle(context)
? Container(
height: 40,
)
: Container(
height: 40,
alignment: Alignment.center,
decoration: BoxDecoration(
color: COLOR_CONST.WHITE_50,
border: Border(
top: BorderSide(width: 0.5, color: COLOR_CONST.DEFAULT),
bottom:
BorderSide(width: 0.5, color: COLOR_CONST.DEFAULT)),
),
child: Text(
plot_detail_title,
style:
TextStyle(fontSize: 20, fontWeight: FontWeight.normal),
))
]))
], ],
body: BlocProvider( body: BlocProvider(
create: (context) => PlotDetailBloc(repository: Repository()) create: (context) => PlotDetailBloc(repository: Repository())
return Center(child: Text(label_list_empty)); return Center(child: Text(label_list_empty));
} }
return RefreshIndicator( return RefreshIndicator(
child: ListView.builder(
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (BuildContext context, int index) {
return index >= state.items.length
? BottomLoader()
: ItemInfinityWidget(item: state.items[index]);
},
itemCount: state.hasReachedMax
? state.items.length
: state.items.length + 1,
controller: _scrollController,
child: Column(
children: [
Container(
height: 40,
alignment: Alignment.center,
decoration: BoxDecoration(
color: COLOR_CONST.WHITE_50,
border: Border(
top: BorderSide(
width: 0.5, color: COLOR_CONST.DEFAULT),
bottom: BorderSide(
width: 0.5, color: COLOR_CONST.DEFAULT)),
),
child: Text(
plot_detail_title,
style: TextStyle(
fontSize: 20, fontWeight: FontWeight.normal),
)),
Expanded(
child: ListView.builder(
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (BuildContext context, int index) {
return index >= state.items.length
? BottomLoader()
: ItemInfinityWidget(item: state.items[index]);
},
itemCount: state.hasReachedMax
? state.items.length
: state.items.length + 1,
controller: _scrollController,
))
],
), ),
onRefresh: () async { onRefresh: () async {
_plotDetailBloc.add(OnRefresh( _plotDetailBloc.add(OnRefresh(

Loading…
Cancel
Save