This file contains 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'; | |
/// [Screen] Ekran oluşturrurken gereken tüm bilgileri tutacak | |
class Screen { | |
/// BottomNavigationBar'da gösterilecek olan başlık | |
final String title; | |
/// BottomNavigationBar'da gösterilecek olan ikon | |
final IconData icon; | |
/// Ekranda akacak olan WidgetTree tutucusu |
This file contains 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
class FirstScreen extends StatelessWidget { | |
static const route = '/first'; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar(title: Text('First Screen')), | |
body: Center( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, |
This file contains 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
class Root extends StatelessWidget { | |
static const route = '/'; | |
@override | |
Widget build(BuildContext context) { | |
return Consumer<NavigationProvider>( | |
builder: (context, provider, child) { | |
// Tanımladığımız screen'lardan BottomNavigationBar oluşturma | |
final bottomNavigationBarItems = provider.screens | |
.map( |
This file contains 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
void main() => runApp(App()); | |
class App extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MultiProvider( | |
providers: [ | |
ChangeNotifierProvider(create: (_) => NavigationProvider()), | |
], | |
child: Builder( |
OlderNewer