Browse Source

update layout plot action list

master
daivph 5 years ago
parent
commit
80e2225f23
2 changed files with 65 additions and 58 deletions
  1. +1
    -1
      ios/Flutter/.last_build_id
  2. +64
    -57
      lib/presentation/screens/plot_detail/sc_plot_action.dart

+ 1
- 1
ios/Flutter/.last_build_id View File

5729eb498eaeb9c64784fcfc80bbb33b
dab672e712362fdbbfa98386624f95d6

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

return Center(child: Text(label_list_empty)); return Center(child: Text(label_list_empty));
} }
List<Activities> currentItems = List<Activities>.from(state.items); List<Activities> currentItems = List<Activities>.from(state.items);
return RefreshIndicator(
child: Column(
children: [
Container(
height: 40,
return Scaffold(
resizeToAvoidBottomInset: false,
body: RefreshIndicator(
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Container(
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: COLOR_CONST.WHITE_50, color: COLOR_CONST.WHITE_50,
bottom: BorderSide( bottom: BorderSide(
width: 0.5, color: COLOR_CONST.DEFAULT)), width: 0.5, color: COLOR_CONST.DEFAULT)),
), ),
child: Row(
children: [
Expanded(
child: Text(
plot_detail_title,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20, fontWeight: FontWeight.normal),
)),
IconButton(
icon: (widget.parentScroll.position.pixels <
heightOfActionButton)
? Icon(Icons.arrow_upward)
: Icon(Icons.arrow_downward),
onPressed: () {
if (widget.parentScroll.position.pixels <
heightOfActionButton) {
widget.parentScroll.animateTo(
heightOfActionButton,
duration: Duration(milliseconds: 500),
curve: Curves.easeOut);
} else {
widget.parentScroll.animateTo(0.0,
duration: Duration(milliseconds: 500),
curve: Curves.easeOut);
}
})
],
)),
Expanded(
child: ListView.builder(
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (BuildContext context, int index) {
return index >= state.items.length
? BottomLoader()
: ItemInfinityWidget(
currentItems: currentItems,
item: state.items[index],
currentPage: state.page,
currentReachedMax: state.hasReachedMax);
},
itemCount: state.hasReachedMax
? state.items.length
: state.items.length + 1,
controller: _scrollController,
))
],
),
onRefresh: () async {
widget.plotDetailBloc.add(OnRefresh(
cropId: widget.cropId, cropCode: widget.cropCode));
});
child: Container(
height: 40,
child: Row(
children: [
Expanded(
child: Text(
plot_detail_title,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20, fontWeight: FontWeight.normal),
)),
GestureDetector(
child: (widget.parentScroll.position.pixels <
heightOfActionButton)
? Icon(Icons.arrow_upward)
: Icon(Icons.arrow_downward_outlined),
onTap: () {
if (widget.parentScroll.position.pixels <
heightOfActionButton) {
widget.parentScroll.animateTo(
heightOfActionButton,
duration: Duration(milliseconds: 500),
curve: Curves.easeOut);
} else {
widget.parentScroll.animateTo(0.0,
duration: Duration(milliseconds: 500),
curve: Curves.easeOut);
}
}),
],
),
),
),
Expanded(
child: ListView.builder(
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (BuildContext context, int index) {
return index >= state.items.length
? BottomLoader()
: ItemInfinityWidget(
currentItems: currentItems,
item: state.items[index],
currentPage: state.page,
currentReachedMax: state.hasReachedMax);
},
itemCount: state.hasReachedMax
? state.items.length
: state.items.length + 1,
controller: _scrollController,
))
],
),
onRefresh: () async {
widget.plotDetailBloc.add(OnRefresh(
cropId: widget.cropId, cropCode: widget.cropCode));
}),
);
} }
return Center( return Center(
child: LoadingListPage(), child: LoadingListPage(),

Loading…
Cancel
Save