mirror of
https://github.com/Mercantec-GHC/h4-projekt-gruppe-0-sm.git
synced 2025-04-27 16:24:07 +02:00
change theme color and add new page to dashboard
This commit is contained in:
parent
caa33d0a7d
commit
55b87419be
@ -33,7 +33,8 @@ class MyApp extends StatelessWidget {
|
||||
child: MaterialApp(
|
||||
title: 'Fresh Plaza',
|
||||
theme: ThemeData(
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: const Color.fromARGB(255, 149, 92, 255)),
|
||||
scaffoldBackgroundColor: const Color(0xFFFAFAFF),
|
||||
textTheme: const TextTheme(
|
||||
headlineLarge: TextStyle(color: Color(0xFF000000), fontSize: 64),
|
||||
|
@ -2,12 +2,14 @@ import 'package:flutter/material.dart';
|
||||
import 'package:mobile/pages/all_products_page.dart';
|
||||
import 'package:mobile/pages/cart_page.dart';
|
||||
import 'package:mobile/pages/all_receipts_page.dart';
|
||||
import 'package:mobile/pages/home_page.dart';
|
||||
import 'package:mobile/repos/bottom_navigation_bar.dart';
|
||||
import 'package:mobile/repos/cart.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class Dashboard extends StatelessWidget {
|
||||
final List<StatelessWidget> pages = [
|
||||
const HomePage(),
|
||||
const AllProductsPage(),
|
||||
const CartPage(),
|
||||
const AllReceiptsPage(),
|
||||
@ -23,6 +25,7 @@ class Dashboard extends StatelessWidget {
|
||||
|
||||
return Scaffold(
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
type: BottomNavigationBarType.fixed,
|
||||
onTap: (index) => pageIndexProvider.setIndex(index),
|
||||
currentIndex: currentIndex,
|
||||
items: <BottomNavigationBarItem>[
|
||||
@ -30,15 +33,24 @@ class Dashboard extends StatelessWidget {
|
||||
icon: Icon(currentIndex == 0 ? Icons.home : Icons.home_outlined),
|
||||
label: "Home"),
|
||||
BottomNavigationBarItem(
|
||||
icon: Badge.count(
|
||||
count: cartRepo.totalItemsInCart(),
|
||||
child: Icon(currentIndex == 1
|
||||
? Icons.shopping_cart
|
||||
: Icons.shopping_cart_outlined),
|
||||
),
|
||||
icon: Icon(
|
||||
currentIndex == 1 ? Icons.search : Icons.search_outlined),
|
||||
label: "Products"),
|
||||
BottomNavigationBarItem(
|
||||
icon: cartRepo.totalItemsInCart() == 0
|
||||
? Icon(currentIndex == 2
|
||||
? Icons.shopping_cart
|
||||
: Icons.shopping_cart_outlined)
|
||||
: Badge.count(
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
count: cartRepo.totalItemsInCart(),
|
||||
child: Icon(currentIndex == 2
|
||||
? Icons.shopping_cart
|
||||
: Icons.shopping_cart_outlined),
|
||||
),
|
||||
label: "Cart"),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(currentIndex == 2
|
||||
icon: Icon(currentIndex == 3
|
||||
? Icons.receipt_long
|
||||
: Icons.receipt_long_outlined),
|
||||
label: "Receipts")
|
||||
|
@ -83,12 +83,12 @@ class FinishShoppingPage extends StatelessWidget {
|
||||
color: Colors.white,
|
||||
),
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: const SizedBox(
|
||||
child: SizedBox(
|
||||
width: 50,
|
||||
height: 50,
|
||||
child: CircularProgressIndicator(
|
||||
valueColor:
|
||||
AlwaysStoppedAnimation<Color>(Colors.blue),
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
Theme.of(context).primaryColor),
|
||||
strokeWidth: 6.0,
|
||||
),
|
||||
),
|
||||
@ -101,9 +101,9 @@ class FinishShoppingPage extends StatelessWidget {
|
||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||
color: Colors.white,
|
||||
),
|
||||
child: const Icon(
|
||||
child: Icon(
|
||||
Icons.check_rounded,
|
||||
color: Colors.blue,
|
||||
color: Theme.of(context).primaryColor,
|
||||
size: 70,
|
||||
),
|
||||
)
|
||||
|
10
mobile/lib/pages/home_page.dart
Normal file
10
mobile/lib/pages/home_page.dart
Normal file
@ -0,0 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class HomePage extends StatelessWidget {
|
||||
const HomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Column();
|
||||
}
|
||||
}
|
@ -15,7 +15,8 @@ class PrimaryButton extends StatelessWidget {
|
||||
return TextButton(
|
||||
onPressed: onPressed,
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor: Colors.blue, foregroundColor: Colors.white),
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
foregroundColor: Colors.white),
|
||||
child: child);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user