├── Firebase-Verilerle Çalışmak ├── lib │ ├── AnaSayfa.dart │ ├── GirisSayfasi.dart │ ├── YonlendirmeSayfasi.dart │ ├── canliYayin.dart │ ├── cokluVeriGosterme.dart │ ├── dinleyiciyleYonlendirme.dart │ ├── main.dart │ ├── models │ │ └── kullanici.dart │ ├── services │ │ └── benimAuthServisim.dart │ ├── streamIleYonlendirme.dart │ ├── tekliVeriGosterme.dart │ ├── veriCekme.dart │ └── yazmaIslemleri.dart ├── readme.md └── services │ └── readme.md ├── Giriş Sayfası UI ├── assets │ └── robot-2192617_640.png ├── lib │ └── main.dart └── readme.md ├── Hataların Çözümleri └── cloud_firestore_web not found Hatasının çözümü ├── README.md ├── SnackBar Örneği-Anahtar Yaptırmak.dart ├── SnackBar Örneği-Builder Widgetı.dart ├── SnackBar Örneği-Yeni Widgetı.dart ├── Sociaworld Ana Sayfa Ve Profil Sayfası UI ├── lib │ ├── gonderikarti.dart │ ├── main.dart │ └── profilsayfasi.dart └── readme.md ├── Stateful Widget Örneği.dart ├── Stateless Widget - Kimlik - Column.dart ├── Stateless Widget.dart ├── Uçarak Gelsin Market UI ├── lib │ ├── kategori.dart │ ├── main.dart │ ├── sepetim.dart │ ├── urun_detay.dart │ └── urunler.dart └── readme.md └── ilkprojem.dart /Firebase-Verilerle Çalışmak/lib/AnaSayfa.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:fireworks/services/benimAuthServisim.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:provider/provider.dart'; 5 | 6 | class AnaSayfa extends StatelessWidget { 7 | 8 | cikisYap(BuildContext context){ 9 | var _benimAuthServisim = Provider.of(context,listen: false); 10 | _benimAuthServisim.cikisYap(); 11 | } 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Scaffold( 16 | body: Center( 17 | child: InkWell(onTap: ()=>cikisYap(context), child: Text("Çıkış Yap")), 18 | ), 19 | ); 20 | } 21 | } -------------------------------------------------------------------------------- /Firebase-Verilerle Çalışmak/lib/GirisSayfasi.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:fireworks/models/kullanici.dart'; 3 | import 'package:fireworks/services/benimAuthServisim.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:provider/provider.dart'; 6 | 7 | class GirisSayfasi extends StatelessWidget { 8 | 9 | anonimGirisYap(BuildContext context) async { 10 | var _benimAuthServisim = Provider.of(context,listen: false); 11 | Kullanici kullanici = await _benimAuthServisim.anonimGiris(); 12 | //return kullanici.id; 13 | } 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scaffold( 18 | body: Center( 19 | child: Container( 20 | height: 80.0, 21 | width: 120.0, 22 | color: Colors.grey, 23 | child: Center(child: InkWell(onTap: () => anonimGirisYap(context), child: Text("Giriş Yap"))), 24 | ), 25 | ), 26 | ); 27 | } 28 | } -------------------------------------------------------------------------------- /Firebase-Verilerle Çalışmak/lib/YonlendirmeSayfasi.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:fireworks/anaSayfa.dart'; 3 | import 'package:fireworks/girisSayfasi.dart'; 4 | import 'package:fireworks/models/kullanici.dart'; 5 | import 'package:fireworks/services/benimAuthServisim.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:provider/provider.dart'; 8 | 9 | class YonlendirmeSayfasi extends StatefulWidget { 10 | 11 | @override 12 | _YonlendirmeSayfasiState createState() => _YonlendirmeSayfasiState(); 13 | } 14 | 15 | class _YonlendirmeSayfasiState extends State { 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | 20 | return StreamBuilder( 21 | stream: Provider.of(context, listen: false).durumTakipcisi, 22 | builder: (context,snapshot){ 23 | if(snapshot.connectionState == ConnectionState.waiting){ 24 | return Center(child: CircularProgressIndicator()); 25 | } 26 | 27 | if(snapshot.hasData){ 28 | Kullanici aktifKullanici = snapshot.data; 29 | print(aktifKullanici.id); 30 | return AnaSayfa(); 31 | } else { 32 | return GirisSayfasi(); 33 | } 34 | } 35 | ); 36 | } 37 | } -------------------------------------------------------------------------------- /Firebase-Verilerle Çalışmak/lib/canliYayin.dart: -------------------------------------------------------------------------------- 1 | import 'package:fireworks/models/kullanici.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:cloud_firestore/cloud_firestore.dart'; 4 | 5 | 6 | void main() => runApp(MyApp()); 7 | 8 | class MyApp extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | return MaterialApp( 12 | debugShowCheckedModeBanner: false, 13 | title: 'Projem', 14 | theme: ThemeData( 15 | primarySwatch: Colors.green, 16 | ), 17 | home: AnaSayfa(), 18 | ); 19 | } 20 | } 21 | 22 | class AnaSayfa extends StatefulWidget { 23 | @override 24 | _AnaSayfaState createState() => _AnaSayfaState(); 25 | } 26 | 27 | class _AnaSayfaState extends State { 28 | 29 | final db = Firestore.instance; 30 | 31 | 32 | @override 33 | void initState() { 34 | super.initState(); 35 | 36 | } 37 | 38 | 39 | @override 40 | Widget build(BuildContext context) { 41 | return Scaffold( 42 | body: StreamBuilder( 43 | stream: db.collection("kullanıcılar").snapshots(), 44 | builder: (context,snapshot){ 45 | 46 | if(!snapshot.hasData){ 47 | return CircularProgressIndicator(); 48 | } 49 | 50 | List kullanicilar = snapshot.data.documents.map((doc) => Kullanici.dokumandanUret(doc)).toList(); 51 | 52 | return ListView.builder( 53 | itemCount: kullanicilar.length, 54 | itemBuilder: (context,pozisyon){ 55 | return ListTile( 56 | title: Text(kullanicilar[pozisyon].isim), 57 | subtitle: Text(kullanicilar[pozisyon].eposta), 58 | ); 59 | } 60 | ); 61 | 62 | } 63 | ) 64 | ); 65 | } 66 | } 67 | 68 | 69 | -------------------------------------------------------------------------------- /Firebase-Verilerle Çalışmak/lib/cokluVeriGosterme.dart: -------------------------------------------------------------------------------- 1 | import 'package:fireworks/models/kullanici.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:cloud_firestore/cloud_firestore.dart'; 4 | 5 | 6 | void main() => runApp(MyApp()); 7 | 8 | class MyApp extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | return MaterialApp( 12 | debugShowCheckedModeBanner: false, 13 | title: 'Projem', 14 | theme: ThemeData( 15 | primarySwatch: Colors.green, 16 | ), 17 | home: AnaSayfa(), 18 | ); 19 | } 20 | } 21 | 22 | class AnaSayfa extends StatefulWidget { 23 | @override 24 | _AnaSayfaState createState() => _AnaSayfaState(); 25 | } 26 | 27 | class _AnaSayfaState extends State { 28 | 29 | final db = Firestore.instance; 30 | 31 | 32 | @override 33 | void initState() { 34 | super.initState(); 35 | 36 | } 37 | 38 | Future> kullanicilariGetir() async { 39 | 40 | QuerySnapshot snapshot = await db.collection("kullanıcılar").getDocuments(); 41 | List kullanicilar = snapshot.documents.map((doc) => Kullanici.dokumandanUret(doc)).toList(); 42 | return kullanicilar; 43 | 44 | } 45 | 46 | @override 47 | Widget build(BuildContext context) { 48 | return Scaffold( 49 | body: FutureBuilder>( 50 | future: kullanicilariGetir(), 51 | builder: (context,snapshot){ 52 | 53 | if(!snapshot.hasData){ 54 | return CircularProgressIndicator(); 55 | } 56 | 57 | return ListView.builder( 58 | itemCount: snapshot.data.length, 59 | itemBuilder: (context,pozisyon){ 60 | return ListTile( 61 | title: Text(snapshot.data[pozisyon].isim), 62 | subtitle: Text(snapshot.data[pozisyon].eposta), 63 | ); 64 | } 65 | ); 66 | 67 | } 68 | ) 69 | ); 70 | } 71 | } 72 | 73 | 74 | -------------------------------------------------------------------------------- /Firebase-Verilerle Çalışmak/lib/dinleyiciyleYonlendirme.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | 5 | void main() => runApp(MyApp()); 6 | 7 | class MyApp extends StatelessWidget { 8 | @override 9 | Widget build(BuildContext context) { 10 | return MaterialApp( 11 | debugShowCheckedModeBanner: false, 12 | title: 'Projem', 13 | theme: ThemeData( 14 | primarySwatch: Colors.green, 15 | ), 16 | home: YonlendirmeSayfasi(), 17 | ); 18 | } 19 | } 20 | 21 | class YonlendirmeSayfasi extends StatefulWidget { 22 | 23 | @override 24 | _YonlendirmeSayfasiState createState() => _YonlendirmeSayfasiState(); 25 | } 26 | 27 | class _YonlendirmeSayfasiState extends State { 28 | bool isAuth = false; 29 | 30 | anonimGirisYap() async { 31 | AuthResult authResult = await FirebaseAuth.instance.signInAnonymously(); 32 | print(authResult.user.uid); 33 | print(authResult.user.email); 34 | print(authResult.user.displayName); 35 | } 36 | 37 | cikisYap(){ 38 | FirebaseAuth.instance.signOut(); 39 | } 40 | 41 | Widget girisSayfasi(){ 42 | return Scaffold( 43 | body: Center( 44 | child: Container( 45 | height: 80.0, 46 | width: 120.0, 47 | color: Colors.grey, 48 | child: Center(child: InkWell(onTap: () => anonimGirisYap(), child: Text("Giriş Yap"))), 49 | ), 50 | ), 51 | ); 52 | } 53 | 54 | Widget anaSayfa(){ 55 | return Scaffold( 56 | body: Center( 57 | child: InkWell(onTap: ()=>cikisYap(), child: Text("Çıkış Yap")), 58 | ), 59 | ); 60 | } 61 | 62 | @override 63 | void initState() { 64 | super.initState(); 65 | FirebaseAuth.instance.onAuthStateChanged.listen((kullanici) { 66 | if(kullanici != null){ 67 | print("Kullanıcı giriş yapmış durumda, şimdi giriş yapmış yada uygulamayı yeni açmış olabilir."); 68 | setState(() { 69 | isAuth = true; 70 | }); 71 | } else { 72 | print("Kullanıcı giriş yapmamış! Yeni çıkış yapmış yada uygulamayı yeni açmış olabilir."); 73 | setState(() { 74 | isAuth = false; 75 | }); 76 | } 77 | }); 78 | } 79 | 80 | @override 81 | Widget build(BuildContext context) { 82 | return isAuth ? anaSayfa() : girisSayfasi(); 83 | } 84 | } 85 | 86 | 87 | -------------------------------------------------------------------------------- /Firebase-Verilerle Çalışmak/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:fireworks/services/benimAuthServisim.dart'; 3 | import 'package:fireworks/yonlendirmeSayfasi.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:provider/provider.dart'; 6 | 7 | 8 | void main() => runApp(MyApp()); 9 | 10 | class MyApp extends StatelessWidget { 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Provider( 15 | create: (_) => BenimAuthServisim(), 16 | child: MaterialApp( 17 | debugShowCheckedModeBanner: false, 18 | title: 'Projem', 19 | theme: ThemeData( 20 | primarySwatch: Colors.green, 21 | ), 22 | home: YonlendirmeSayfasi(), 23 | ), 24 | ); 25 | } 26 | } 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Firebase-Verilerle Çalışmak/lib/models/kullanici.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | import 'package:firebase_auth/firebase_auth.dart'; 3 | 4 | class Kullanici { 5 | 6 | final String id; 7 | final String isim; 8 | final String soyad; 9 | final String avatar; 10 | final String eposta; 11 | 12 | Kullanici({this.id, this.isim, this.soyad, this.avatar, this.eposta}); 13 | 14 | factory Kullanici.dokumandanUret(DocumentSnapshot doc){ 15 | return Kullanici( 16 | id: doc.documentID, 17 | isim: doc.data["isim"], 18 | soyad: doc.data["soyad"], 19 | eposta: doc.data["mail"], 20 | avatar: doc.data["avatar"], 21 | ); 22 | } 23 | 24 | factory Kullanici.firebasedenUret(FirebaseUser kullanici){ 25 | return Kullanici( 26 | id: kullanici.uid, 27 | isim: kullanici.displayName, 28 | eposta: kullanici.email, 29 | avatar: kullanici.photoUrl, 30 | ); 31 | } 32 | 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Firebase-Verilerle Çalışmak/lib/services/benimAuthServisim.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:fireworks/models/kullanici.dart'; 3 | 4 | class BenimAuthServisim { 5 | 6 | final FirebaseAuth _firebaseAuth = FirebaseAuth.instance; 7 | 8 | Kullanici _kullaniciOlustur(FirebaseUser firebaseKullanici){ 9 | return firebaseKullanici == null ? null : Kullanici.firebasedenUret(firebaseKullanici); 10 | } 11 | 12 | Stream get durumTakipcisi { 13 | return _firebaseAuth.onAuthStateChanged.map(_kullaniciOlustur); 14 | } 15 | 16 | Future anonimGiris() async { 17 | var authResult = await _firebaseAuth.signInAnonymously(); 18 | return _kullaniciOlustur(authResult.user); 19 | } 20 | 21 | Future cikisYap(){ 22 | return _firebaseAuth.signOut(); 23 | } 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Firebase-Verilerle Çalışmak/lib/streamIleYonlendirme.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | 5 | void main() => runApp(MyApp()); 6 | 7 | class MyApp extends StatelessWidget { 8 | @override 9 | Widget build(BuildContext context) { 10 | return MaterialApp( 11 | debugShowCheckedModeBanner: false, 12 | title: 'Projem', 13 | theme: ThemeData( 14 | primarySwatch: Colors.green, 15 | ), 16 | home: YonlendirmeSayfasi(), 17 | ); 18 | } 19 | } 20 | 21 | class YonlendirmeSayfasi extends StatefulWidget { 22 | 23 | @override 24 | _YonlendirmeSayfasiState createState() => _YonlendirmeSayfasiState(); 25 | } 26 | 27 | class _YonlendirmeSayfasiState extends State { 28 | 29 | anonimGirisYap() async { 30 | AuthResult authResult = await FirebaseAuth.instance.signInAnonymously(); 31 | //print(authResult.user.uid); 32 | //print(authResult.user.email); 33 | //print(authResult.user.displayName); 34 | } 35 | 36 | cikisYap(){ 37 | FirebaseAuth.instance.signOut(); 38 | } 39 | 40 | Widget girisSayfasi(){ 41 | return Scaffold( 42 | body: Center( 43 | child: Container( 44 | height: 80.0, 45 | width: 120.0, 46 | color: Colors.grey, 47 | child: Center(child: InkWell(onTap: () => anonimGirisYap(), child: Text("Giriş Yap"))), 48 | ), 49 | ), 50 | ); 51 | } 52 | 53 | Widget anaSayfa(){ 54 | return Scaffold( 55 | body: Center( 56 | child: InkWell(onTap: ()=>cikisYap(), child: Text("Çıkış Yap")), 57 | ), 58 | ); 59 | } 60 | 61 | 62 | @override 63 | Widget build(BuildContext context) { 64 | return StreamBuilder( 65 | stream: FirebaseAuth.instance.onAuthStateChanged, 66 | builder: (context,snapshot){ 67 | if(snapshot.connectionState == ConnectionState.waiting){ 68 | return Center(child: CircularProgressIndicator()); 69 | } 70 | 71 | if(snapshot.hasData){ 72 | FirebaseUser aktifKullanici = snapshot.data; 73 | print(aktifKullanici.uid); 74 | return anaSayfa(); 75 | } else { 76 | return girisSayfasi(); 77 | } 78 | } 79 | ); 80 | } 81 | } 82 | 83 | 84 | -------------------------------------------------------------------------------- /Firebase-Verilerle Çalışmak/lib/tekliVeriGosterme.dart: -------------------------------------------------------------------------------- 1 | import 'package:fireworks/models/kullanici.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:cloud_firestore/cloud_firestore.dart'; 4 | 5 | 6 | void main() => runApp(MyApp()); 7 | 8 | class MyApp extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | return MaterialApp( 12 | debugShowCheckedModeBanner: false, 13 | title: 'Projem', 14 | theme: ThemeData( 15 | primarySwatch: Colors.green, 16 | ), 17 | home: AnaSayfa(), 18 | ); 19 | } 20 | } 21 | 22 | class AnaSayfa extends StatefulWidget { 23 | @override 24 | _AnaSayfaState createState() => _AnaSayfaState(); 25 | } 26 | 27 | class _AnaSayfaState extends State { 28 | 29 | final db = Firestore.instance; 30 | 31 | 32 | @override 33 | void initState() { 34 | super.initState(); 35 | 36 | } 37 | 38 | @override 39 | Widget build(BuildContext context) { 40 | return Scaffold( 41 | body: StreamBuilder( 42 | stream: db.collection("kullanıcılar").document("80o7t8ebMg4QMBsTHRF5").snapshots(), 43 | builder: (context,snapshot){ 44 | 45 | if(!snapshot.hasData){ 46 | return CircularProgressIndicator(); 47 | } 48 | 49 | Kullanici kullanici = Kullanici.dokumandanUret(snapshot.data); 50 | 51 | return ListTile( 52 | title: Text(kullanici.isim + " " + kullanici.soyad), 53 | subtitle: Text(kullanici.eposta), 54 | leading: Image.network( 55 | kullanici.avatar, 56 | width: 50.0, 57 | height: 50.0, 58 | fit: BoxFit.cover, 59 | ), 60 | ); 61 | } 62 | ) 63 | ); 64 | } 65 | } 66 | 67 | 68 | -------------------------------------------------------------------------------- /Firebase-Verilerle Çalışmak/lib/veriCekme.dart: -------------------------------------------------------------------------------- 1 | import 'package:fireworks/models/kullanici.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:cloud_firestore/cloud_firestore.dart'; 4 | 5 | 6 | void main() => runApp(MyApp()); 7 | 8 | class MyApp extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | return MaterialApp( 12 | debugShowCheckedModeBanner: false, 13 | title: 'Projem', 14 | theme: ThemeData( 15 | primarySwatch: Colors.green, 16 | ), 17 | home: AnaSayfa(), 18 | ); 19 | } 20 | } 21 | 22 | class AnaSayfa extends StatefulWidget { 23 | @override 24 | _AnaSayfaState createState() => _AnaSayfaState(); 25 | } 26 | 27 | class _AnaSayfaState extends State { 28 | 29 | final db = Firestore.instance; 30 | 31 | 32 | void kullanicilariGetir() async { 33 | 34 | var snapshot = await db.collection("kullanıcılar").getDocuments(); 35 | snapshot.documents.forEach((doc) { 36 | print(doc.data); 37 | }); 38 | 39 | 40 | } 41 | 42 | void kimlikIleKullaniciGetir() async { 43 | 44 | var doc = await db.collection("kullanıcılar").document("dsfdsfs").get(); 45 | 46 | if(doc.exists){ 47 | print(doc.data); 48 | } else { 49 | print("Böyle bir döküman bulunmuyor."); 50 | } 51 | 52 | 53 | } 54 | 55 | void kullanicilariSirala() async { 56 | 57 | var snapshot = await db.collection("kullanıcılar").orderBy("yaş", descending: true).getDocuments(); 58 | snapshot.documents.forEach((doc) { 59 | print(doc.data); 60 | }); 61 | 62 | 63 | } 64 | 65 | void kullaniciSorgula() async { 66 | 67 | var snapshot = await db.collection("kullanıcılar").where("yaş", isLessThanOrEqualTo: 60).getDocuments(); 68 | snapshot.documents.forEach((doc) { 69 | print(doc.data); 70 | }); 71 | 72 | 73 | } 74 | 75 | void kullaniciCokluSorgu() async { 76 | 77 | QuerySnapshot snapshot = await db.collection("kullanıcılar").where("soyad", isEqualTo: "Kurt").where("yaş", isGreaterThan: 20).limit(1).getDocuments(); 78 | snapshot.documents.forEach((DocumentSnapshot doc) { 79 | print(doc.data); 80 | }); 81 | 82 | 83 | } 84 | 85 | void kullaniciOlustur() async { 86 | var doc = await db.collection("kullanıcılar").document("80o7t8ebMg4QMBsTHRF5").get(); 87 | 88 | Kullanici kullanici_1 = Kullanici.dokumandanUret(doc); 89 | 90 | print(kullanici_1.id); 91 | print(kullanici_1.isim); 92 | print(kullanici_1.soyad); 93 | print(kullanici_1.eposta); 94 | print(kullanici_1.avatar); 95 | } 96 | 97 | @override 98 | void initState() { 99 | super.initState(); 100 | kullaniciOlustur(); 101 | } 102 | 103 | @override 104 | Widget build(BuildContext context) { 105 | return Scaffold( 106 | body: Center(), 107 | ); 108 | } 109 | } 110 | 111 | 112 | -------------------------------------------------------------------------------- /Firebase-Verilerle Çalışmak/lib/yazmaIslemleri.dart: -------------------------------------------------------------------------------- 1 | import 'package:fireworks/models/kullanici.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:cloud_firestore/cloud_firestore.dart'; 4 | 5 | 6 | void main() => runApp(MyApp()); 7 | 8 | class MyApp extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | return MaterialApp( 12 | debugShowCheckedModeBanner: false, 13 | title: 'Projem', 14 | theme: ThemeData( 15 | primarySwatch: Colors.green, 16 | ), 17 | home: AnaSayfa(), 18 | ); 19 | } 20 | } 21 | 22 | class AnaSayfa extends StatefulWidget { 23 | @override 24 | _AnaSayfaState createState() => _AnaSayfaState(); 25 | } 26 | 27 | class _AnaSayfaState extends State { 28 | 29 | final db = Firestore.instance; 30 | 31 | kullaniciEkle(){ 32 | db.collection("kullanıcılar").add({ 33 | "isim":"Hakan", 34 | "soyad":"Demir", 35 | "mail":"hdemir@mailim.com" 36 | }).then((makbuz) => print(makbuz.documentID)).catchError((hata){print("Kullanıcı eklenemedi: $hata");}); 37 | } 38 | 39 | kimlikIleKullaniciEkle(){ 40 | db.collection("kullanıcılar").document("abc").setData({ 41 | "isim":"Hakan", 42 | "soyad":"Demir", 43 | "mail":"hdemir@mailim.com" 44 | }).then((_) => print("Döküman girildi.")).catchError((hata){print("Kullanıcı eklenemedi: $hata");}); 45 | } 46 | 47 | kullaniciGuncelle(){ 48 | db.collection("kullanıcılar").document("abc").updateData({ 49 | "isim":"Zeynep", 50 | "soyad":"Tunç", 51 | "mail":"ztunc@mailim.com" 52 | }).then((_) => print("Döküman güncellendi.")).catchError((hata){print("Hata oluştu: $hata");}); 53 | } 54 | 55 | kullaniciSil(){ 56 | db.collection("kullanıcılar").document("abc").delete().then((_) => print("Döküman silindi.")).catchError((hata){print("Hata oluştu: $hata");}); 57 | } 58 | 59 | 60 | @override 61 | void initState() { 62 | super.initState(); 63 | kullaniciSil(); 64 | } 65 | 66 | 67 | @override 68 | Widget build(BuildContext context) { 69 | return Scaffold( 70 | body: StreamBuilder( 71 | stream: db.collection("kullanıcılar").snapshots(), 72 | builder: (context,snapshot){ 73 | 74 | if(!snapshot.hasData){ 75 | return CircularProgressIndicator(); 76 | } 77 | 78 | List kullanicilar = snapshot.data.documents.map((doc) => Kullanici.dokumandanUret(doc)).toList(); 79 | 80 | return ListView.builder( 81 | itemCount: kullanicilar.length, 82 | itemBuilder: (context,pozisyon){ 83 | return ListTile( 84 | title: Text(kullanicilar[pozisyon].isim), 85 | subtitle: Text(kullanicilar[pozisyon].eposta), 86 | ); 87 | } 88 | ); 89 | 90 | } 91 | ) 92 | ); 93 | } 94 | } 95 | 96 | 97 | -------------------------------------------------------------------------------- /Firebase-Verilerle Çalışmak/readme.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Firebase-Verilerle Çalışmak/services/readme.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Giriş Sayfası UI/assets/robot-2192617_640.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superknowa/flutter/0fa7f7c43f9c67a3854dd722cc8c64aaca375b62/Giriş Sayfası UI/assets/robot-2192617_640.png -------------------------------------------------------------------------------- /Giriş Sayfası UI/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | void main() => runApp(MyApp()); 4 | 5 | class MyApp extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return MaterialApp( 9 | debugShowCheckedModeBanner: false, 10 | title: 'Projem', 11 | theme: ThemeData( 12 | primarySwatch: Colors.purple, 13 | ), 14 | home: GirisSayfasi(), 15 | ); 16 | } 17 | } 18 | 19 | class GirisSayfasi extends StatelessWidget { 20 | @override 21 | Widget build(BuildContext context) { 22 | return Scaffold( 23 | backgroundColor: Theme.of(context).primaryColor, 24 | body: Center( 25 | child: Column( 26 | children: [ 27 | SizedBox( 28 | height: 55.0, 29 | ), 30 | Container( 31 | width: 120.0, 32 | height: 120.0, 33 | decoration: BoxDecoration( 34 | image: DecorationImage(image: AssetImage("assets/robot-2192617_640.png")) 35 | ), 36 | ), 37 | SizedBox( 38 | height: 25.0, 39 | ), 40 | Text("Sociaworld", 41 | style: TextStyle( 42 | color: Colors.white, 43 | fontSize: 30.0, 44 | fontWeight: FontWeight.bold)), 45 | SizedBox( 46 | height: 35.0, 47 | ), 48 | Material( 49 | borderRadius: BorderRadius.circular(20.0), 50 | elevation: 7.0, 51 | child: Container( 52 | child: Column( 53 | mainAxisAlignment: MainAxisAlignment.center, 54 | children: [ 55 | Padding( 56 | padding: const EdgeInsets.all(12.0), 57 | child: Container( 58 | alignment: Alignment.center, 59 | child: Text( 60 | "Mail İle Giriş", 61 | style: TextStyle( 62 | fontSize: 18.0, 63 | fontWeight: FontWeight.bold, 64 | color: Colors.white), 65 | ), 66 | width: double.infinity, 67 | height: 52.0, 68 | decoration: BoxDecoration( 69 | color: Colors.purple, 70 | borderRadius: BorderRadius.circular(20.0)), 71 | ), 72 | ), 73 | Padding( 74 | padding: const EdgeInsets.all(12.0), 75 | child: Row( 76 | children: [ 77 | Expanded( 78 | child: Container( 79 | alignment: Alignment.center, 80 | child: Text( 81 | "Facebook Giriş", 82 | style: TextStyle( 83 | fontSize: 18.0, 84 | fontWeight: FontWeight.bold, 85 | color: Colors.white), 86 | ), 87 | height: 52.0, 88 | decoration: BoxDecoration( 89 | color: Colors.indigo, 90 | borderRadius: BorderRadius.circular(20.0)), 91 | ), 92 | ), 93 | SizedBox( 94 | width: 10.0, 95 | ), 96 | Expanded( 97 | child: Container( 98 | alignment: Alignment.center, 99 | child: Text( 100 | "Gmail Giriş", 101 | style: TextStyle( 102 | fontSize: 18.0, 103 | fontWeight: FontWeight.bold, 104 | color: Colors.white), 105 | ), 106 | height: 52.0, 107 | decoration: BoxDecoration( 108 | color: Color.fromARGB(255, 227, 66, 100), 109 | borderRadius: BorderRadius.circular(20.0)), 110 | ), 111 | ) 112 | ], 113 | ), 114 | ), 115 | ], 116 | ), 117 | decoration: BoxDecoration( 118 | gradient: LinearGradient( 119 | begin: Alignment.topLeft, 120 | end: Alignment.bottomRight, 121 | colors: [ 122 | Colors.purple[300], 123 | Colors.purple[100], 124 | ]), 125 | color: Colors.white, 126 | borderRadius: BorderRadius.circular(20.0)), 127 | alignment: Alignment.center, 128 | width: MediaQuery.of(context).size.width - 70.0, 129 | height: 180.0, 130 | ), 131 | ) 132 | ], 133 | ), 134 | )); 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /Giriş Sayfası UI/readme.md: -------------------------------------------------------------------------------- 1 | Giriş sayfası arayüz çalışması kodları ve kullanılan assetler 2 | -------------------------------------------------------------------------------- /Hataların Çözümleri/cloud_firestore_web not found Hatasının çözümü: -------------------------------------------------------------------------------- 1 | android/settings.gradle içindeki kodları aşağıdaki kodlarla değiştir. 2 | 3 | 4 | include ':app' 5 | 6 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 7 | 8 | def plugins = new Properties() 9 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 10 | if (pluginsFile.exists()) { 11 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 12 | } 13 | 14 | plugins.each { name, path -> 15 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 16 | include ":$name" 17 | project(":$name").projectDir = pluginDirectory 18 | } 19 | 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flutter & Dart: Sıfırdan Mobil App Geliştiriciliğine 2 | Kursta yapılan çalışmalar 3 | -------------------------------------------------------------------------------- /SnackBar Örneği-Anahtar Yaptırmak.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | void main() => runApp(MyApp()); 4 | 5 | class MyApp extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return MaterialApp( 9 | debugShowCheckedModeBanner: false, 10 | title: 'Projem', 11 | theme: ThemeData( 12 | primarySwatch: Colors.green, 13 | ), 14 | home: Mesaj(), 15 | ); 16 | } 17 | } 18 | 19 | class Mesaj extends StatelessWidget { 20 | 21 | final GlobalKey anahtar = GlobalKey(); 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return Scaffold( 26 | key: anahtar, 27 | appBar: AppBar(), 28 | body: RaisedButton( 29 | onPressed: () { 30 | anahtar.currentState.showSnackBar(SnackBar( 31 | content: Text( 32 | "Merhaba", 33 | style: TextStyle(color: Colors.red), 34 | ))); 35 | }, 36 | child: Text("Mesaj At"), 37 | )); 38 | } 39 | } 40 | 41 | 42 | -------------------------------------------------------------------------------- /SnackBar Örneği-Builder Widgetı.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | void main() => runApp(MyApp()); 4 | 5 | class MyApp extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return MaterialApp( 9 | debugShowCheckedModeBanner: false, 10 | title: 'Projem', 11 | theme: ThemeData( 12 | primarySwatch: Colors.green, 13 | ), 14 | home: Mesaj(), 15 | ); 16 | } 17 | } 18 | 19 | class Mesaj extends StatelessWidget { 20 | @override 21 | Widget build(BuildContext context) { 22 | return Scaffold( 23 | appBar: AppBar(), 24 | body: Builder(builder: (BuildContext context) { 25 | return RaisedButton( 26 | onPressed: () { 27 | Scaffold.of(context).showSnackBar(SnackBar( 28 | content: Text( 29 | "Merhaba", 30 | style: TextStyle(color: Colors.red), 31 | ))); 32 | }, 33 | child: Text("Mesaj At"), 34 | ); 35 | })); 36 | } 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /SnackBar Örneği-Yeni Widgetı.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | void main() => runApp(MyApp()); 4 | 5 | class MyApp extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return MaterialApp( 9 | debugShowCheckedModeBanner: false, 10 | title: 'Projem', 11 | theme: ThemeData( 12 | primarySwatch: Colors.green, 13 | ), 14 | home: Mesaj(), 15 | ); 16 | } 17 | } 18 | 19 | class Mesaj extends StatelessWidget { 20 | @override 21 | Widget build(BuildContext context) { 22 | return Scaffold( 23 | appBar: AppBar(), 24 | body: Yeni() 25 | ); 26 | } 27 | } 28 | 29 | class Yeni extends StatelessWidget { 30 | const Yeni({ 31 | Key key, 32 | }) : super(key: key); 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | return RaisedButton(onPressed: (){ 37 | 38 | Scaffold.of(context).showSnackBar(SnackBar(content: Text("Merhaba",style: TextStyle(color: Colors.red),))); 39 | 40 | },child: Text("Mesaj At"),); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Sociaworld Ana Sayfa Ve Profil Sayfası UI/lib/gonderikarti.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class GonderiKarti extends StatelessWidget { 4 | 5 | final String profilResimLinki; 6 | final String isimSoyad; 7 | final String gecenSure; 8 | final String gonderiResimLinki; 9 | final String aciklama; 10 | 11 | const GonderiKarti({Key key, this.profilResimLinki, this.isimSoyad, this.gecenSure, this.gonderiResimLinki, this.aciklama}) : super(key: key); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Padding( 16 | padding: const EdgeInsets.all(15.0), 17 | child: Material( 18 | elevation: 1.0, 19 | borderRadius: BorderRadius.circular(12.0), 20 | child: Container( 21 | padding: EdgeInsets.all(15.0), 22 | width: double.infinity, 23 | height: 388.0, 24 | decoration: BoxDecoration( 25 | borderRadius: BorderRadius.circular(12.0), color: Colors.white), 26 | child: Column( 27 | crossAxisAlignment: CrossAxisAlignment.start, 28 | children: [ 29 | Row( 30 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 31 | children: [ 32 | Row( 33 | children: [ 34 | Container( 35 | width: 50.0, 36 | height: 50.0, 37 | decoration: BoxDecoration( 38 | borderRadius: BorderRadius.circular(30.0), 39 | color: Colors.indigo, 40 | image: DecorationImage( 41 | image: NetworkImage( 42 | profilResimLinki 43 | ), 44 | fit: BoxFit.cover)), 45 | ), 46 | SizedBox( 47 | width: 12.0, 48 | ), 49 | Column( 50 | crossAxisAlignment: CrossAxisAlignment.start, 51 | children: [ 52 | Text( 53 | isimSoyad, 54 | style: TextStyle( 55 | fontSize: 15.0, 56 | fontWeight: FontWeight.bold, 57 | color: Colors.black, 58 | ), 59 | ), 60 | Text( 61 | gecenSure, 62 | style: TextStyle( 63 | fontSize: 12.0, 64 | fontWeight: FontWeight.bold, 65 | color: Colors.grey), 66 | ) 67 | ], 68 | ), 69 | ], 70 | ), 71 | Icon(Icons.more_vert) 72 | ], 73 | ), 74 | SizedBox( 75 | height: 15.0, 76 | ), 77 | Text(aciklama, 78 | style: TextStyle( 79 | fontSize: 18.0, 80 | color: Colors.grey, 81 | )), 82 | SizedBox( 83 | height: 20.0, 84 | ), 85 | Image.network( 86 | gonderiResimLinki, 87 | width: double.infinity, 88 | height: 200.0, 89 | fit: BoxFit.cover, 90 | ), 91 | SizedBox( 92 | height: 4.0, 93 | ), 94 | Row( 95 | mainAxisAlignment: MainAxisAlignment.spaceAround, 96 | children: [ 97 | IkonluButonum( 98 | ikonum: Icons.favorite, 99 | yazi: "Beğen", 100 | fonksiyonum: () { 101 | print("Beğen"); 102 | }, 103 | ), 104 | IkonluButonum( 105 | ikonum: Icons.comment, 106 | yazi: "Yorum Yap", 107 | fonksiyonum: () { 108 | print("Yorum"); 109 | }, 110 | ), 111 | FlatButton.icon( 112 | onPressed: () {}, 113 | icon: Icon( 114 | Icons.share, 115 | color: Colors.grey, 116 | ), 117 | label: Text("Paylaş", 118 | style: TextStyle( 119 | color: Colors.grey, fontWeight: FontWeight.bold))) 120 | ], 121 | ) 122 | ], 123 | ), 124 | ), 125 | ), 126 | ); 127 | } 128 | } 129 | 130 | class IkonluButonum extends StatelessWidget { 131 | final IconData ikonum; 132 | final String yazi; 133 | final fonksiyonum; 134 | 135 | IkonluButonum({this.ikonum, this.yazi, this.fonksiyonum}); 136 | 137 | @override 138 | Widget build(BuildContext context) { 139 | return Material( 140 | color: Colors.white, 141 | child: InkWell( 142 | onTap: fonksiyonum, 143 | child: Container( 144 | padding: EdgeInsets.all(8.0), 145 | child: Row( 146 | children: [ 147 | Icon( 148 | ikonum, 149 | color: Colors.grey, 150 | ), 151 | SizedBox( 152 | width: 8.0, 153 | ), 154 | Text(yazi, 155 | style: TextStyle( 156 | fontWeight: FontWeight.bold, 157 | color: Colors.grey, 158 | )) 159 | ], 160 | ), 161 | ), 162 | ), 163 | ); 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /Sociaworld Ana Sayfa Ve Profil Sayfası UI/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:sociaworld/gonderikarti.dart'; 4 | import 'package:sociaworld/profilsayfasi.dart'; 5 | 6 | void main() => runApp(MyApp()); 7 | 8 | class MyApp extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | return MaterialApp( 12 | debugShowCheckedModeBanner: false, 13 | title: 'Projem', 14 | theme: ThemeData( 15 | primarySwatch: Colors.green, 16 | ), 17 | home: AnaSayfa(), 18 | ); 19 | } 20 | } 21 | 22 | class AnaSayfa extends StatefulWidget { 23 | @override 24 | _AnaSayfaState createState() => _AnaSayfaState(); 25 | } 26 | 27 | class _AnaSayfaState extends State { 28 | @override 29 | Widget build(BuildContext context) { 30 | return Scaffold( 31 | backgroundColor: Colors.grey[100], 32 | appBar: AppBar( 33 | backgroundColor: Colors.grey[100], 34 | elevation: 0.0, 35 | leading: IconButton( 36 | icon: Icon( 37 | Icons.menu, 38 | color: Colors.grey, 39 | size: 32.0, 40 | ), 41 | onPressed: () {}), 42 | title: Text( 43 | "Sociaworld", 44 | style: TextStyle(fontSize: 20.0, color: Colors.grey), 45 | ), 46 | centerTitle: true, 47 | actions: [ 48 | IconButton( 49 | icon: Icon( 50 | Icons.notifications, 51 | color: Colors.purple[300], 52 | size: 32.0, 53 | ), 54 | onPressed: () { 55 | showModalBottomSheet(context: context, builder: (BuildContext context){ 56 | return Column( 57 | children: [ 58 | duyuru("Kamil seni takip etti","3 dk önce"), 59 | duyuru("Seda gönderine yorum yaptı","1 gün önce"), 60 | duyuru("Cüneyt mesaj gönderdi","2 hafta önce"), 61 | ], 62 | ); 63 | }); 64 | }) 65 | ], 66 | ), 67 | body: ListView( 68 | children: [ 69 | Container( 70 | height: 100.0, 71 | decoration: BoxDecoration(color: Colors.grey[100], boxShadow: [ 72 | BoxShadow( 73 | color: Colors.grey, 74 | offset: Offset(0.0, 3.0), 75 | blurRadius: 5.0), 76 | ]), 77 | child: ListView( 78 | scrollDirection: Axis.horizontal, 79 | children: [ 80 | profilKartiOlustur( 81 | "Selçuk", 82 | "https://cdn.pixabay.com/photo/2016/03/09/15/10/man-1246508_960_720.jpg", 83 | "Selçuk Mert", 84 | "https://cdn.pixabay.com/photo/2013/11/28/10/36/road-220058_960_720.jpg" 85 | ), 86 | profilKartiOlustur( 87 | "Tom", 88 | "https://cdn.pixabay.com/photo/2018/03/13/15/01/male-3222718_960_720.jpg", 89 | "Tom Watson", 90 | "https://cdn.pixabay.com/photo/2020/05/30/17/18/wind-power-plant-5239642_960_720.jpg" 91 | ), 92 | profilKartiOlustur( 93 | "Jessica", 94 | "https://cdn.pixabay.com/photo/2020/04/22/21/51/mannequin-5080215_960_720.jpg", 95 | "Jessica Lopez", 96 | "https://cdn.pixabay.com/photo/2015/12/01/20/28/road-1072823_960_720.jpg" 97 | ), 98 | profilKartiOlustur( 99 | "Belma", 100 | "https://cdn.pixabay.com/photo/2018/01/21/14/16/woman-3096664_960_720.jpg", 101 | "Belma Zorlu", 102 | "https://cdn.pixabay.com/photo/2017/11/28/22/25/lapland-2984828_960_720.jpg" 103 | ), 104 | profilKartiOlustur( 105 | "Yıldız", 106 | "https://cdn.pixabay.com/photo/2017/03/02/20/25/woman-2112292_960_720.jpg", 107 | "Yıldız Mars", 108 | "https://cdn.pixabay.com/photo/2015/03/26/09/47/sky-690293_960_720.jpg" 109 | ), 110 | profilKartiOlustur( 111 | "Nadir", 112 | "https://cdn.pixabay.com/photo/2016/11/18/19/07/happy-1836445_960_720.jpg", 113 | "Nadir Çakıl", 114 | "https://cdn.pixabay.com/photo/2016/11/06/05/36/landscape-1802337_960_720.jpg" 115 | ), 116 | ], 117 | ), 118 | ), 119 | SizedBox( 120 | height: 10.0, 121 | ), 122 | GonderiKarti( 123 | isimSoyad: "Hakan Yaldız", 124 | gecenSure: "1 sene önce", 125 | aciklama: "Geçen yaz çekildim", 126 | profilResimLinki: 127 | "https://cdn.pixabay.com/photo/2015/03/03/20/42/man-657869_960_720.jpg", 128 | gonderiResimLinki: 129 | "https://cdn.pixabay.com/photo/2019/08/07/14/11/dog-4390885_960_720.jpg", 130 | ), 131 | GonderiKarti( 132 | isimSoyad: "Selda Mert", 133 | gecenSure: "2 ay önce", 134 | aciklama: "Manzaraya hayran kaldım", 135 | profilResimLinki: 136 | "https://cdn.pixabay.com/photo/2019/11/03/05/36/portrait-4597853_960_720.jpg", 137 | gonderiResimLinki: 138 | "https://cdn.pixabay.com/photo/2016/05/05/02/37/sunset-1373171_960_720.jpg", 139 | ), 140 | ], 141 | ), 142 | floatingActionButton: FloatingActionButton( 143 | onPressed: null, 144 | backgroundColor: Colors.purple[300], 145 | child: Icon(Icons.add_a_photo,color: Colors.white,), 146 | ) 147 | ); 148 | } 149 | 150 | Padding duyuru(String mesaj, String gecenSure) { 151 | return Padding( 152 | padding: const EdgeInsets.all(12.0), 153 | child: Row( 154 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 155 | children: [ 156 | Text(mesaj,style: TextStyle(fontSize: 15.0),), 157 | Text(gecenSure) 158 | ], 159 | ), 160 | ); 161 | } 162 | 163 | Widget profilKartiOlustur(String kullaniciAdi, String resimLinki, 164 | String isimSoyad, String kapakResimLinki) { 165 | return Material( 166 | child: InkWell( 167 | onTap: () async { 168 | bool donenVeri= await Navigator.of(context).push(MaterialPageRoute( 169 | builder: (BuildContext context) => ProfilSayfasi( 170 | profilResimlinki: resimLinki, 171 | kullaniciAdi: kullaniciAdi, 172 | isimSoyad: isimSoyad, 173 | kapakResimlinki: kapakResimLinki, 174 | ))); 175 | 176 | if(donenVeri){ 177 | print("Kullanıcı profil sayfasından döndü."); 178 | } 179 | }, 180 | child: Padding( 181 | padding: const EdgeInsets.only(left: 8.0, right: 8.0), 182 | child: Column( 183 | children: [ 184 | Stack( 185 | alignment: Alignment.topRight, 186 | children: [ 187 | Hero( 188 | tag: kullaniciAdi, 189 | child: Container( 190 | width: 70.0, 191 | height: 70.0, 192 | decoration: BoxDecoration( 193 | color: Colors.white, 194 | border: Border.all(width: 2.0, color: Colors.grey), 195 | borderRadius: BorderRadius.circular(35.0), 196 | image: DecorationImage( 197 | image: NetworkImage(resimLinki), 198 | fit: BoxFit.cover)), 199 | ), 200 | ), 201 | Container( 202 | width: 20.0, 203 | height: 20.0, 204 | decoration: BoxDecoration( 205 | color: Colors.green, 206 | borderRadius: BorderRadius.circular(25.0), 207 | border: Border.all(width: 2.0, color: Colors.white)), 208 | ) 209 | ], 210 | ), 211 | SizedBox( 212 | height: 4.0, 213 | ), 214 | Text( 215 | kullaniciAdi, 216 | style: TextStyle(fontSize: 15.0, color: Colors.black), 217 | ) 218 | ], 219 | ), 220 | ), 221 | ), 222 | ); 223 | } 224 | } 225 | -------------------------------------------------------------------------------- /Sociaworld Ana Sayfa Ve Profil Sayfası UI/lib/profilsayfasi.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:sociaworld/gonderikarti.dart'; 3 | 4 | class ProfilSayfasi extends StatelessWidget { 5 | 6 | final String isimSoyad; 7 | final String kullaniciAdi; 8 | final String kapakResimlinki; 9 | final String profilResimlinki; 10 | 11 | const ProfilSayfasi({Key key, this.isimSoyad, this.kullaniciAdi, this.kapakResimlinki, this.profilResimlinki}) : super(key: key); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Scaffold( 16 | backgroundColor: Colors.grey[100], 17 | body: ListView( 18 | children: [ 19 | Stack( 20 | children: [ 21 | 22 | Container( 23 | height: 230.0, 24 | //color: Colors.yellow, 25 | ), 26 | 27 | Container( 28 | height: 180.0, 29 | decoration: BoxDecoration( 30 | color: Colors.green, 31 | image: DecorationImage( 32 | image: NetworkImage(kapakResimlinki), 33 | fit: BoxFit.cover 34 | ) 35 | ), 36 | ), 37 | 38 | Positioned( 39 | left: 20.0, 40 | bottom: 0.0, 41 | child: Hero( 42 | tag: kullaniciAdi, 43 | child: Container( 44 | width: 120.0, 45 | height: 120.0, 46 | decoration: BoxDecoration( 47 | color: Colors.lightBlue, 48 | borderRadius: BorderRadius.circular(60.0), 49 | border: Border.all(width: 2.0,color: Colors.white), 50 | image: DecorationImage( 51 | image: NetworkImage(profilResimlinki), 52 | fit: BoxFit.cover 53 | ) 54 | ), 55 | ), 56 | ), 57 | ), 58 | 59 | Positioned( 60 | top: 190.0, 61 | left: 145.0, 62 | child: Column( 63 | crossAxisAlignment: CrossAxisAlignment.start, 64 | children: [ 65 | Text( 66 | isimSoyad, 67 | style: TextStyle( 68 | fontSize: 18.0, 69 | fontWeight: FontWeight.bold, 70 | color: Colors.black 71 | ), 72 | ), 73 | Text( 74 | kullaniciAdi, 75 | style: TextStyle( 76 | fontSize: 15.0, 77 | fontWeight: FontWeight.bold, 78 | color: Colors.grey 79 | ), 80 | ) 81 | ], 82 | ), 83 | ), 84 | 85 | Positioned( 86 | top: 130.0, 87 | right: 15.0, 88 | child: Container( 89 | width: 100.0, 90 | height: 40.0, 91 | decoration: BoxDecoration( 92 | borderRadius: BorderRadius.circular(15.0), 93 | color: Colors.grey[200], 94 | border: Border.all(width: 2.0,color: Colors.white) 95 | ), 96 | child: Row( 97 | mainAxisAlignment: MainAxisAlignment.center, 98 | children: [ 99 | Icon(Icons.add_circle,size: 18.0,), 100 | SizedBox(width: 2.0,), 101 | Text( 102 | "Takip Et", 103 | style: TextStyle( 104 | fontSize: 15.0, 105 | fontWeight: FontWeight.bold, 106 | color: Colors.black 107 | ) 108 | ) 109 | ], 110 | ), 111 | ), 112 | ), 113 | 114 | IconButton(icon: Icon(Icons.arrow_back,color: Colors.black,), onPressed: (){ 115 | Navigator.pop(context,true); 116 | }) 117 | 118 | ], 119 | ), 120 | SizedBox(height: 20.0,), 121 | Container( 122 | height: 75.0, 123 | color: Colors.grey.withOpacity(0.1), 124 | child: Row( 125 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 126 | children: [ 127 | 128 | sayac("Takipçi","20K"), 129 | sayac("Takip","500"), 130 | sayac("Paylaşım","75") 131 | 132 | 133 | ], 134 | ), 135 | ), 136 | GonderiKarti( 137 | isimSoyad: "Selda Mert", 138 | gecenSure: "2 ay önce", 139 | aciklama: "Manzaraya hayran kaldım", 140 | profilResimLinki: "https://cdn.pixabay.com/photo/2019/11/03/05/36/portrait-4597853_960_720.jpg", 141 | gonderiResimLinki: "https://cdn.pixabay.com/photo/2016/05/05/02/37/sunset-1373171_960_720.jpg", 142 | ), 143 | ], 144 | ), 145 | ); 146 | } 147 | 148 | Column sayac(String baslik, String sayi) { 149 | return Column( 150 | mainAxisAlignment: MainAxisAlignment.center, 151 | children: [ 152 | Text( 153 | sayi, 154 | style: TextStyle( 155 | fontSize: 18.0, 156 | fontWeight: FontWeight.bold, 157 | color: Colors.black 158 | ) 159 | ), 160 | SizedBox(height: 1.0,), 161 | Text( 162 | baslik, 163 | style: TextStyle( 164 | fontSize: 15.0, 165 | fontWeight: FontWeight.bold, 166 | color: Colors.grey[600] 167 | ) 168 | ) 169 | ], 170 | ); 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /Sociaworld Ana Sayfa Ve Profil Sayfası UI/readme.md: -------------------------------------------------------------------------------- 1 | Sociaworld dosyaları 2 | -------------------------------------------------------------------------------- /Stateful Widget Örneği.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | void main() => runApp(MyApp()); 4 | 5 | class MyApp extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return MaterialApp( 9 | debugShowCheckedModeBanner: false, 10 | title: 'Projem', 11 | theme: ThemeData( 12 | primarySwatch: Colors.green, 13 | ), 14 | home: Sayac( 15 | isim: "Bardak", 16 | ), 17 | ); 18 | } 19 | } 20 | 21 | class Sayac extends StatefulWidget { 22 | final String isim; 23 | 24 | Sayac({this.isim}); 25 | 26 | @override 27 | _SayacState createState() => _SayacState(); 28 | } 29 | 30 | class _SayacState extends State { 31 | int sayi = 0; 32 | 33 | @override 34 | Widget build(BuildContext context) { 35 | return Scaffold( 36 | appBar: AppBar(), 37 | body: Text("${widget.isim} sayısı:$sayi"), 38 | floatingActionButton: FloatingActionButton(onPressed: ()=>ekle()), 39 | ); 40 | } 41 | 42 | void ekle() { 43 | setState(() { 44 | sayi++; 45 | print(sayi); 46 | }); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Stateless Widget - Kimlik - Column.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | void main() => runApp(MyApp()); 4 | 5 | class MyApp extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return MaterialApp( 9 | title: 'İlk Projem', 10 | theme: ThemeData( 11 | primarySwatch: Colors.green, 12 | ), 13 | home: Scaffold( 14 | appBar: AppBar(), 15 | body: Column( 16 | children: [ 17 | Kimlik("Hakan","Turşu",40), 18 | Kimlik("Oğuz","Hızlı",30), 19 | Kimlik("Namık","Uçar",20), 20 | ], 21 | )), 22 | ); 23 | } 24 | } 25 | 26 | class Kimlik extends StatelessWidget { 27 | final String isim; 28 | final String soyad; 29 | final int yas; 30 | 31 | Kimlik(this.isim, this.soyad, this.yas); 32 | 33 | @override 34 | Widget build(BuildContext context) { 35 | return Text("İsim: $isim Soyad: $soyad Yaş: $yas"); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Stateless Widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | void main() => runApp(MyApp()); 4 | 5 | class MyApp extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return MaterialApp( 9 | title: 'İlk Projem', 10 | theme: ThemeData( 11 | primarySwatch: Colors.green, 12 | ), 13 | home: Scaffold( 14 | appBar: AppBar(), 15 | body: Center(child: Yazi("Profil")) 16 | ), 17 | ); 18 | } 19 | } 20 | 21 | class Yazi extends StatelessWidget { 22 | 23 | final String icerik; 24 | 25 | Yazi(this.icerik); 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return Text( 30 | icerik 31 | ); 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /Uçarak Gelsin Market UI/lib/kategori.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:fmarket/urun_detay.dart'; 3 | 4 | class Kategori extends StatefulWidget { 5 | final String kategori; 6 | 7 | const Kategori({Key key, this.kategori}) : super(key: key); 8 | 9 | @override 10 | _KategoriState createState() => _KategoriState(); 11 | } 12 | 13 | class _KategoriState extends State { 14 | List gosterilecekListe; 15 | 16 | @override 17 | void initState() { 18 | super.initState(); 19 | 20 | if (widget.kategori == "temel gıda") { 21 | gosterilecekListe = [ 22 | urunKarti( 23 | "Zeytin Yağı", 24 | "23.50 TL", 25 | "https://cdn.pixabay.com/photo/2016/05/24/13/29/olive-oil-1412361_960_720.jpg", 26 | mevcut: true, 27 | ), 28 | urunKarti( 29 | "Süt", 30 | "3.50 TL", 31 | "https://cdn.pixabay.com/photo/2020/06/19/06/41/almond-5315905_960_720.jpg", 32 | ), 33 | urunKarti( 34 | "Et 1 Kg", 35 | "30 TL", 36 | "https://cdn.pixabay.com/photo/2019/10/05/09/38/meal-4527484_960_720.jpg", 37 | ), 38 | urunKarti( 39 | "Yumurta 8'li", 40 | "12.50 TL", 41 | "https://cdn.pixabay.com/photo/2020/04/08/13/49/egg-5017474_960_720.jpg", 42 | mevcut: true, 43 | ), 44 | urunKarti( 45 | "Makarna", 46 | "15.50 TL", 47 | "https://cdn.pixabay.com/photo/2010/12/13/10/00/background-2093_960_720.jpg", 48 | ), 49 | urunKarti( 50 | "Çay", 51 | "30 TL", 52 | "https://cdn.pixabay.com/photo/2016/03/12/13/25/tee-1252000_960_720.jpg", 53 | ), 54 | urunKarti( 55 | "Ketçap", 56 | "10.50 TL", 57 | "https://cdn.pixabay.com/photo/2016/06/10/15/16/tomatoes-1448267_960_720.jpg", 58 | ), 59 | urunKarti( 60 | "Un 5 Kg", 61 | "25 TL", 62 | "https://cdn.pixabay.com/photo/2016/09/30/18/39/bake-1706050_960_720.jpg", 63 | ), 64 | ]; 65 | } else if (widget.kategori == "şekerleme") { 66 | gosterilecekListe = [ 67 | urunKarti( 68 | "Çikolata Hediyelik", 69 | "22.50 TL", 70 | "https://cdn.pixabay.com/photo/2017/02/11/14/19/valentines-day-2057745_960_720.jpg", 71 | ), 72 | urunKarti( 73 | "Karışık Kurabiye", 74 | "20 TL", 75 | "https://cdn.pixabay.com/photo/2016/11/17/17/37/cookie-1832169_960_720.jpg", 76 | ), 77 | urunKarti( 78 | "Çilekli Kek", 79 | "15 TL", 80 | "https://cdn.pixabay.com/photo/2014/05/23/23/17/dessert-352475_960_720.jpg", 81 | ), 82 | urunKarti( 83 | "Pasta", 84 | "16 TL", 85 | "https://cdn.pixabay.com/photo/2016/03/27/22/38/cake-1284548_960_720.jpg", 86 | ), 87 | ]; 88 | } else if (widget.kategori == "içecekler") { 89 | gosterilecekListe = [ 90 | urunKarti( 91 | "Portakal Suyu", 92 | "6.50 TL", 93 | "https://cdn.pixabay.com/photo/2017/05/21/16/52/juice-2331722_960_720.jpg", 94 | ), 95 | urunKarti( 96 | "Şişe Su", 97 | "2 TL", 98 | "https://cdn.pixabay.com/photo/2017/02/02/15/15/bottle-2032980_960_720.jpg", 99 | ), 100 | urunKarti( 101 | "Maden Suyu 6'lı", 102 | "5 TL", 103 | "https://cdn.pixabay.com/photo/2017/08/27/17/43/water-glass-2686973_960_720.jpg", 104 | ), 105 | urunKarti( 106 | "Gazoz", 107 | "1.50 TL", 108 | "https://cdn.pixabay.com/photo/2018/09/06/21/22/soda-3659387_960_720.jpg", 109 | ), 110 | ]; 111 | } else if (widget.kategori == "temizlik") { 112 | gosterilecekListe = [ 113 | urunKarti( 114 | "Bulaşık Deterjanı", 115 | "12 TL", 116 | "https://cdn.pixabay.com/photo/2020/05/08/15/31/detergent-5146192_960_720.jpg", 117 | ), 118 | urunKarti( 119 | "Sıvı Sabun", 120 | "9 TL", 121 | "https://cdn.pixabay.com/photo/2015/02/28/15/42/soap-653683_960_720.jpg", 122 | ), 123 | ]; 124 | } 125 | } 126 | 127 | Widget urunKarti(String isim, String fiyat, String resimYolu, {bool mevcut = false}) { 128 | return GestureDetector( 129 | onTap: (){ 130 | Navigator.push(context, MaterialPageRoute(builder: (context)=>UrunDetay( 131 | isim: isim, 132 | fiyat: fiyat, 133 | resimYolu: resimYolu, 134 | mevcut: mevcut, 135 | ))); 136 | }, 137 | child: Container( 138 | decoration: BoxDecoration( 139 | borderRadius: BorderRadius.circular(20.0), 140 | color: Colors.white, 141 | boxShadow: [ 142 | BoxShadow( 143 | color: Colors.grey.withOpacity(0.2), 144 | blurRadius: 4.0, 145 | spreadRadius: 2.0, 146 | ) 147 | ]), 148 | child: Column( 149 | mainAxisAlignment: MainAxisAlignment.center, 150 | children: [ 151 | Hero( 152 | tag: resimYolu, 153 | child: Container( 154 | width: 120.0, 155 | height: 80.0, 156 | decoration: BoxDecoration( 157 | image: DecorationImage( 158 | image: NetworkImage(resimYolu), 159 | fit: BoxFit.cover, 160 | ), 161 | borderRadius: BorderRadius.circular(20.0)), 162 | ), 163 | ), 164 | SizedBox( 165 | height: 8.0, 166 | ), 167 | Text(isim, 168 | style: TextStyle( 169 | fontSize: 14.0, 170 | fontWeight: FontWeight.bold, 171 | color: Colors.grey[600], 172 | )), 173 | SizedBox( 174 | height: 8.0, 175 | ), 176 | Text(fiyat, 177 | style: TextStyle( 178 | fontSize: 14.0, 179 | fontWeight: FontWeight.bold, 180 | color: Colors.red[400], 181 | )), 182 | ], 183 | ), 184 | ), 185 | ); 186 | } 187 | 188 | @override 189 | Widget build(BuildContext context) { 190 | return GridView.count( 191 | crossAxisCount: 2, 192 | mainAxisSpacing: 12.0, 193 | crossAxisSpacing: 12.0, 194 | padding: EdgeInsets.all(10.0), 195 | childAspectRatio: 1, 196 | children: gosterilecekListe, 197 | ); 198 | } 199 | } 200 | -------------------------------------------------------------------------------- /Uçarak Gelsin Market UI/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:fmarket/sepetim.dart'; 3 | import 'package:fmarket/urunler.dart'; 4 | 5 | void main() => runApp(MyApp()); 6 | 7 | class MyApp extends StatelessWidget { 8 | @override 9 | Widget build(BuildContext context) { 10 | return MaterialApp( 11 | debugShowCheckedModeBanner: false, 12 | title: 'Projem', 13 | theme: ThemeData( 14 | primarySwatch: Colors.green, 15 | ), 16 | home: AnaSayfa(), 17 | ); 18 | } 19 | } 20 | 21 | class AnaSayfa extends StatefulWidget { 22 | @override 23 | _AnaSayfaState createState() => _AnaSayfaState(); 24 | } 25 | 26 | class _AnaSayfaState extends State { 27 | int _aktifIcerikNo = 0; 28 | List _icerikler; 29 | 30 | @override 31 | void initState() { 32 | super.initState(); 33 | 34 | _icerikler = [Urunler(), Sepetim()]; 35 | } 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | return Scaffold( 40 | backgroundColor: Colors.white, 41 | appBar: AppBar( 42 | iconTheme: IconThemeData(color: Colors.red[400]), 43 | elevation: 0.0, 44 | backgroundColor: Colors.white, 45 | centerTitle: true, 46 | title: Text( 47 | "Uçarak Gelsin", 48 | style: TextStyle( 49 | fontSize: 20.0, fontWeight: FontWeight.bold, color: Colors.grey), 50 | ), 51 | ), 52 | body: _icerikler[_aktifIcerikNo], 53 | drawer: Drawer( 54 | child: ListView( 55 | padding: EdgeInsets.all(0.0), 56 | children: [ 57 | UserAccountsDrawerHeader( 58 | accountName: Text("Selçuk Mert"), 59 | accountEmail: Text("selm123@mailim.com"), 60 | currentAccountPicture: Container( 61 | decoration: BoxDecoration( 62 | image: DecorationImage( 63 | image: NetworkImage("https://cdn.pixabay.com/photo/2016/03/09/15/10/man-1246508_960_720.jpg"), 64 | fit: BoxFit.cover 65 | ), 66 | borderRadius: BorderRadius.circular(50.0), 67 | ), 68 | ), 69 | decoration: BoxDecoration(color: Colors.red[400]), 70 | ), 71 | ListTile(title: Text("Siparişlerim"), onTap: (){},), 72 | ListTile(title: Text("İndirimlerim"), onTap: (){},), 73 | ListTile(title: Text("Ayarlar"), onTap: (){},), 74 | ListTile(title: Text("Çıkış Yap"), onTap: (){ 75 | Navigator.pop(context); 76 | },), 77 | ], 78 | ), 79 | ), 80 | bottomNavigationBar: BottomNavigationBar( 81 | currentIndex: _aktifIcerikNo, 82 | selectedItemColor: Colors.red[400], 83 | unselectedItemColor: Colors.grey[600], 84 | items: [ 85 | BottomNavigationBarItem( 86 | icon: Icon(Icons.home), title: Text("Ürünler")), 87 | BottomNavigationBarItem( 88 | icon: Icon(Icons.shopping_cart), title: Text("Sepetim")) 89 | ], 90 | onTap: (int tiklananButonPozisyonNo) { 91 | setState(() { 92 | _aktifIcerikNo = tiklananButonPozisyonNo; 93 | }); 94 | }, 95 | ), 96 | ); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Uçarak Gelsin Market UI/lib/sepetim.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Sepetim extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return ListView( 7 | children: [ 8 | Center( 9 | child: Text( 10 | "Sepetim", 11 | style: TextStyle( 12 | fontSize: 20.0, 13 | fontWeight: FontWeight.bold, 14 | color: Colors.red[400]), 15 | ), 16 | ), 17 | ListTile( 18 | title: Text("Çikolatalı Gofret"), 19 | subtitle: Text("2 adet x 3.50 TL"), 20 | trailing: Text("7 TL"), 21 | ), 22 | ListTile( 23 | title: Text("Meyve Suyu"), 24 | subtitle: Text("1 adet x 2 TL"), 25 | trailing: Text("2 TL"), 26 | ), 27 | ListTile( 28 | title: Text("Islak Kek"), 29 | subtitle: Text("2 adet x 5.50 TL"), 30 | trailing: Text("11 TL"), 31 | ), 32 | SizedBox(height: 20.0,), 33 | Row( 34 | mainAxisAlignment: MainAxisAlignment.end, 35 | children: [ 36 | Padding( 37 | padding: const EdgeInsets.only(right: 25.0), 38 | child: Column( 39 | children: [ 40 | Text( 41 | "Toplam Tutar", 42 | style: TextStyle( 43 | fontSize: 18.0, 44 | fontWeight: FontWeight.bold, 45 | color: Colors.red[400], 46 | ), 47 | ), 48 | SizedBox(height: 5.0,), 49 | Text( 50 | "20 TL", 51 | style: TextStyle( 52 | fontSize: 18.0, 53 | fontWeight: FontWeight.bold, 54 | color: Colors.black, 55 | ), 56 | ) 57 | ], 58 | ), 59 | ), 60 | ], 61 | ), 62 | SizedBox(height: 20.0,), 63 | Padding( 64 | padding: const EdgeInsets.all(20.0), 65 | child: Container( 66 | height: 45.0, 67 | decoration: BoxDecoration( 68 | borderRadius: BorderRadius.circular(10.0), 69 | color: Colors.red[400], 70 | ), 71 | child: Center( 72 | child: Text( 73 | "Alışverişi Tamamla", 74 | style: TextStyle( 75 | fontSize: 20.0, 76 | fontWeight: FontWeight.bold, 77 | color: Colors.white, 78 | ), 79 | ), 80 | ), 81 | ), 82 | ) 83 | ], 84 | ); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Uçarak Gelsin Market UI/lib/urun_detay.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class UrunDetay extends StatelessWidget { 4 | final String isim; 5 | final String fiyat; 6 | final String resimYolu; 7 | final bool mevcut; 8 | 9 | const UrunDetay({Key key, this.isim, this.fiyat, this.resimYolu, this.mevcut}) 10 | : super(key: key); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Scaffold( 15 | body: ListView( 16 | children: [ 17 | Stack( 18 | children: [ 19 | Hero( 20 | tag: resimYolu, 21 | child: Image.network( 22 | resimYolu, 23 | ), 24 | ), 25 | IconButton( 26 | icon: Icon( 27 | Icons.arrow_back, 28 | color: Colors.red[400], 29 | size: 40.0, 30 | ), 31 | onPressed: () { 32 | Navigator.pop(context); 33 | }, 34 | ), 35 | ], 36 | ), 37 | Column( 38 | children: [ 39 | SizedBox( 40 | height: 20.0, 41 | ), 42 | Text( 43 | isim, 44 | style: TextStyle( 45 | fontSize: 20.0, 46 | fontWeight: FontWeight.bold, 47 | ), 48 | ), 49 | SizedBox( 50 | height: 10.0, 51 | ), 52 | Text( 53 | fiyat, 54 | style: TextStyle( 55 | fontSize: 20.0, 56 | fontWeight: FontWeight.bold, 57 | color: Colors.red[400], 58 | ), 59 | ), 60 | SizedBox( 61 | height: 20.0, 62 | ), 63 | Padding( 64 | padding: const EdgeInsets.only(left: 15.0, right: 15.0), 65 | child: Text( 66 | "Bu bölümde ürün açıklaması bulunacak. Ürünün ne kadar kaliteli olduğu hakkında bilgiler verecek.", 67 | textAlign: TextAlign.center, 68 | style: TextStyle( 69 | fontSize: 16.0, 70 | fontWeight: FontWeight.bold, 71 | color: Colors.grey, 72 | )), 73 | ), 74 | SizedBox( 75 | height: 25.0, 76 | ), 77 | Container( 78 | width: MediaQuery.of(context).size.width - 50.0, 79 | height: 50.0, 80 | decoration: BoxDecoration( 81 | color: mevcut ? Colors.red[400] : Colors.black, 82 | borderRadius: BorderRadius.circular(12.0), 83 | ), 84 | child: Center( 85 | child: Text( 86 | mevcut ? "Sepete Ekle" : "Stokta Yok", 87 | style: TextStyle( 88 | fontSize: 20.0, 89 | fontWeight: FontWeight.bold, 90 | color: Colors.white, 91 | ), 92 | ), 93 | ), 94 | ) 95 | ], 96 | ) 97 | ], 98 | )); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /Uçarak Gelsin Market UI/lib/urunler.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:fmarket/kategori.dart'; 3 | 4 | class Urunler extends StatefulWidget { 5 | @override 6 | _UrunlerState createState() => _UrunlerState(); 7 | } 8 | 9 | class _UrunlerState extends State with SingleTickerProviderStateMixin { 10 | 11 | TabController televizyonKontrolcusu; 12 | 13 | @override 14 | void initState() { 15 | super.initState(); 16 | televizyonKontrolcusu = TabController(length: 4, vsync: this); 17 | } 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return Column( 22 | children: [ 23 | TabBar( 24 | controller: televizyonKontrolcusu, 25 | indicatorColor: Colors.red[400], 26 | labelColor: Colors.red[400], 27 | unselectedLabelColor: Colors.grey, 28 | isScrollable: true, 29 | labelStyle: TextStyle(fontSize: 15.0,fontWeight: FontWeight.w500), 30 | tabs: [ 31 | Tab(child: Text("Temel Gıda"),), 32 | Tab(child: Text("Şekerleme"),), 33 | Tab(child: Text("İçecekler"),), 34 | Tab(child: Text("Temizlik"),), 35 | ] 36 | ), 37 | Expanded( 38 | child: TabBarView( 39 | controller: televizyonKontrolcusu, 40 | children: [ 41 | Kategori(kategori: "temel gıda",), 42 | Kategori(kategori: "şekerleme",), 43 | Kategori(kategori: "içecekler",), 44 | Kategori(kategori: "temizlik",), 45 | ], 46 | ), 47 | ) 48 | ], 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Uçarak Gelsin Market UI/readme.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ilkprojem.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | void main() => runApp(MyApp()); 4 | 5 | class MyApp extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return MaterialApp( 9 | debugShowCheckedModeBanner: false, 10 | title: 'Projem', 11 | theme: ThemeData( 12 | primarySwatch: Colors.green, 13 | ), 14 | home: Scaffold( 15 | appBar: AppBar(), 16 | body: Center(child: Text("Merhaba")) 17 | ), 18 | ); 19 | } 20 | } 21 | 22 | 23 | 24 | --------------------------------------------------------------------------------