Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sign up changes made #3

Merged
merged 6 commits into from
Nov 5, 2021
Merged
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
39 changes: 39 additions & 0 deletions flutter2.0-firebasestarter/android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "369961422034",
"project_id": "biometrics-d411f",
"storage_bucket": "biometrics-d411f.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:369961422034:android:7f232c40a2b4f3c989710b",
"android_client_info": {
"package_name": "com.example.biometrics"
}
},
"oauth_client": [
{
"client_id": "369961422034-uv72et5hl7tv62tb6eoeoc15vo1f88ej.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDd33M8ZkOE5qr11PGSl4kVmVwUwNnc_d0"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "369961422034-uv72et5hl7tv62tb6eoeoc15vo1f88ej.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
Binary file added flutter2.0-firebasestarter/assets/google.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions flutter2.0-firebasestarter/lib/alert_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// ignore_for_file: deprecated_member_use

import 'package:flutter/material.dart';

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
final appTitle = 'About Us';
return MaterialApp(
title: appTitle,
home: Scaffold(
appBar: AppBar(
title: Text(appTitle),
),
body: MyAlert(),
),
);
}
}

class MyAlert extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(20.0),
child: RaisedButton(
child: Text('Show alert'),
onPressed: () {
showAlertDialog(context);
},
),
);
}
}

showAlertDialog(BuildContext context) {
// Create button
Widget okButton = FlatButton(
child: Text("OK"),
onPressed: () {
Navigator.of(context).pop();
},
);

// Create AlertDialog
AlertDialog alert = AlertDialog(
title: Text("About Us"),
content: Text("User recognition by typing speed (release time)"),
actions: [
okButton,
],
);

// show the dialog
showDialog(
context: context,
builder: (BuildContext context) {
return alert;
},
);
}
59 changes: 51 additions & 8 deletions flutter2.0-firebasestarter/lib/home_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import 'dart:html';

import 'package:flutter/material.dart';
import 'package:flutterfbauth/services/authservice.dart';
import 'package:flutterfbauth/alert_page.dart';

class HomePage extends StatefulWidget {
@override
Expand All @@ -9,14 +12,54 @@ class HomePage extends StatefulWidget {
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
final _profil_name = "Nisal C"; // Replace with backend call
var _user_name = ''; // update this with the updated one from the backend
return Scaffold(
body: Column(mainAxisAlignment: MainAxisAlignment.center, children: [
Text('You are logged in'),
ElevatedButton(
onPressed: () {
AuthService().signOut();
},
child: Center(child: Text('LOG OUT')))
]));
appBar: AppBar(
title: Text('Biometrics'),
backgroundColor: Colors.green,
),
drawer: Drawer(
child: ListView(
// Important: Remove any padding from the ListView.
padding: EdgeInsets.zero,
children: [
const DrawerHeader(
decoration: BoxDecoration(
color: Colors.green,
),
child: Text('Nisal C'),
),
ListTile(
title: const Text('Sign Out'),
onTap: () {
AuthService().signOut();
},
),
ListTile(
title: const Text('About Us'),
onTap: () {
MyAlert();
},
),
],
),
),
body: new ListView(
children: <Widget>[
Text(
'ID 01',
style: const TextStyle(fontWeight: FontWeight.bold),
),
Text(
'$_user_name'), // add the names from the backend to teh second text widget
Text(
'ID 02',
style: const TextStyle(fontWeight: FontWeight.bold),
),
Text('User: $_user_name'),
],
),
);
}
}
6 changes: 3 additions & 3 deletions flutter2.0-firebasestarter/lib/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,19 @@ class _LoginPageState extends State<LoginPage> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: ImageIcon(AssetImage('assets/facebook.png'),
child: ImageIcon(AssetImage('assets/google.png'),
size: 15.0)),
SizedBox(width: 10.0),
Center(
child: Text('Login with facebook',
child: Text('Login with Google',
style: TextStyle(fontFamily: 'Trueno'))),
],
),
)),
),
SizedBox(height: 25.0),
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Text('New to Spotify ?'),
Text('New to Biometrics ?'),
SizedBox(width: 5.0),
InkWell(
onTap: () {
Expand Down