Skip to content
This repository was archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #22 from prakharb10/dev
Browse files Browse the repository at this point in the history
v1.0.7
  • Loading branch information
prakharb10 authored Jul 1, 2020
2 parents ad2810e + 95c2bc5 commit 366e76c
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"request": "launch",
"type": "dart"
}
]
}
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ android {
api 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2'
implementation 'com.google.firebase:firebase-perf:19.0.7'
implementation 'com.google.firebase:firebase-crashlytics:17.1.0'
implementation 'com.google.firebase:firebase-analytics:17.4.3'
}

defaultConfig {
Expand Down
2 changes: 2 additions & 0 deletions lib/LoginPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:firebase_auth/firebase_auth.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'ForgotPass.dart';
import 'RegisterPage.dart';
import 'package:firebase_analytics/firebase_analytics.dart';

class LoginPage extends StatefulWidget {
@override
Expand Down Expand Up @@ -62,6 +63,7 @@ class _LoginPageState extends State<LoginPage> {
AuthResult result = await _auth.signInWithEmailAndPassword(
email: _email, password: _password);
FirebaseUser user = result.user;
FirebaseAnalytics().logLogin(loginMethod: 'EmailAndPassword');
_error = 'Welcome back,' + user.displayName.toString() + '!';
Navigator.of(context).pop();
//Navigator.of(context).pushReplacementNamed('/home');
Expand Down
2 changes: 2 additions & 0 deletions lib/RegisterPage.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'SharedAxisPR.dart';
Expand Down Expand Up @@ -67,6 +68,7 @@ class _RegisterPageState extends State<RegisterPage> {
updateInfo.displayName = _name;
firebaseUser.updateProfile(updateInfo);
_error = 'Hi, $_name!';
FirebaseAnalytics().logSignUp(signUpMethod: 'EmailAndPassword');
Navigator.of(context).pop();
//Navigator.of(context).pushNamed('/home');
} on PlatformException catch (err) {
Expand Down
11 changes: 10 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:firebase_analytics/observer.dart';
import 'package:flushbar/flushbar_route.dart';
import 'package:flutter/material.dart';
import 'dart:async';
Expand All @@ -17,6 +18,7 @@ import 'package:connectivity/connectivity.dart';
import 'RootPage.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:firebase_analytics/firebase_analytics.dart';

List<CameraDescription> cameras;
Future<void> main() async {
Expand All @@ -35,7 +37,9 @@ Future<void> main() async {

Crashlytics.instance.enableInDevMode = true;
FlutterError.onError = Crashlytics.instance.recordFlutterError;


await FirebaseAnalytics().logAppOpen();

runApp(MyApp());

// Get a specific camera from the list of available cameras.
Expand All @@ -51,6 +55,9 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
navigatorObservers: [
FirebaseAnalyticsObserver(analytics: FirebaseAnalytics())
],
navigatorKey: nav,
darkTheme: ThemeData.dark(),
theme: ThemeData(
Expand Down Expand Up @@ -473,6 +480,7 @@ String jsonEncoded;
String jsonDecoded;

Future<String> getData(String textController) async {
FirebaseAnalytics().logSearch(searchTerm: textController);
try {
query = {"find": textController};
jsonEncoded = json.encode(query);
Expand All @@ -490,6 +498,7 @@ displayData(String textEditingController) {
future: getData(textEditingController),
builder: (context, snapshot) {
if (snapshot.hasData) {
FirebaseAnalytics().logViewSearchResults(searchTerm: textEditingController);
return Scaffold(
body: Padding(
padding: const EdgeInsets.all(8.0),
Expand Down
14 changes: 14 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "7.3.0"
firebase_analytics:
dependency: "direct main"
description:
name: firebase_analytics
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.15"
firebase_analytics_platform_interface:
dependency: transitive
description:
name: firebase_analytics_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
firebase_auth:
dependency: "direct main"
description:
Expand Down
5 changes: 3 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: wiki_app
description: A new Flutter project.
description: A flutter app that uses ML to identify labels in an image and then displays information on the user-selected label from Wikipedia.

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
Expand All @@ -15,7 +15,7 @@ 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.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.6+1
version: 1.0.7+1

environment:
sdk: ">=2.7.0 <3.0.0"
Expand All @@ -40,6 +40,7 @@ dependencies:
firebase_auth: ^0.16.1
fluttertoast: ^4.0.1
firebase_crashlytics: ^0.1.3+3
firebase_analytics: ^5.0.15


# The following adds the Cupertino Icons font to your application.
Expand Down

0 comments on commit 366e76c

Please sign in to comment.