Browse Source

Fix refreshing view station

master
Kenneth Bruen 2 years ago
parent
commit
8ddac141d7
Signed by: kbruen
GPG Key ID: C1980A470C3EE5B1
  1. 15
      lib/pages/station_arrdep_page/view_station/view_station.dart

15
lib/pages/station_arrdep_page/view_station/view_station.dart

@ -1,14 +1,12 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:info_tren/api/station_data.dart';
import 'package:info_tren/components/refresh_future_builder.dart';
import 'package:info_tren/models.dart';
import 'package:info_tren/pages/station_arrdep_page/view_station/view_station_cupertino.dart';
import 'package:info_tren/pages/station_arrdep_page/view_station/view_station_material.dart';
import 'package:info_tren/pages/train_info_page/view_train/train_info.dart';
import 'package:info_tren/providers.dart';
import 'package:info_tren/utils/default_ui_design.dart';
class ViewStationPage extends HookConsumerWidget {
const ViewStationPage({ super.key, });
@ -78,9 +76,16 @@ abstract class ViewStationPageShared extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RefreshFutureBuilderProviderAdapter(
futureProvider: viewStationDataProvider,
builder: buildContent,
return Consumer(
builder: (context, ref, _) {
return RefreshFutureBuilderProviderAdapter(
futureProvider: viewStationDataProvider,
refresh: () async {
ref.invalidate(stationDataProvider);
},
builder: buildContent,
);
}
);
}
}

Loading…
Cancel
Save