Rafraichissement automatique page ship

This commit is contained in:
Gabriel
2023-06-05 12:39:41 +02:00
parent 314874a142
commit 4a53decc74
3 changed files with 71 additions and 15 deletions

View File

@@ -14,8 +14,8 @@ class _HomePageState extends State<HomePage> {
final agent = AgentProvider();
ShipProvider shipProvider = ShipProvider();
Future<List<ShipModel>> getShips() async {
List<ShipModel> ships = await shipProvider.getShips();
Future<List<ShipModel>> listShips() async {
List<ShipModel> ships = await shipProvider.listShips();
return ships;
}
@@ -67,7 +67,7 @@ class _HomePageState extends State<HomePage> {
Card(
color: Colors.white,
child: FutureBuilder<List<ShipModel>>(
future: getShips(),
future: listShips(),
builder: (BuildContext context, AsyncSnapshot<List<ShipModel>> snapshot) {
if (snapshot.hasData) {
List<ShipModel> ships = snapshot.data!;