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
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,10 @@ samples, guidance on mobile development, and a full API reference.

https://medium.com/flutter-community/flutter-layout-cheat-sheet-5363348d037e
https://medium.com/jlouage/container-de5b0d3ad184


[perez-danilo](https://github.com/perez-danilo)

| Nome | github |
| ------------- | ------------- |
| Danilo Perez | [perez-danilo](https://github.com/perez-danilo) |
19 changes: 9 additions & 10 deletions lib/pages/create-account/create-account.page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'dart:io';

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_storage/firebase_storage.dart';
Expand All @@ -14,15 +13,15 @@ class CreateAccountPage extends StatefulWidget {

class _CreateAccountPageState extends State<CreateAccountPage> {
String email = "";
String nome = "";
String senha = "";
String name = "";
String password = "";
final FirebaseAuth _auth = FirebaseAuth.instance;
File image;

Future<FirebaseUser> _handleCreateAccount() async {
final AuthResult auth = await _auth.createUserWithEmailAndPassword(
email: this.email,
password: this.senha,
password: this.password,
);
var user = auth.user;

Expand All @@ -34,7 +33,7 @@ class _CreateAccountPageState extends State<CreateAccountPage> {
String downloadUrl = await taskSnapshot.ref.getDownloadURL();

UserUpdateInfo info = new UserUpdateInfo();
info.displayName = this.nome;
info.displayName = this.name;
info.photoUrl = downloadUrl;
await user.updateProfile(info);
await user.reload();
Expand All @@ -50,7 +49,7 @@ class _CreateAccountPageState extends State<CreateAccountPage> {

final databaseReference = Firestore.instance;
await databaseReference.collection("usuarios").document(this.email).setData({
'nome': this.nome,
'nome': this.name,
'email': this.email,
'foto': downloadUrl,
'latitude' : currentLocation.latitude,
Expand Down Expand Up @@ -110,7 +109,7 @@ class _CreateAccountPageState extends State<CreateAccountPage> {
padding: const EdgeInsets.all(8.0),
child: TextField(
onChanged: (value) {
nome = value;
name = value;
},
style: TextStyle(fontSize: 15),
decoration: new InputDecoration(
Expand All @@ -121,7 +120,7 @@ class _CreateAccountPageState extends State<CreateAccountPage> {
),
filled: true,
hintStyle: new TextStyle(color: Colors.grey[800]),
hintText: "Nome",
hintText: "nome",
fillColor: Colors.white),
),
),
Expand All @@ -140,15 +139,15 @@ class _CreateAccountPageState extends State<CreateAccountPage> {
),
filled: true,
hintStyle: new TextStyle(color: Colors.grey[800]),
hintText: "eMail",
hintText: "E-Mail",
fillColor: Colors.white),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: TextField(
onChanged: (value) {
senha = value;
password = value;
},
obscureText: true,
style: TextStyle(fontSize: 15),
Expand Down