theming!!!

This commit is contained in:
zoe 2022-07-03 00:03:10 +02:00
parent 839bb0bbde
commit c63f062640
12 changed files with 118 additions and 63 deletions

View file

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:slothmu/pages/chat/%20chat.dart';
import 'package:slothmu/pages/chat/chat.dart';
import 'package:slothmu/pages/notifications/notifications.dart';
import 'package:slothmu/pages/timeline/timeline.dart';
import 'package:slothmu/pages/settings/settings.dart';
@ -12,29 +13,49 @@ class MainScaffold extends StatefulWidget {
class _MainScaffoldState extends State<MainScaffold> {
int index = 0;
final screens = [
Timeline(),
Chat(),
Settings(),
];
@override
Widget build(BuildContext context) {
final screens = [
timeline(context),
chat(context),
notifications(context),
settings(context),
];
final buttons = [
FloatingActionButton(
child: const Icon(Icons.chat_bubble),
onPressed: () {},
),
FloatingActionButton(
onPressed: () {},
child: const Icon(Icons.person_add),
),
FloatingActionButton(
onPressed: () {},
child: const Icon(Icons.clear_all),
),
null,
];
return Scaffold(
extendBody: true,
body: screens[index],
bottomNavigationBar: NavigationBar(
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
elevation: 0,
height: 60,
onDestinationSelected: (index) => setState(() => this.index = index),
selectedIndex: index,
destinations: const [
NavigationDestination(
icon: Icon(Icons.list_alt), label: "Timeline"),
NavigationDestination(icon: Icon(Icons.chat), label: "Chat"),
NavigationDestination(
icon: Icon(Icons.settings), label: "Settings"),
]),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: buttons[index],
bottomNavigationBar: BottomAppBar(
child: NavigationBar(
onDestinationSelected: (index) =>
setState(() => this.index = index),
selectedIndex: index,
destinations: const [
NavigationDestination(icon: Icon(Icons.forum), label: "Timeline"),
NavigationDestination(icon: Icon(Icons.chat), label: "Chat"),
NavigationDestination(
icon: Icon(Icons.notifications), label: "Notifications"),
NavigationDestination(
icon: Icon(Icons.settings), label: "Settings"),
]),
),
);
}
}