fixed sevaral warnings and deprecations
parent
ad0bf6e3ca
commit
46967bf6a4
File diff suppressed because one or more lines are too long
|
@ -30,8 +30,10 @@ Future<void> deleteAthlete({
|
||||||
MyButton.delete(
|
MyButton.delete(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await athlete!.delete();
|
await athlete!.delete();
|
||||||
Navigator.of(context)
|
if (context.mounted) {
|
||||||
.popUntil((Route<dynamic> route) => route.isFirst);
|
Navigator.of(context)
|
||||||
|
.popUntil((Route<dynamic> route) => route.isFirst);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -38,8 +38,8 @@ Future<void> downloadDemoData({
|
||||||
|
|
||||||
for (final String filename in fileNames) {
|
for (final String filename in fileNames) {
|
||||||
final Activity activity = Activity.fromLocalDirectory(athlete: athlete);
|
final Activity activity = Activity.fromLocalDirectory(athlete: athlete);
|
||||||
await dio.download(downloadDir + filename,
|
await dio.download(
|
||||||
appDocDir.path + '/' + activity.stravaId.toString() + '.fit');
|
downloadDir + filename, '${appDocDir.path}/${activity.stravaId}.fit');
|
||||||
await activity.setState('downloaded');
|
await activity.setState('downloaded');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -194,12 +194,14 @@ class Athlete {
|
||||||
currentStravaClient = stravaClient!;
|
currentStravaClient = stravaClient!;
|
||||||
}
|
}
|
||||||
|
|
||||||
await currentStravaClient.authentication
|
await currentStravaClient.authentication.authenticate(
|
||||||
.authenticate(scopes: <AuthenticationScope>[
|
scopes: <AuthenticationScope>[
|
||||||
AuthenticationScope.read_all,
|
AuthenticationScope.read_all,
|
||||||
AuthenticationScope.profile_read_all,
|
AuthenticationScope.profile_read_all,
|
||||||
AuthenticationScope.activity_read_all
|
AuthenticationScope.activity_read_all
|
||||||
], redirectUrl: 'stravaflutter://redirect');
|
],
|
||||||
|
redirectUrl: 'stravaflutter://redirect',
|
||||||
|
callbackUrlScheme: 'stravaflutter');
|
||||||
|
|
||||||
final DateTime now = DateTime.now();
|
final DateTime now = DateTime.now();
|
||||||
final DateTime startDate =
|
final DateTime startDate =
|
||||||
|
|
|
@ -16,11 +16,11 @@ class IntroductionTextScreen extends StatelessWidget {
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Markdown(
|
child: Markdown(
|
||||||
onTapLink: (
|
onTapLink: (
|
||||||
String _text,
|
String text,
|
||||||
String? url,
|
String? url,
|
||||||
String _title,
|
String title,
|
||||||
) =>
|
) =>
|
||||||
launch(url!),
|
launchUrl(url as Uri),
|
||||||
data: '''
|
data: '''
|
||||||
## What is Encrateia?
|
## What is Encrateia?
|
||||||
|
|
||||||
|
|
|
@ -44,12 +44,14 @@ class StravaGetUserState extends State<StravaGetUser> {
|
||||||
final StravaClient stravaClient = StravaClient(
|
final StravaClient stravaClient = StravaClient(
|
||||||
clientId: clientId, secret: secret, applicationName: athlete.uuid);
|
clientId: clientId, secret: secret, applicationName: athlete.uuid);
|
||||||
|
|
||||||
await stravaClient.authentication
|
await stravaClient.authentication.authenticate(
|
||||||
.authenticate(scopes: <AuthenticationScope>[
|
scopes: <AuthenticationScope>[
|
||||||
AuthenticationScope.read_all,
|
AuthenticationScope.read_all,
|
||||||
AuthenticationScope.profile_read_all,
|
AuthenticationScope.profile_read_all,
|
||||||
AuthenticationScope.activity_read_all
|
AuthenticationScope.activity_read_all
|
||||||
], redirectUrl: 'stravaflutter://redirect');
|
],
|
||||||
|
redirectUrl: 'stravaflutter://redirect',
|
||||||
|
callbackUrlScheme: 'stravaflutter');
|
||||||
|
|
||||||
final DetailedAthlete stravaAthlete =
|
final DetailedAthlete stravaAthlete =
|
||||||
await stravaClient.athletes.getAuthenticatedAthlete();
|
await stravaClient.athletes.getAuthenticatedAthlete();
|
||||||
|
|
|
@ -3,8 +3,8 @@ import 'package:flutter/material.dart';
|
||||||
class MyButtonStyle extends ButtonStyle {
|
class MyButtonStyle extends ButtonStyle {
|
||||||
static ButtonStyle raisedButtonStyle({Color? color, Color? textColor}) {
|
static ButtonStyle raisedButtonStyle({Color? color, Color? textColor}) {
|
||||||
return ElevatedButton.styleFrom(
|
return ElevatedButton.styleFrom(
|
||||||
onPrimary: textColor ?? Colors.black,
|
foregroundColor: textColor ?? Colors.black,
|
||||||
primary: color ?? Colors.grey[300],
|
backgroundColor: color ?? Colors.grey[300],
|
||||||
minimumSize: const Size(88, 36),
|
minimumSize: const Size(88, 36),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
|
|
|
@ -185,9 +185,9 @@ class ActivityBarGraphWidgetState extends State<ActivityBarGraphWidget> {
|
||||||
Future<void> getData() async {
|
Future<void> getData() async {
|
||||||
final Activity activity = widget.activity!;
|
final Activity activity = widget.activity!;
|
||||||
_laps = await activity.laps;
|
_laps = await activity.laps;
|
||||||
for (final Lap _lap in _laps) {
|
for (final Lap lap in _laps) {
|
||||||
_lap.powerDistributions = await _lap.powerZoneCounts();
|
lap.powerDistributions = await lap.powerZoneCounts();
|
||||||
_lap.heartRateDistributions = await _lap.heartRateZoneCounts();
|
lap.heartRateDistributions = await lap.heartRateZoneCounts();
|
||||||
}
|
}
|
||||||
|
|
||||||
_powerZoneSchema = await activity.powerZoneSchema;
|
_powerZoneSchema = await activity.powerZoneSchema;
|
||||||
|
|
|
@ -45,7 +45,7 @@ class AthleteHeartRateZoneSchemaWidgetState
|
||||||
child: Text(
|
child: Text(
|
||||||
'\nHeart Rate Zone Schemas ${offset + 1} - ${offset + rows} '
|
'\nHeart Rate Zone Schemas ${offset + 1} - ${offset + rows} '
|
||||||
'of ${heartRateZoneSchemas.length}',
|
'of ${heartRateZoneSchemas.length}',
|
||||||
style: Theme.of(context).textTheme.headline6,
|
style: Theme.of(context).textTheme.titleLarge,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
DataTable(
|
DataTable(
|
||||||
|
|
|
@ -44,7 +44,7 @@ class AthletePowerZoneSchemaWidgetState
|
||||||
child: Text(
|
child: Text(
|
||||||
'\nPowerZoneSchemas ${offset + 1} - ${offset + rows} '
|
'\nPowerZoneSchemas ${offset + 1} - ${offset + rows} '
|
||||||
'of ${powerZoneSchemas.length}',
|
'of ${powerZoneSchemas.length}',
|
||||||
style: Theme.of(context).textTheme.headline6,
|
style: Theme.of(context).textTheme.titleLarge,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
DataTable(
|
DataTable(
|
||||||
|
|
|
@ -38,7 +38,7 @@ class AthleteTagGroupWidgetState extends State<AthleteTagGroupWidget> {
|
||||||
child: Text(
|
child: Text(
|
||||||
'\nTag Groups ${offset + 1} - ${offset + rows} '
|
'\nTag Groups ${offset + 1} - ${offset + rows} '
|
||||||
'of ${tagGroups!.length}',
|
'of ${tagGroups!.length}',
|
||||||
style: Theme.of(context).textTheme.headline6,
|
style: Theme.of(context).textTheme.titleLarge,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
DataTable(
|
DataTable(
|
||||||
|
|
|
@ -194,7 +194,7 @@ packages:
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.1"
|
version: "3.1.1"
|
||||||
cookie_jar:
|
cookie_jar:
|
||||||
dependency: transitive
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: cookie_jar
|
name: cookie_jar
|
||||||
sha256: d1cc6516a190ba667941f722b6365d202caff3dacb38de24268b8d6ff1ec8a1d
|
sha256: d1cc6516a190ba667941f722b6365d202caff3dacb38de24268b8d6ff1ec8a1d
|
||||||
|
|
|
@ -10,6 +10,7 @@ dependencies:
|
||||||
community_charts_flutter: ^1.0.1
|
community_charts_flutter: ^1.0.1
|
||||||
community_charts_common: ^1.0.1
|
community_charts_common: ^1.0.1
|
||||||
collection: ^1.17.0
|
collection: ^1.17.0
|
||||||
|
cookie_jar: ^3.0.1
|
||||||
csv: ^5.0.1
|
csv: ^5.0.1
|
||||||
cupertino_icons: ^1.0.4
|
cupertino_icons: ^1.0.4
|
||||||
datetime_picker_formfield: ^2.0.0
|
datetime_picker_formfield: ^2.0.0
|
||||||
|
|
Reference in New Issue