Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,13 @@ PODS:
- Flutter
- flutter_phone_direct_caller (0.0.1):
- Flutter
- flutter_secure_storage (3.3.1):
- Flutter
- fluttertoast (0.0.2):
- Flutter
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- google_sign_in (0.0.1):
- Flutter
- GoogleSignIn (~> 5.0)
Expand Down Expand Up @@ -129,8 +134,13 @@ PODS:
- Flutter
- PromisesObjC (1.2.11)
- Reachability (3.2)
- shared_preferences (0.0.1):
- Flutter
- sign_in_with_apple (0.0.1):
- Flutter
- sqflite (0.0.2):
- Flutter
- FMDB (>= 2.7.5)

DEPENDENCIES:
- camera (from `.symlinks/plugins/camera/ios`)
Expand All @@ -141,13 +151,16 @@ DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_facebook_login (from `.symlinks/plugins/flutter_facebook_login/ios`)
- flutter_phone_direct_caller (from `.symlinks/plugins/flutter_phone_direct_caller/ios`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- google_sign_in (from `.symlinks/plugins/google_sign_in/ios`)
- GoogleSignIn
- image_picker (from `.symlinks/plugins/image_picker/ios`)
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)

SPEC REPOS:
trunk:
Expand All @@ -160,6 +173,7 @@ SPEC REPOS:
- FirebaseCore
- FirebaseCoreDiagnostics
- FirebaseInstallations
- FMDB
- GoogleAppMeasurement
- GoogleDataTransport
- GoogleSignIn
Expand All @@ -185,6 +199,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_facebook_login/ios"
flutter_phone_direct_caller:
:path: ".symlinks/plugins/flutter_phone_direct_caller/ios"
flutter_secure_storage:
:path: ".symlinks/plugins/flutter_secure_storage/ios"
fluttertoast:
:path: ".symlinks/plugins/fluttertoast/ios"
google_sign_in:
Expand All @@ -195,8 +211,12 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/path_provider/ios"
permission_handler:
:path: ".symlinks/plugins/permission_handler/ios"
shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios"
sign_in_with_apple:
:path: ".symlinks/plugins/sign_in_with_apple/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"

SPEC CHECKSUMS:
AppAuth: 31bcec809a638d7bd2f86ea8a52bd45f6e81e7c7
Expand All @@ -215,7 +235,9 @@ SPEC CHECKSUMS:
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
flutter_facebook_login: cfb5659f686b1c575ef205c6b6fd20db9679d3c4
flutter_phone_direct_caller: bd2ffd297f371a8a6c7bfbba0196964ffe3c4358
flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec
fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
google_sign_in: 6bd214b9c154f881422f5fe27b66aaa7bbd580cc
GoogleAppMeasurement: 966e88df9d19c15715137bb2ddaf52373f111436
GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833
Expand All @@ -229,7 +251,9 @@ SPEC CHECKSUMS:
permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6
PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
sign_in_with_apple: 34f3f5456a45fd7ac5fb42905e2ad31dae061b4a
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904

PODFILE CHECKSUM: 4dc7e1f03dbbb17642b97a859dc52e155761199a

Expand Down
59 changes: 57 additions & 2 deletions lib/dashboardscreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ import 'package:flutter_app/pulltorefreshdemo.dart';
import 'package:flutter_app/sidedrawer.dart';
import 'package:flutter_app/statemanagement/blocwetherapplication/WeatherAppScreen.dart';
import 'package:flutter_app/statemanagement/mobxapicall/MobxAPICallScreen.dart';
import 'package:flutter_app/storage/database/noteApp.dart';
import 'package:flutter_app/storage/database/sqflitescreen.dart';
import 'package:flutter_app/storage/localstorage.dart';
import 'package:flutter_app/storage/securestorage.dart';
import 'package:flutter_facebook_login/flutter_facebook_login.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:google_sign_in/google_sign_in.dart';
Expand Down Expand Up @@ -66,6 +70,19 @@ class _DashboardScreenState extends State<DashboardScreen> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
CustomRow(
childrens: [
CustomRaisedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => MyHomePage(title: 'Flutter Demo Home Page')),
);
},
buttonLable: "Dashboard"
)
],
),
CustomRow(
childrens: [
CustomRaisedButton(
Expand Down Expand Up @@ -324,6 +341,41 @@ class _DashboardScreenState extends State<DashboardScreen> {

),
],
),
CustomRow(
childrens: [
CustomRaisedButton(
onPressed: (){
Navigator.push(
context,
MaterialPageRoute(builder: (context) => LocalStorageDemo()),
);
},
buttonLable: "Local Storage"
),
CustomRaisedButton(
onPressed: (){
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SqfLiteScreen()),
);
},
buttonLable: "Flutter Database"
),
],
),
CustomRow(
childrens: [
CustomRaisedButton(
onPressed: (){
Navigator.push(
context,
MaterialPageRoute(builder: (context) => NoteAppDemo()),
);
},
buttonLable: "Note APP"
),
],
)
],
),
Expand All @@ -350,10 +402,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
UserCredential userCredential = await FirebaseAuth.instance.signInWithCredential(credential);
SecureStorageDemo secureStorageDemo = SecureStorageDemo();
secureStorageDemo.writeSecureData("isLogin", true);

