refresh on pulling down
This commit is contained in:
parent
29f2f296e4
commit
c77e44bc96
@ -18,7 +18,7 @@ class WorkoutsViewState extends State<WorkoutsView>{
|
|||||||
|
|
||||||
Future<List> getWorkouts() async {
|
Future<List> getWorkouts() async {
|
||||||
var response = await http.get(
|
var response = await http.get(
|
||||||
"http://10.16.17.65/api/index.php?token=satbwertwhbertnwertwertghwertgwertg",
|
"http://10.16.17.18/api/index.php?token=satbwertwhbertnwertwertghwertgwertg",
|
||||||
headers: {
|
headers: {
|
||||||
"Accept": "application/json"
|
"Accept": "application/json"
|
||||||
}
|
}
|
||||||
@ -39,7 +39,8 @@ class WorkoutsViewState extends State<WorkoutsView>{
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// TODO: implement build
|
// TODO: implement build
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: ListView.builder(
|
body: RefreshIndicator(
|
||||||
|
child: ListView.builder(
|
||||||
itemCount: data == null ? 0 : data.length,
|
itemCount: data == null ? 0 : data.length,
|
||||||
itemBuilder: (BuildContext context, int index){
|
itemBuilder: (BuildContext context, int index){
|
||||||
return new ListTile(
|
return new ListTile(
|
||||||
@ -54,6 +55,8 @@ class WorkoutsViewState extends State<WorkoutsView>{
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
onRefresh: getWorkouts,
|
||||||
|
),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
onPressed: (){
|
onPressed: (){
|
||||||
Navigator.push(context, MaterialPageRoute(
|
Navigator.push(context, MaterialPageRoute(
|
||||||
|
Loading…
Reference in New Issue
Block a user