list traction and add leaderboard panel
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:dynamic_color/dynamic_color.dart';
|
||||
import 'package:mileograph_flutter/components/pages/traction.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:mileograph_flutter/components/pages/legs.dart';
|
||||
@@ -125,7 +126,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
Dashboard(),
|
||||
Center(child: Text("Calculator Page")),
|
||||
LegsPage(),
|
||||
Center(child: Text("Traction Page")),
|
||||
TractionPage(),
|
||||
Center(child: Text("Trips Page")),
|
||||
];
|
||||
|
||||
@@ -148,6 +149,9 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
if (data.legs.isEmpty) {
|
||||
data.fetchLegs();
|
||||
}
|
||||
if (data.traction.isEmpty) {
|
||||
data.fetchHadTraction();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -162,12 +166,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
if (data.homepageStats != null) {
|
||||
currentPage = contentPages[pageIndex];
|
||||
} else {
|
||||
currentPage = Center(
|
||||
child: FilledButton(
|
||||
onPressed: data.fetchHomepageStats,
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
currentPage = Center(child: CircularProgressIndicator());
|
||||
}
|
||||
// This method is rerun every time setState is called, for instance as done
|
||||
// by the _incrementCounter method above.
|
||||
|
||||
Reference in New Issue
Block a user