diff --git a/lib/Views/workouts_view.dart b/lib/Views/workouts_view.dart index b83d94e..b38d11e 100644 --- a/lib/Views/workouts_view.dart +++ b/lib/Views/workouts_view.dart @@ -18,7 +18,7 @@ class WorkoutsViewState extends State{ Future getWorkouts() async { 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: { "Accept": "application/json" } @@ -39,20 +39,23 @@ class WorkoutsViewState extends State{ Widget build(BuildContext context) { // TODO: implement build return Scaffold( - body: ListView.builder( - itemCount: data == null ? 0 : data.length, - itemBuilder: (BuildContext context, int index){ - return new ListTile( - leading: Icon(Icons.add), - title: Text(data[index]['title']), - subtitle: Text(data[index]['creator']), - onTap: (){ - Navigator.push(context, MaterialPageRoute( - builder: (context) => ExerciseView(data[index]['title'], data[index]['id']) - )); - }, - ); - }, + body: RefreshIndicator( + child: ListView.builder( + itemCount: data == null ? 0 : data.length, + itemBuilder: (BuildContext context, int index){ + return new ListTile( + leading: Icon(Icons.add), + title: Text(data[index]['title']), + subtitle: Text(data[index]['creator']), + onTap: (){ + Navigator.push(context, MaterialPageRoute( + builder: (context) => ExerciseView(data[index]['title'], data[index]['id']) + )); + }, + ); + }, + ), + onRefresh: getWorkouts, ), floatingActionButton: FloatingActionButton( onPressed: (){