Commit ab7ba6fd authored by Administrator's avatar Administrator

hopefully fixed the weird state message

parent 20dbeb2f
......@@ -20,7 +20,8 @@ class Athlete extends ChangeNotifier {
..stravaId = athlete.id
..stravaUsername = athlete.username
..photoPath = athlete.profile
..geoState = athlete.state;
..geoState = athlete.state
..state = "fromStrava";
notifyListeners();
}
......@@ -30,8 +31,10 @@ class Athlete extends ChangeNotifier {
return "Loading athlete data from Strava ...";
case "unsaved":
return "Strava data loaded successfully.";
case "fromStrava":
return "Data received from Strava.";
default:
return "Unknown state, should have never come here.";
return "Unknown state ${db.state}, should have never come here.";
}
}
......
import 'package:flutter/material.dart';
import 'package:encrateia/models/athlete.dart';
import 'package:provider/provider.dart';
import 'strava/strava_get_user.dart';
import 'strava_get_user.dart';
class EditAthleteScreen extends StatelessWidget {
final Athlete athlete;
......
......@@ -17,16 +17,17 @@ class StravaGetUser extends StatelessWidget {
value: athlete,
child: Scaffold(
appBar: AppBar(title: Text('Create Athlete')),
body:
Consumer<Athlete>(builder: (context, athlete, _child) {
if (athlete.db.firstName == null) loginToStrava();
return Container(
child: Padding(
padding: EdgeInsets.all(20),
child: Text(athlete.stateText),
),
);
}),
body: Consumer<Athlete>(
builder: (context, athlete, _child) {
if (athlete.db.firstName == null) loginToStrava();
return Container(
child: Padding(
padding: EdgeInsets.all(20),
child: Text(athlete.stateText),
),
);
},
),
),
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment