diff options
| author | Mica White <botahamec@outlook.com> | 2026-01-14 20:36:39 -0500 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2026-01-14 20:36:39 -0500 |
| commit | ac5dcc8859aebfd2f36d4b6ac58f1bd2f82f4666 (patch) | |
| tree | 8aff0c4d778024ad08570bde18b299ce4a9fc4f2 /lib/home.dart | |
| parent | 359d8e07ef5cb585fff13031d075d7c949135317 (diff) | |
Code cleanup
Diffstat (limited to 'lib/home.dart')
| -rw-r--r-- | lib/home.dart | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/home.dart b/lib/home.dart index f141d0b..fd2e278 100644 --- a/lib/home.dart +++ b/lib/home.dart @@ -30,6 +30,8 @@ class HomePage extends StatefulWidget { class _HomePageState extends State<HomePage> { StreamSubscription<Position>? _positionStream; + // I was not able to get StreamBuilder or FutureBuilder to work correctly, + // so these are stored manually. bool _usesMetric = true; double _speed = 0.0; double _speedAccuracy = 0.0; @@ -72,6 +74,7 @@ class _HomePageState extends State<HomePage> { _initPositionStream(locationAccuracy); }); + // It takes time to load this data in, but I've only noticed it in debug mode RegionSettings.getUsesMetricSystem().then( (usesMetricSystem) => setState(() => _usesMetric = usesMetricSystem), ); @@ -88,6 +91,8 @@ class _HomePageState extends State<HomePage> { return Scaffold( appBar: AppBar( actions: [ + // This button is big enough and descriptive enough to be easily + // discoverable, but small enough to not get in the way. TextButton.icon( icon: Icon(Icons.settings), label: Text('Settings'), @@ -106,6 +111,7 @@ class _HomePageState extends State<HomePage> { (_usesMetric ? SpeedUnit.kilometersPerHour : SpeedUnit.milesPerHour); + return Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, |
