feat : Adding theme and header

This commit is contained in:
Yaël Perret
2024-11-01 18:30:48 +01:00
parent 48814a90aa
commit cd04c7c2c4
145 changed files with 932 additions and 844 deletions

View File

@@ -4,6 +4,7 @@ import 'package:bahla_front/app/app.dialogs.dart';
import 'package:bahla_front/app/app.locator.dart';
import 'package:bahla_front/app/app.router.dart';
import 'package:stacked_services/stacked_services.dart';
import 'package:google_fonts/google_fonts.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
@@ -25,6 +26,80 @@ class MainApp extends StatelessWidget {
navigatorObservers: [
StackedService.routeObserver,
],
theme: ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(
seedColor: Colors.blueAccent,
brightness: Brightness.dark,
primary: const Color.fromARGB(255, 64, 175, 255),
secondary: const Color.fromARGB(255, 255, 139, 6),
background: const Color.fromARGB(255, 15, 14, 23),
),
textTheme: TextTheme(
displayLarge: GoogleFonts.firaSans(
fontSize: 96,
fontWeight: FontWeight.normal
),
displayMedium: GoogleFonts.firaSans(
fontSize: 60,
fontWeight: FontWeight.normal
),
displaySmall: GoogleFonts.firaSans(
fontSize: 48,
fontWeight: FontWeight.normal
),
headlineLarge: GoogleFonts.firaSans(
fontSize: 40,
fontWeight: FontWeight.normal
),
headlineMedium: GoogleFonts.firaSans(
fontSize: 34,
fontWeight: FontWeight.normal
),
headlineSmall: GoogleFonts.firaSans(
fontSize: 24,
fontWeight: FontWeight.normal
),
titleLarge: GoogleFonts.firaSans(
fontSize: 20,
fontWeight: FontWeight.normal
),
titleMedium: GoogleFonts.firaSans(
fontSize: 16,
fontWeight: FontWeight.normal
),
titleSmall: GoogleFonts.firaSans(
fontSize: 14,
fontWeight: FontWeight.normal
),
bodyLarge: GoogleFonts.firaSans(
fontSize: 20,
fontWeight: FontWeight.normal
),
bodyMedium: GoogleFonts.firaSans(
fontSize: 16,
fontWeight: FontWeight.normal
),
bodySmall: GoogleFonts.firaSans(
fontSize: 14,
fontWeight: FontWeight.normal
),
labelLarge: GoogleFonts.firaSans(
fontSize: 14,
fontWeight: FontWeight.normal
),
labelMedium: GoogleFonts.firaSans(
fontSize: 12,
fontWeight: FontWeight.normal
),
labelSmall: GoogleFonts.firaSans(
fontSize: 10,
fontWeight: FontWeight.normal
),
)
),
);
}
}

View File

@@ -0,0 +1,5 @@
class Images {
Images._();
static const String logoSvg = 'assets/images/logo.svg';
}

View File

@@ -1,6 +1,8 @@
import 'package:bahla_front/ui/views/home/home_view.dart';
import 'package:flutter/material.dart';
import 'package:stacked/stacked.dart';
import 'package:bahla_front/ui/common/images.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'main_viewmodel.dart';
@@ -14,24 +16,56 @@ class MainView extends StackedView<MainViewModel> {
Widget? child,
) {
return Scaffold(
appBar: AppBar(
/*title: Text(
'Bahla',
style: Theme.of(context).textTheme.headlineMedium!.copyWith(
color: Theme.of(context).colorScheme.inverseSurface,
),
),*/
title: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SvgPicture.asset(
Images.logoSvg,
//width: 100,
height: 60,
fit: BoxFit.contain,
alignment: Alignment.centerLeft,
),
],
),
centerTitle: false,
backgroundColor: Theme.of(context).colorScheme.background,
shape: Border(
bottom: BorderSide(
color: Theme.of(context).colorScheme.outline,
width: 0.2,
),
),
),
backgroundColor: Theme.of(context).colorScheme.background,
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
backgroundColor: Colors.grey[800],
backgroundColor: Theme.of(context).colorScheme.background,
currentIndex: viewModel.currentIndex,
onTap: viewModel.setIndex,
showSelectedLabels: false,
showUnselectedLabels: false,
iconSize: 35,
items: [
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(Icons.search),
label: 'Search',
),
BottomNavigationBarItem(
icon: Icon(Icons.add),
label: 'Add',
icon: Icon(Icons.favorite_border),
label: 'Favorites',
),
BottomNavigationBarItem(
icon: Icon(Icons.account_circle),