Flurry. ExerciseDevice
This commit is contained in:
parent
ed8760f8e8
commit
82513fb03e
@ -29,8 +29,7 @@ import 'package:aitrainer_app/view/registration.dart';
|
|||||||
import 'package:aitrainer_app/view/reset_password.dart';
|
import 'package:aitrainer_app/view/reset_password.dart';
|
||||||
import 'package:aitrainer_app/view/settings.dart';
|
import 'package:aitrainer_app/view/settings.dart';
|
||||||
import 'package:aitrainer_app/widgets/home.dart';
|
import 'package:aitrainer_app/widgets/home.dart';
|
||||||
//import 'package:firebase_analytics/firebase_analytics.dart';
|
import 'package:flurry/flurry.dart';
|
||||||
//import 'package:firebase_analytics/observer.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
@ -141,18 +140,28 @@ Future<Null> main() async {
|
|||||||
create: (BuildContext context) => BodyDevelopmentBloc(workoutTreeRepository: menuTreeRepository),
|
create: (BuildContext context) => BodyDevelopmentBloc(workoutTreeRepository: menuTreeRepository),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
child: AitrainerApp(),
|
child: WorkoutTestApp(),
|
||||||
));
|
));
|
||||||
}, (error, stackTrace) async {
|
}, (error, stackTrace) async {
|
||||||
await _reportError(error, stackTrace);
|
await _reportError(error, stackTrace);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
class AitrainerApp extends StatelessWidget {
|
Future<void> initFlurry() async {
|
||||||
|
await Flurry.initialize(
|
||||||
|
androidKey: "JNYCTCWBT34FM3J8TV36",
|
||||||
|
iosKey: "3QBG7BSMGPDH24S8TRQP",
|
||||||
|
enableLog: true);
|
||||||
|
//await Flurry.setUserId("userId");
|
||||||
|
//await Flurry.logEvent("eventName");
|
||||||
|
}
|
||||||
|
|
||||||
|
class WorkoutTestApp extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||||
//final FirebaseAnalytics analytics = FirebaseAnalytics();
|
//final FirebaseAnalytics analytics = FirebaseAnalytics();
|
||||||
|
initFlurry();
|
||||||
PushNotificationsManager().init();
|
PushNotificationsManager().init();
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
localizationsDelegates: [
|
localizationsDelegates: [
|
||||||
|
22
lib/model/exercise_device.dart
Normal file
22
lib/model/exercise_device.dart
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
class ExerciseType {
|
||||||
|
int deviceId;
|
||||||
|
String name;
|
||||||
|
String description;
|
||||||
|
String imageUrl;
|
||||||
|
|
||||||
|
|
||||||
|
ExerciseType({this.name, this.description});
|
||||||
|
|
||||||
|
ExerciseType.fromJson(Map json) {
|
||||||
|
this.name = json['name'];
|
||||||
|
this.description = json['description'];
|
||||||
|
this.imageUrl = json['imageUrl'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() =>
|
||||||
|
{
|
||||||
|
"name": name,
|
||||||
|
"description": description,
|
||||||
|
};
|
||||||
|
}
|
@ -66,10 +66,6 @@ class FirebaseApi {
|
|||||||
print('The account already exists for that email.');
|
print('The account already exists for that email.');
|
||||||
rc = REGISTER_EMAIL_IN_USE;
|
rc = REGISTER_EMAIL_IN_USE;
|
||||||
throw Exception("The email address has been registered already");
|
throw Exception("The email address has been registered already");
|
||||||
/* userCredential = await FirebaseAuth.instance.signInWithEmailAndPassword(email: email, password: password);
|
|
||||||
if (rc != null) {
|
|
||||||
rc = SIGN_IN_OK;
|
|
||||||
} */
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
@ -78,7 +74,7 @@ class FirebaseApi {
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<UserCredential> signInWithFacebook() async {
|
/*Future<UserCredential> signInWithFacebook() async {
|
||||||
// Trigger the sign-in flow
|
// Trigger the sign-in flow
|
||||||
final LoginResult result = await FacebookAuth.instance.login();
|
final LoginResult result = await FacebookAuth.instance.login();
|
||||||
|
|
||||||
@ -87,7 +83,7 @@ class FirebaseApi {
|
|||||||
|
|
||||||
// Once signed in, return the UserCredential
|
// Once signed in, return the UserCredential
|
||||||
return await FirebaseAuth.instance.signInWithCredential(facebookAuthCredential);
|
return await FirebaseAuth.instance.signInWithCredential(facebookAuthCredential);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
Future<void> signOut() async {
|
Future<void> signOut() async {
|
||||||
await FirebaseAuth.instance.signOut();
|
await FirebaseAuth.instance.signOut();
|
||||||
|
@ -2,6 +2,7 @@ import 'package:aitrainer_app/bloc/exercise_new/exercise_new_bloc.dart';
|
|||||||
import 'package:aitrainer_app/localization/app_localization.dart';
|
import 'package:aitrainer_app/localization/app_localization.dart';
|
||||||
import 'package:aitrainer_app/util/trans.dart';
|
import 'package:aitrainer_app/util/trans.dart';
|
||||||
import 'package:animated_widgets/widgets/rotation_animated.dart';
|
import 'package:animated_widgets/widgets/rotation_animated.dart';
|
||||||
|
import 'package:flurry/flurry.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
@ -70,6 +71,7 @@ class _BMIState extends State<BMI> with Trans {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
setContext(context);
|
setContext(context);
|
||||||
|
Flurry.logEvent("BMI");
|
||||||
widget.exerciseBloc.getBMI();
|
widget.exerciseBloc.getBMI();
|
||||||
return Form(
|
return Form(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
|
@ -2,6 +2,7 @@ import 'package:aitrainer_app/bloc/exercise_new/exercise_new_bloc.dart';
|
|||||||
import 'package:aitrainer_app/localization/app_localization.dart';
|
import 'package:aitrainer_app/localization/app_localization.dart';
|
||||||
import 'package:aitrainer_app/model/fitness_state.dart';
|
import 'package:aitrainer_app/model/fitness_state.dart';
|
||||||
import 'package:aitrainer_app/util/trans.dart';
|
import 'package:aitrainer_app/util/trans.dart';
|
||||||
|
import 'package:flurry/flurry.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
@ -74,6 +75,7 @@ class _BMRState extends State<BMR> with Trans {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
setContext(context);
|
setContext(context);
|
||||||
|
Flurry.logEvent("BMR");
|
||||||
return Form(
|
return Form(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
resizeToAvoidBottomInset: true,
|
resizeToAvoidBottomInset: true,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:aitrainer_app/localization/app_localization.dart';
|
import 'package:aitrainer_app/localization/app_localization.dart';
|
||||||
|
import 'package:flurry/flurry.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gradient_bottom_navigation_bar/gradient_bottom_navigation_bar.dart';
|
import 'package:gradient_bottom_navigation_bar/gradient_bottom_navigation_bar.dart';
|
||||||
|
|
||||||
@ -106,25 +107,30 @@ class _NawDrawerWidget extends State<BottomNavigator> {
|
|||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
|
Flurry.logEvent("Home");
|
||||||
Navigator.of(context).pushNamed('home');
|
Navigator.of(context).pushNamed('home');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
|
Flurry.logEvent("myDevelopment");
|
||||||
Navigator.of(context).pushNamed('myDevelopment');
|
Navigator.of(context).pushNamed('myDevelopment');
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
|
Flurry.logEvent("myExercisePlan");
|
||||||
Navigator.of(context).pushNamed('myExercisePlan');
|
Navigator.of(context).pushNamed('myExercisePlan');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
|
Flurry.logEvent("Account");
|
||||||
Navigator.of(context).pushNamed('account');
|
Navigator.of(context).pushNamed('account');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
|
Flurry.logEvent("Settings");
|
||||||
Navigator.of(context).pushNamed('settings');
|
Navigator.of(context).pushNamed('settings');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
40
pubspec.lock
40
pubspec.lock
@ -70,14 +70,14 @@ packages:
|
|||||||
name: build
|
name: build
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.5.0"
|
version: "1.5.1"
|
||||||
build_config:
|
build_config:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_config
|
name: build_config
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.2"
|
version: "0.4.3"
|
||||||
build_daemon:
|
build_daemon:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -98,14 +98,14 @@ packages:
|
|||||||
name: build_runner
|
name: build_runner
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.4"
|
version: "1.10.6"
|
||||||
build_runner_core:
|
build_runner_core:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_runner_core
|
name: build_runner_core
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.3"
|
version: "6.1.1"
|
||||||
built_collection:
|
built_collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -203,7 +203,7 @@ packages:
|
|||||||
name: dart_style
|
name: dart_style
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.9"
|
version: "1.3.10"
|
||||||
devicelocale:
|
devicelocale:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -217,7 +217,7 @@ packages:
|
|||||||
name: dropdown_search
|
name: dropdown_search
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.6"
|
version: "0.4.8"
|
||||||
equatable:
|
equatable:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -246,41 +246,34 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.0-nullsafety.2"
|
version: "6.0.0-nullsafety.2"
|
||||||
firebase:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: firebase
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "7.3.2"
|
|
||||||
firebase_auth:
|
firebase_auth:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: firebase_auth
|
name: firebase_auth
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.18.1+2"
|
version: "0.18.3"
|
||||||
firebase_auth_platform_interface:
|
firebase_auth_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_auth_platform_interface
|
name: firebase_auth_platform_interface
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.1"
|
version: "2.1.3"
|
||||||
firebase_auth_web:
|
firebase_auth_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_auth_web
|
name: firebase_auth_web
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.1+1"
|
version: "0.3.2"
|
||||||
firebase_core:
|
firebase_core:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: firebase_core
|
name: firebase_core
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.0+1"
|
version: "0.5.2"
|
||||||
firebase_core_platform_interface:
|
firebase_core_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -316,6 +309,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.0"
|
version: "0.12.0"
|
||||||
|
flurry:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flurry
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.0.7"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
@ -339,7 +339,7 @@ packages:
|
|||||||
name: flutter_facebook_auth
|
name: flutter_facebook_auth
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.3"
|
version: "1.0.1"
|
||||||
flutter_form_bloc:
|
flutter_form_bloc:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -492,7 +492,7 @@ packages:
|
|||||||
name: json_annotation
|
name: json_annotation
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.0"
|
version: "3.1.1"
|
||||||
json_rpc_2:
|
json_rpc_2:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -1001,7 +1001,7 @@ packages:
|
|||||||
name: win32
|
name: win32
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.7.3"
|
version: "1.7.4"
|
||||||
xdg_directories:
|
xdg_directories:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
26
pubspec.yaml
26
pubspec.yaml
@ -15,10 +15,10 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 1.1.2+2
|
version: 1.1.2+32
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.7.0 <3.1.0"
|
sdk: ">=2.10.0 <3.0.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
@ -28,9 +28,9 @@ dependencies:
|
|||||||
google_fonts: ^1.1.1
|
google_fonts: ^1.1.1
|
||||||
devicelocale: ^0.3.3
|
devicelocale: ^0.3.3
|
||||||
sentry: ^3.0.1
|
sentry: ^3.0.1
|
||||||
flutter_bloc: ^6.0.6
|
flutter_bloc: ^6.1.1
|
||||||
equatable: ^1.2.5
|
equatable: ^1.2.5
|
||||||
freezed: ^0.12.1
|
freezed: ^0.12.2
|
||||||
flutter_form_bloc: ^0.19.0
|
flutter_form_bloc: ^0.19.0
|
||||||
spider_chart: ^0.1.5
|
spider_chart: ^0.1.5
|
||||||
rainbow_color: ^0.1.1
|
rainbow_color: ^0.1.1
|
||||||
@ -40,16 +40,18 @@ dependencies:
|
|||||||
infinite_listview: ^1.0.1+1
|
infinite_listview: ^1.0.1+1
|
||||||
toggle_switch: ^0.1.8
|
toggle_switch: ^0.1.8
|
||||||
keyboard_actions: ^3.3.1+1
|
keyboard_actions: ^3.3.1+1
|
||||||
dropdown_search: ^0.4.6
|
dropdown_search: ^0.4.8
|
||||||
|
|
||||||
firebase_core: 0.5.0+1
|
firebase_core: 0.5.2
|
||||||
#firebase_analytics: ^6.0.2
|
#firebase_analytics: ^6.2.0
|
||||||
firebase_messaging: ^7.0.3
|
firebase_messaging: ^7.0.3
|
||||||
firebase_auth: ^0.18.1+2
|
firebase_auth: ^0.18.3
|
||||||
flutter_facebook_auth: ^0.3.3
|
flutter_facebook_auth: ^1.0.1
|
||||||
|
flurry: ^0.0.7
|
||||||
|
|
||||||
animated_widgets: ^1.0.6
|
animated_widgets: ^1.0.6
|
||||||
|
|
||||||
mockito: ^4.1.1
|
mockito: ^4.1.3
|
||||||
|
|
||||||
flutter_localizations:
|
flutter_localizations:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
@ -58,14 +60,14 @@ dev_dependencies:
|
|||||||
flutter_driver:
|
flutter_driver:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
test: any
|
test: any
|
||||||
bloc_test: ^7.0.4
|
bloc_test: ^7.1.0
|
||||||
|
|
||||||
build_runner:
|
build_runner:
|
||||||
|
|
||||||
|
|
||||||
http: 0.12.1
|
http: 0.12.1
|
||||||
intl: 0.16.1
|
intl: 0.16.1
|
||||||
shared_preferences: ^0.5.12+2
|
shared_preferences: ^0.5.12+4
|
||||||
|
|
||||||
flutter_launcher_icons: ^0.8.1
|
flutter_launcher_icons: ^0.8.1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user