Created
December 14, 2021 19:32
-
-
Save malibayram/c6aeaabd3d2d8f36258cc5313c46b82e to your computer and use it in GitHub Desktop.
Bahçeşehir Üniversitesi WIE(Women in Engineering) Komitesi ile 14 Aralık 2021'ta gerçekleştirdiğimiz etkinlikte yazdığımız kodlar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:firebase_core/firebase_core.dart'; | |
import 'package:cloud_firestore/cloud_firestore.dart'; | |
import 'package:firebase_auth/firebase_auth.dart'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() async { | |
try { | |
WidgetsFlutterBinding.ensureInitialized(); | |
} catch (e, st) { | |
print(e); | |
print(st); | |
} | |
// The first step to using Firebase is to configure it so that | |
// our code can find the Firebase project on the servers. This | |
// is not a security risk, as explained here: https://stackoverflow.com/a/37484053 | |
await Firebase.initializeApp( | |
options: const FirebaseOptions( | |
apiKey: "AIzaSyAhE5iTdU1MflQxb4_M_uHiXJR9EC_mE_I", | |
authDomain: "nanochat.firebaseapp.com", | |
projectId: "firebase-nanochat", | |
messagingSenderId: '137230848633', | |
appId: '1:137230848633:web:89e9b54f881fa0b843baa8')); | |
// We sign the user in anonymously, meaning they get a user ID | |
// without having to provide credentials. While this doesn't | |
// allow us to identify the user, this would still allow us to | |
// for example associate data in the database with each user. | |
await FirebaseAuth.instance.signInAnonymously(); | |
runApp(MyApp()); | |
} | |
List dogruMailler = ["[email protected]", "[email protected]"]; | |
List dogruSifreler = ["ali123", "ahmet123"]; | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
theme: ThemeData.light(), | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
body: Padding( | |
padding: const EdgeInsets.all(16.0), | |
child: Column( | |
children: [ | |
SizedBox(height: 32), | |
Center( | |
child: Text( | |
"LOGIN", | |
style: TextStyle( | |
fontWeight: FontWeight.bold, | |
fontSize: 32, | |
), | |
), | |
), | |
SizedBox(height: 32), | |
TextField( | |
decoration: InputDecoration( | |
border: OutlineInputBorder(), | |
labelText: "Email", | |
icon: Icon(Icons.email), | |
), | |
), | |
SizedBox(height: 8), | |
TextField( | |
decoration: InputDecoration( | |
border: OutlineInputBorder(), | |
labelText: "Şifre", | |
icon: Icon(Icons.lock), | |
), | |
), | |
SizedBox(height: 32), | |
RaisedButton( | |
color: Colors.pink, | |
textColor: Colors.white, | |
onPressed: () { | |
print("butona tıkladın"); | |
}, | |
child: Center( | |
child: Padding( | |
padding: const EdgeInsets.all(8.0), | |
child: Text( | |
"LOGIN", | |
style: TextStyle( | |
fontWeight: FontWeight.bold, | |
fontSize: 24, | |
), | |
), | |
), | |
), | |
), | |
], | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Flutter içinde Firebase kullanım klavuzu
Widget Kataloğu :)
Flutter Kurulumu