// Once signed in, return the UserCredential
Fluttertoast.showToast(
msg: (await FirebaseAuth.instance.signInWithCredential(credential)).user.email.toString(),
msg: userCredential.user.displayName.toString(),
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM,
timeInSecForIos: 1,
Expand All @@ -364,7 +419,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
context,
MaterialPageRoute(builder: (context) => MyHomePage(title: 'Flutter Demo Home Page')),
);
return await FirebaseAuth.instance.signInWithCredential(credential);
return userCredential;
}

Future<void> signUpWithFacebook() async{
Expand Down
86 changes: 50 additions & 36 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,42 @@ import 'package:flutter/material.dart';
import 'package:flutter_app/dashboardscreen.dart';
import 'package:flutter_app/model/enum/ConnectivityStatus.dart';
import 'package:flutter_app/model/mobxstore/countermobx.dart';
import 'package:flutter_app/model/service/ConnectivityService.dart';
import 'package:flutter_app/storage/database/notemobx.dart';
import 'package:flutter_app/storage/securestorage.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart';

Widget customHomeWidget;
NoteMobxStore noteCommonObject = NoteMobxStore();

Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
await noteCommonObject.updateCurrentTheme();
SecureStorageDemo secureStorageDemo = SecureStorageDemo();
await secureStorageDemo.readSecureData("isLogin").then((value) {
print(value.toString());
customHomeWidget = (value == true ? MyHomePage(title: 'Flutter Demo Home Page') : DashboardScreen());
return value;
});
runApp(MyApp());
}

class MyApp extends StatelessWidget {
class MyApp extends StatelessObserverWidget {
// This widget is th e root of your application.
@override
Widget build(BuildContext context) {
return StreamProvider<ConnectivityStatus>(
builder: (context) => ConnectivityService().connectionStatusController,
child: MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
),
// home: MyHomePage(title: 'Flutter Demo Home Page'),
home: DashboardScreen(),
),

return Observer(
builder: (context){
return MaterialApp(
title: 'Flutter Demo',
theme:noteCommonObject.themeData,
home: customHomeWidget,
);
}
);
}
}
Expand Down Expand Up @@ -66,24 +68,32 @@ class _MyHomePageState extends State<MyHomePage> {

String textToDisplay;
String textInputed;
int _counter;

void changeText() {
setState(() {
textToDisplay = textInputed;
});
}

// void _incrementCounter() {
// setState(() {
// // This call to setState tells the Flutter framework that something has
// // changed in this State, which causes it to rerun the build method below
// // so that the display can reflect the updated values. If we changed
// // _counter without calling setState(), then the build method would not be
// // called again, and so nothing would appear to happen.
// _counter++;
// isVisible = !isVisible;
// });
// }
@override
void initState() {
getSharePreferenceData();
super.initState();
}

void getSharePreferenceData() async {
SharedPreferences _prefs = await SharedPreferences.getInstance();
setState(() {
_counter = _prefs.getInt('counter');
});
}
void setSharePreferenceData() async {
SharedPreferences _prefs = await SharedPreferences.getInstance();
_prefs.setInt('counter', (_prefs.getInt('counter') + 1));
getSharePreferenceData();
}


@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -169,6 +179,10 @@ class _MyHomePageState extends State<MyHomePage> {
style: Theme.of(context).textTheme.headline4,
);
}),
Text(
'Button tapped $_counter time${_counter == 1 ? '' : 's'}.\n\n'
'This should persist across restarts.',
),
Visibility(
visible: !isVisible,
child: Row(
Expand Down Expand Up @@ -249,16 +263,16 @@ class _MyHomePageState extends State<MyHomePage> {
],
),
floatingActionButton: FloatingActionButton(
onPressed: () {
onPressed: () {
setSharePreferenceData();
counterMobxStore.increment();
// FirebaseAuth.instance.signOut();
// FirebaseAuth.instance.currentUser.delete();
if(FirebaseAuth.instance.currentUser != null){
SecureStorageDemo secureStorageDemo = SecureStorageDemo();
secureStorageDemo.writeSecureData("isLogin", false);
FirebaseAuth.instance.signOut();
Navigator.of(context).pop();
}
},
// onPressed: _incrementCounter,
tooltip: 'Increment',
backgroundColor: Colors.orange,
child: Icon(Icons.logout),
Expand Down
4 changes: 2 additions & 2 deletions lib/statemanagement/mobxapicall/MobxAPICall.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading