From 24fc3484429b7bae218bbaf46cea936982be773b Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:56:05 +0530 Subject: [PATCH 01/50] featuring bottom nav with a drawer on it --- lib/feature/drawer/app_drawer.dart | 50 ++++++++ lib/feature/home/components/home_screen.dart | 15 +++ lib/feature/navbar/bottom_navbar.dart | 121 +++++++++++++++++++ lib/main.dart | 2 +- 4 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 lib/feature/drawer/app_drawer.dart create mode 100644 lib/feature/home/components/home_screen.dart create mode 100644 lib/feature/navbar/bottom_navbar.dart diff --git a/lib/feature/drawer/app_drawer.dart b/lib/feature/drawer/app_drawer.dart new file mode 100644 index 0000000..ad55eaa --- /dev/null +++ b/lib/feature/drawer/app_drawer.dart @@ -0,0 +1,50 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart'; + +class AppDrawer extends StatelessWidget { + final Function(int) onItemTapped; + + const AppDrawer({ + super.key, + required this.onItemTapped, + }); + + @override + Widget build(BuildContext context) { + return Drawer( + child: ListView( + padding: EdgeInsets.zero, + children: [ + const DrawerHeader( + decoration: BoxDecoration( + color: Color.fromARGB(214, 13, 110, 17), + ), + child: Text( + 'Menu', + style: TextStyle( + color: Colors.white, + fontSize: 24, + ), + ), + ), + ListTile( + leading: const Icon(CupertinoIcons.profile_circled), + title: const Text('Profile'), + onTap: () { + Navigator.pop(context); + onItemTapped(4); + }, + ), + ListTile( + leading: const Icon(CupertinoIcons.info), + title: const Text('About'), + onTap: () { + Navigator.pop(context); + + }, + ), + ], + ), + ); + } +} \ No newline at end of file diff --git a/lib/feature/home/components/home_screen.dart b/lib/feature/home/components/home_screen.dart new file mode 100644 index 0000000..eca400f --- /dev/null +++ b/lib/feature/home/components/home_screen.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class HomeScreen extends StatefulWidget { + const HomeScreen({super.key}); + + @override + State createState() => _HomeScreenState(); +} + +class _HomeScreenState extends State { + @override + Widget build(BuildContext context) { + return const Placeholder(); + } +} \ No newline at end of file diff --git a/lib/feature/navbar/bottom_navbar.dart b/lib/feature/navbar/bottom_navbar.dart new file mode 100644 index 0000000..138cac7 --- /dev/null +++ b/lib/feature/navbar/bottom_navbar.dart @@ -0,0 +1,121 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:harvest_manager/feature/drawer/app_drawer.dart'; + +class BottomNavbar extends StatefulWidget { + const BottomNavbar({super.key}); + + @override + State createState() => _BottomNavbarState(); +} + +class _BottomNavbarState extends State { + int _selectedIndex = 0; + + static final List _screens = [ + Container(child: const Center(child: Text('Home Screen'))), // index 0 + Container(child: const Center(child: Text('Analytics Screen'))), // index 1 + Container(child: const Center(child: Text('Add'))), // index 2 + Container(child: const Center(child: Text('Notifications Screen'))), // index 3 + Container(child: const Center(child: Text('Menu Screen'))), // index 4 + ]; + + void _onItemTapped(int index) { + setState(() { + _selectedIndex = index; + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: _screens[_selectedIndex], + drawer: AppDrawer(onItemTapped: _onItemTapped), // Use the separate drawer + bottomNavigationBar: BottomAppBar( + color: const Color.fromARGB(214, 13, 110, 17), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + buildNavBarItem(CupertinoIcons.home, 'Home', 0), + buildNavBarItem(CupertinoIcons.chart_bar, 'Analytics', 1), + const SizedBox( + width: 20, + ), + buildNavBarItem(CupertinoIcons.bell, 'Notifications', 3), + buildDrawerItem(), // Drawer icon instead of menu + ], + ), + ), + floatingActionButton: ClipOval( + child: Material( + color: const Color.fromARGB(214, 155, 236, 157), + elevation: 10, + child: InkWell( + child: const SizedBox( + width: 56, + height: 56, + child: Icon( + CupertinoIcons.add_circled, + size: 56, + color: Colors.black, + ), + ), + ), + ), + ), + floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, + ); + } + + Widget buildNavBarItem(IconData icon, String label, int index) { + return InkWell( + onTap: () => _onItemTapped(index), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + icon, + color: _selectedIndex == index + ? const Color.fromARGB(214, 155, 236, 157) + : Colors.black87, + ), + Text( + label, + style: TextStyle( + color: _selectedIndex == index + ? const Color.fromARGB(214, 155, 236, 157) + : Colors.black87, + ), + ), + ], + ), + ); + } + + Widget buildDrawerItem() { + return Builder( + builder: (BuildContext context) { + return InkWell( + onTap: () { + Scaffold.of(context).openDrawer(); + }, + child: const Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + CupertinoIcons.line_horizontal_3, + color: Colors.black87, + ), + Text( + 'Menu', + style: TextStyle( + color: Colors.black87, + ), + ), + ], + ), + ); + }, + ); + } +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 0b5dcfc..5c222d9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -12,9 +12,9 @@ void main() async { class MyApp extends StatelessWidget { const MyApp({super.key}); - // This widget is the root of your application. @override Widget build(BuildContext context) { + return MaterialApp( title: 'Flutter Demo', debugShowCheckedModeBanner: false, From 039ef2549c8fe595c506e5ecb54eae32927a5242 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:11:08 +0530 Subject: [PATCH 02/50] hmoe_screens moved to the screens folder --- lib/{feature/home/components => Screens}/home_screen.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/{feature/home/components => Screens}/home_screen.dart (100%) diff --git a/lib/feature/home/components/home_screen.dart b/lib/Screens/home_screen.dart similarity index 100% rename from lib/feature/home/components/home_screen.dart rename to lib/Screens/home_screen.dart From 75fef8ae08c49742b06a31b704074240a606b687 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:13:14 +0530 Subject: [PATCH 03/50] sory my bad. --- lib/{Screens => feature/home/screens}/home_screen.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/{Screens => feature/home/screens}/home_screen.dart (100%) diff --git a/lib/Screens/home_screen.dart b/lib/feature/home/screens/home_screen.dart similarity index 100% rename from lib/Screens/home_screen.dart rename to lib/feature/home/screens/home_screen.dart From 558a82c5b8dac30b166623617d7782d0f216a353 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:43:19 +0530 Subject: [PATCH 04/50] created theme/theme.dart --- lib/core/theme/theme.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 lib/core/theme/theme.dart diff --git a/lib/core/theme/theme.dart b/lib/core/theme/theme.dart new file mode 100644 index 0000000..e69de29 From 2a1819f78796b4415fd5d0c9dd7588284cb516ee Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 17:07:10 +0530 Subject: [PATCH 05/50] make changes on theme --- lib/core/theme/theme.dart | 477 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 477 insertions(+) diff --git a/lib/core/theme/theme.dart b/lib/core/theme/theme.dart index e69de29..a1ee860 100644 --- a/lib/core/theme/theme.dart +++ b/lib/core/theme/theme.dart @@ -0,0 +1,477 @@ +import 'package:flutter/material.dart'; + +class TeaTrackerTheme { + // Primary Colors from your Figma design + static const Color primaryGreen = Color(0xFF4CAF50); // Main green from buttons + static const Color darkGreen = Color(0xFF2E7D32); // Dark green for text/borders + static const Color lightGreen = Color(0xFF81C784); // Light green for accents + static const Color paleGreen = Color(0xFF66BB6A); // Medium green + static const Color teaGreen = Color(0xFF8BC34A); // Tea leaf green + + // Background Colors + static const Color creamBackground = Color(0xFFF1F8E9); // Main cream/light green background + static const Color whiteBackground = Color(0xFFFFFFFF); + static const Color cardBackground = Color(0xFFE8F5E8); // Light green card background + static const Color overlayBackground = Color(0xFFF5F5F5); // Light overlay + + // Text Colors + static const Color primaryText = Color(0xFF1B5E20); // Dark green text + static const Color secondaryText = Color(0xFF424242); // Dark gray text + static const Color lightText = Color(0xFF757575); // Light gray text + static const Color whiteText = Color(0xFFFFFFFF); + static const Color placeholderText = Color(0xFF9E9E9E); // Placeholder text + + // Accent Colors + static const Color errorRed = Color(0xFFE53935); // Red for errors/required fields + static const Color warningOrange = Color(0xFFFF9800); + static const Color successGreen = Color(0xFF4CAF50); + static const Color yellowAccent = Color(0xFFFFEB3B); // Yellow from color palette + + // Dashboard Colors + static const Color dashboardCard1 = Color(0xFFE8F5E8); // Light green + static const Color dashboardCard2 = Color(0xFFE1F5FE); // Light blue tint + static const Color dashboardCard3 = Color(0xFFF3E5F5); // Light purple tint + + // Bottom Navigation Colors + static const Color bottomNavBackground = Color(0xFF2E7D32); + static const Color bottomNavSelected = Color(0xFFFFFFFF); + static const Color bottomNavUnselected = Color.fromARGB(179, 0, 0, 0); + + // Gradient Colors + static const LinearGradient backgroundGradient = LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color(0xFFF1F8E9), + Color(0xFFE8F5E8), + ], + ); + + static const LinearGradient buttonGradient = LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + Color(0xFF66BB6A), + Color(0xFF4CAF50), + ], + ); + + static const LinearGradient cardGradient = LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + Color(0xFFFFFFFF), + Color(0xFFF8F8F8), + ], + ); + + // Tea Cup Icon Colors (for branding) + static const Color teaCupPrimary = Color(0xFF8D6E63); // Brown for tea cup + static const Color teaCupSecondary = Color(0xFF4CAF50); // Green tea color + static const Color teaLeafGreen = Color(0xFF689F38); // Tea leaf green + + // Text Styles + static const TextStyle appTitle = TextStyle( + fontSize: 32, + fontWeight: FontWeight.bold, + color: primaryText, + fontFamily: 'Inter', + letterSpacing: -0.5, + ); + + static const TextStyle welcomeTitle = TextStyle( + fontSize: 28, + fontWeight: FontWeight.bold, + color: primaryText, + fontFamily: 'Inter', + ); + + static const TextStyle screenTitle = TextStyle( + fontSize: 24, + fontWeight: FontWeight.w600, + color: primaryText, + fontFamily: 'Inter', + ); + + static const TextStyle sectionTitle = TextStyle( + fontSize: 20, + fontWeight: FontWeight.w600, + color: primaryText, + fontFamily: 'Inter', + ); + + static const TextStyle cardTitle = TextStyle( + fontSize: 18, + fontWeight: FontWeight.w600, + color: primaryText, + fontFamily: 'Inter', + ); + + static const TextStyle bodyLarge = TextStyle( + fontSize: 16, + fontWeight: FontWeight.normal, + color: secondaryText, + fontFamily: 'Inter', + ); + + static const TextStyle bodyMedium = TextStyle( + fontSize: 14, + fontWeight: FontWeight.normal, + color: secondaryText, + fontFamily: 'Inter', + ); + + static const TextStyle bodySmall = TextStyle( + fontSize: 12, + fontWeight: FontWeight.normal, + color: lightText, + fontFamily: 'Inter', + ); + + static const TextStyle buttonText = TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: whiteText, + fontFamily: 'Inter', + ); + + static const TextStyle linkText = TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: primaryGreen, + decoration: TextDecoration.underline, + fontFamily: 'Inter', + ); + + // Dashboard specific text styles + static const TextStyle dashboardMetricNumber = TextStyle( + fontSize: 32, + fontWeight: FontWeight.bold, + color: primaryGreen, + fontFamily: 'Inter', + ); + + static const TextStyle dashboardMetricLabel = TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: secondaryText, + fontFamily: 'Inter', + ); + + static const TextStyle dashboardSubtitle = TextStyle( + fontSize: 12, + fontWeight: FontWeight.normal, + color: lightText, + fontFamily: 'Inter', + ); + + // Form field styles + static const TextStyle fieldLabel = TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: primaryText, + fontFamily: 'Inter', + ); + + static const TextStyle fieldError = TextStyle( + fontSize: 12, + fontWeight: FontWeight.normal, + color: errorRed, + fontFamily: 'Inter', + ); + + // Input Decoration + static InputDecoration inputDecoration({ + required String labelText, + String? hintText, + IconData? prefixIcon, + Widget? suffixIcon, + bool isRequired = false, + }) { + return InputDecoration( + labelText: labelText, + hintText: hintText, + prefixIcon: prefixIcon != null ? Icon(prefixIcon, color: primaryGreen) : null, + suffixIcon: suffixIcon, + filled: true, + fillColor: whiteBackground, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: lightGreen, width: 1), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: lightGreen, width: 1), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: primaryGreen, width: 2), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: errorRed, width: 1), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: errorRed, width: 2), + ), + labelStyle: fieldLabel, + hintStyle: TextStyle(color: placeholderText), + errorStyle: fieldError, + contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), + ); + } + + // Button Styles + static final ElevatedButtonThemeData elevatedButtonTheme = ElevatedButtonThemeData( + style: ElevatedButton.styleFrom( + backgroundColor: primaryGreen, + foregroundColor: whiteText, + padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + elevation: 2, + shadowColor: primaryGreen.withOpacity(0.3), + textStyle: buttonText, + ), + ); + + static final OutlinedButtonThemeData outlinedButtonTheme = OutlinedButtonThemeData( + style: OutlinedButton.styleFrom( + foregroundColor: primaryGreen, + padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + side: const BorderSide(color: primaryGreen, width: 1.5), + textStyle: buttonText.copyWith(color: primaryGreen), + ), + ); + + // Card Theme + static final CardTheme cardTheme = CardTheme( + color: whiteBackground, + elevation: 4, + shadowColor: primaryGreen.withOpacity(0.15), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + ), + margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + ); + + // AppBar Theme + static const AppBarTheme appBarTheme = AppBarTheme( + backgroundColor: Colors.transparent, + elevation: 0, + iconTheme: IconThemeData(color: primaryText), + titleTextStyle: screenTitle, + centerTitle: true, + ); + + // Bottom Navigation Bar Theme + static final BottomNavigationBarThemeData bottomNavTheme = BottomNavigationBarThemeData( + backgroundColor: bottomNavBackground, + selectedItemColor: bottomNavSelected, + unselectedItemColor: bottomNavUnselected, + type: BottomNavigationBarType.fixed, + elevation: 8, + selectedLabelStyle: const TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + fontFamily: 'Inter', + ), + unselectedLabelStyle: const TextStyle( + fontSize: 11, + fontWeight: FontWeight.normal, + fontFamily: 'Inter', + ), + ); + + // Main Theme Data + static ThemeData get lightTheme { + return ThemeData( + useMaterial3: true, + + // Color Scheme + colorScheme: const ColorScheme.light( + primary: primaryGreen, + primaryContainer: lightGreen, + secondary: teaGreen, + secondaryContainer: cardBackground, + surface: whiteBackground, + background: creamBackground, + error: errorRed, + onPrimary: whiteText, + onSecondary: primaryText, + onSurface: primaryText, + onBackground: primaryText, + onError: whiteText, + ), + + // Scaffold Background + scaffoldBackgroundColor: creamBackground, + + // App Bar Theme + appBarTheme: appBarTheme, + + // Button Themes + elevatedButtonTheme: elevatedButtonTheme, + outlinedButtonTheme: outlinedButtonTheme, + + // Card Theme + cardTheme: cardTheme, + + // Bottom Navigation Theme + bottomNavigationBarTheme: bottomNavTheme, + + // Input Decoration Theme + inputDecorationTheme: InputDecorationTheme( + filled: true, + fillColor: whiteBackground, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: lightGreen, width: 1), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: lightGreen, width: 1), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: primaryGreen, width: 2), + ), + labelStyle: fieldLabel, + hintStyle: TextStyle(color: placeholderText), + contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), + ), + + // Text Theme + textTheme: const TextTheme( + displayLarge: appTitle, + displayMedium: welcomeTitle, + displaySmall: screenTitle, + headlineLarge: welcomeTitle, + headlineMedium: screenTitle, + headlineSmall: sectionTitle, + titleLarge: sectionTitle, + titleMedium: cardTitle, + titleSmall: bodyLarge, + bodyLarge: bodyLarge, + bodyMedium: bodyMedium, + bodySmall: bodySmall, + labelLarge: buttonText, + labelMedium: bodyMedium, + labelSmall: bodySmall, + ), + + // Icon Theme + iconTheme: const IconThemeData( + color: primaryGreen, + size: 24, + ), + + // Divider Theme + dividerTheme: DividerThemeData( + color: lightGreen.withOpacity(0.3), + thickness: 1, + space: 16, + ), + + // Checkbox Theme + checkboxTheme: CheckboxThemeData( + fillColor: MaterialStateProperty.resolveWith((states) { + if (states.contains(MaterialState.selected)) { + return primaryGreen; + } + return null; + }), + checkColor: MaterialStateProperty.all(whiteText), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)), + ), + + // Font Family + fontFamily: 'Inter', + ); + } + + // Custom Box Decorations + static BoxDecoration get authCardDecoration => BoxDecoration( + gradient: cardGradient, + borderRadius: BorderRadius.circular(20), + boxShadow: [ + BoxShadow( + color: primaryGreen.withOpacity(0.1), + blurRadius: 20, + offset: const Offset(0, 8), + ), + ], + ); + + static BoxDecoration get dashboardCardDecoration => BoxDecoration( + color: whiteBackground, + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: primaryGreen.withOpacity(0.08), + blurRadius: 8, + offset: const Offset(0, 4), + ), + ], + ); + + static BoxDecoration get factoryCardDecoration => BoxDecoration( + color: whiteBackground, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: lightGreen.withOpacity(0.3), width: 1), + ); + + static BoxDecoration get backgroundDecoration => const BoxDecoration( + gradient: backgroundGradient, + ); + + static BoxDecoration get buttonDecoration => const BoxDecoration( + gradient: buttonGradient, + borderRadius: BorderRadius.all(Radius.circular(12)), + ); + + // FAB decoration for the centered add button + static BoxDecoration get fabDecoration => BoxDecoration( + gradient: buttonGradient, + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + color: primaryGreen.withOpacity(0.3), + blurRadius: 12, + offset: const Offset(0, 6), + ), + ], + ); + + // Welcome screen specific decorations + static BoxDecoration get welcomeBackgroundDecoration => const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color(0xFFF1F8E9), + Color(0xFFE8F5E8), + ], + ), + ); + + // Chart colors for analytics + static List get chartColors => [ + primaryGreen, + lightGreen, + teaGreen, + paleGreen, + darkGreen, + ]; + + // Status colors + static const Color activeStatus = Color(0xFF4CAF50); + static const Color inactiveStatus = Color(0xFF9E9E9E); + static const Color pendingStatus = Color(0xFFFF9800); + static const Color completedStatus = Color(0xFF66BB6A); +} \ No newline at end of file From 095e4216f2d0bc07460d4b073012fc66df12728a Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 17:07:24 +0530 Subject: [PATCH 06/50] add theme colors to nav bar --- lib/feature/navbar/bottom_navbar.dart | 46 ++++++++++++++------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/lib/feature/navbar/bottom_navbar.dart b/lib/feature/navbar/bottom_navbar.dart index 138cac7..f233b28 100644 --- a/lib/feature/navbar/bottom_navbar.dart +++ b/lib/feature/navbar/bottom_navbar.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; +import 'package:harvest_manager/core/theme/theme.dart'; import 'package:harvest_manager/feature/drawer/app_drawer.dart'; class BottomNavbar extends StatefulWidget { @@ -29,10 +30,12 @@ class _BottomNavbarState extends State { @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: TeaTrackerTheme.creamBackground, body: _screens[_selectedIndex], drawer: AppDrawer(onItemTapped: _onItemTapped), // Use the separate drawer bottomNavigationBar: BottomAppBar( - color: const Color.fromARGB(214, 13, 110, 17), + color: TeaTrackerTheme.bottomNavBackground, + elevation: 8, child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ @@ -42,24 +45,20 @@ class _BottomNavbarState extends State { width: 20, ), buildNavBarItem(CupertinoIcons.bell, 'Notifications', 3), - buildDrawerItem(), // Drawer icon instead of menu + buildDrawerItem(), ], ), ), - floatingActionButton: ClipOval( - child: Material( - color: const Color.fromARGB(214, 155, 236, 157), - elevation: 10, - child: InkWell( - child: const SizedBox( - width: 56, - height: 56, - child: Icon( - CupertinoIcons.add_circled, - size: 56, - color: Colors.black, - ), - ), + floatingActionButton: Container( + decoration: TeaTrackerTheme.fabDecoration, + child: FloatingActionButton( + onPressed: () => _onItemTapped(2), + backgroundColor: Colors.transparent, + elevation: 0, + child: const Icon( + CupertinoIcons.add, + size: 28, + color: TeaTrackerTheme.whiteText, ), ), ), @@ -70,21 +69,23 @@ class _BottomNavbarState extends State { Widget buildNavBarItem(IconData icon, String label, int index) { return InkWell( onTap: () => _onItemTapped(index), + borderRadius: BorderRadius.circular(8), child: Column( mainAxisSize: MainAxisSize.min, children: [ Icon( icon, color: _selectedIndex == index - ? const Color.fromARGB(214, 155, 236, 157) - : Colors.black87, + ? TeaTrackerTheme.bottomNavSelected + : TeaTrackerTheme.bottomNavUnselected, ), Text( label, style: TextStyle( color: _selectedIndex == index - ? const Color.fromARGB(214, 155, 236, 157) - : Colors.black87, + ? TeaTrackerTheme.bottomNavSelected + : TeaTrackerTheme.bottomNavUnselected, + fontFamily: 'Inder', ), ), ], @@ -99,17 +100,18 @@ class _BottomNavbarState extends State { onTap: () { Scaffold.of(context).openDrawer(); }, + borderRadius: BorderRadius.circular(8), child: const Column( mainAxisSize: MainAxisSize.min, children: [ Icon( CupertinoIcons.line_horizontal_3, - color: Colors.black87, + color: TeaTrackerTheme.bottomNavUnselected, ), Text( 'Menu', style: TextStyle( - color: Colors.black87, + color: TeaTrackerTheme.bottomNavUnselected, ), ), ], From 866eddfc9df910784d018ba06ace417043c21de1 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 17:09:52 +0530 Subject: [PATCH 07/50] add theme colors to drawer --- lib/feature/drawer/app_drawer.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/feature/drawer/app_drawer.dart b/lib/feature/drawer/app_drawer.dart index ad55eaa..6462957 100644 --- a/lib/feature/drawer/app_drawer.dart +++ b/lib/feature/drawer/app_drawer.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; +import 'package:harvest_manager/core/theme/theme.dart'; class AppDrawer extends StatelessWidget { final Function(int) onItemTapped; @@ -17,12 +18,12 @@ class AppDrawer extends StatelessWidget { children: [ const DrawerHeader( decoration: BoxDecoration( - color: Color.fromARGB(214, 13, 110, 17), + color: TeaTrackerTheme.darkGreen, ), child: Text( 'Menu', style: TextStyle( - color: Colors.white, + color: TeaTrackerTheme.whiteBackground, fontSize: 24, ), ), From 66ccddfeaee8fc6cc83fe5519f711a4151122f86 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Fri, 6 Jun 2025 23:15:39 +0530 Subject: [PATCH 08/50] change while resolving complicts --- lib/feature/home/screens/home_screen.dart | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/feature/home/screens/home_screen.dart b/lib/feature/home/screens/home_screen.dart index eca400f..df75708 100644 --- a/lib/feature/home/screens/home_screen.dart +++ b/lib/feature/home/screens/home_screen.dart @@ -1,15 +1,19 @@ +import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; -class HomeScreen extends StatefulWidget { +class HomeScreen extends StatelessWidget { const HomeScreen({super.key}); - @override - State createState() => _HomeScreenState(); -} - -class _HomeScreenState extends State { @override Widget build(BuildContext context) { - return const Placeholder(); + return Scaffold( + appBar: AppBar(title: Text("Home")), + body: ElevatedButton( + onPressed: () async { + await FirebaseAuth.instance.signOut(); + }, + child: const Text('Logout'), + ), + ); } -} \ No newline at end of file +} From 3d4191605b5399f5248499ff9a28f69e6162938e Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Sun, 8 Jun 2025 11:41:40 +0530 Subject: [PATCH 09/50] romed unwated thinggs and change routing --- lib/core/theme/theme.dart | 77 ++------------------------- lib/feature/navbar/bottom_navbar.dart | 12 +++-- lib/main.dart | 8 +-- 3 files changed, 14 insertions(+), 83 deletions(-) diff --git a/lib/core/theme/theme.dart b/lib/core/theme/theme.dart index a1ee860..77d1a5e 100644 --- a/lib/core/theme/theme.dart +++ b/lib/core/theme/theme.dart @@ -27,25 +27,12 @@ class TeaTrackerTheme { static const Color successGreen = Color(0xFF4CAF50); static const Color yellowAccent = Color(0xFFFFEB3B); // Yellow from color palette - // Dashboard Colors - static const Color dashboardCard1 = Color(0xFFE8F5E8); // Light green - static const Color dashboardCard2 = Color(0xFFE1F5FE); // Light blue tint - static const Color dashboardCard3 = Color(0xFFF3E5F5); // Light purple tint // Bottom Navigation Colors static const Color bottomNavBackground = Color(0xFF2E7D32); static const Color bottomNavSelected = Color(0xFFFFFFFF); static const Color bottomNavUnselected = Color.fromARGB(179, 0, 0, 0); - // Gradient Colors - static const LinearGradient backgroundGradient = LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Color(0xFFF1F8E9), - Color(0xFFE8F5E8), - ], - ); static const LinearGradient buttonGradient = LinearGradient( begin: Alignment.topLeft, @@ -237,28 +224,6 @@ class TeaTrackerTheme { ), ); - static final OutlinedButtonThemeData outlinedButtonTheme = OutlinedButtonThemeData( - style: OutlinedButton.styleFrom( - foregroundColor: primaryGreen, - padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - ), - side: const BorderSide(color: primaryGreen, width: 1.5), - textStyle: buttonText.copyWith(color: primaryGreen), - ), - ); - - // Card Theme - static final CardTheme cardTheme = CardTheme( - color: whiteBackground, - elevation: 4, - shadowColor: primaryGreen.withOpacity(0.15), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(16), - ), - margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), - ); // AppBar Theme static const AppBarTheme appBarTheme = AppBarTheme( @@ -300,12 +265,10 @@ class TeaTrackerTheme { secondary: teaGreen, secondaryContainer: cardBackground, surface: whiteBackground, - background: creamBackground, error: errorRed, onPrimary: whiteText, onSecondary: primaryText, onSurface: primaryText, - onBackground: primaryText, onError: whiteText, ), @@ -315,13 +278,6 @@ class TeaTrackerTheme { // App Bar Theme appBarTheme: appBarTheme, - // Button Themes - elevatedButtonTheme: elevatedButtonTheme, - outlinedButtonTheme: outlinedButtonTheme, - - // Card Theme - cardTheme: cardTheme, - // Bottom Navigation Theme bottomNavigationBarTheme: bottomNavTheme, @@ -380,13 +336,13 @@ class TeaTrackerTheme { // Checkbox Theme checkboxTheme: CheckboxThemeData( - fillColor: MaterialStateProperty.resolveWith((states) { - if (states.contains(MaterialState.selected)) { + fillColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.selected)) { return primaryGreen; } return null; }), - checkColor: MaterialStateProperty.all(whiteText), + checkColor: WidgetStateProperty.all(whiteText), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)), ), @@ -395,19 +351,6 @@ class TeaTrackerTheme { ); } - // Custom Box Decorations - static BoxDecoration get authCardDecoration => BoxDecoration( - gradient: cardGradient, - borderRadius: BorderRadius.circular(20), - boxShadow: [ - BoxShadow( - color: primaryGreen.withOpacity(0.1), - blurRadius: 20, - offset: const Offset(0, 8), - ), - ], - ); - static BoxDecoration get dashboardCardDecoration => BoxDecoration( color: whiteBackground, borderRadius: BorderRadius.circular(16), @@ -426,15 +369,6 @@ class TeaTrackerTheme { border: Border.all(color: lightGreen.withOpacity(0.3), width: 1), ); - static BoxDecoration get backgroundDecoration => const BoxDecoration( - gradient: backgroundGradient, - ); - - static BoxDecoration get buttonDecoration => const BoxDecoration( - gradient: buttonGradient, - borderRadius: BorderRadius.all(Radius.circular(12)), - ); - // FAB decoration for the centered add button static BoxDecoration get fabDecoration => BoxDecoration( gradient: buttonGradient, @@ -469,9 +403,4 @@ class TeaTrackerTheme { darkGreen, ]; - // Status colors - static const Color activeStatus = Color(0xFF4CAF50); - static const Color inactiveStatus = Color(0xFF9E9E9E); - static const Color pendingStatus = Color(0xFFFF9800); - static const Color completedStatus = Color(0xFF66BB6A); } \ No newline at end of file diff --git a/lib/feature/navbar/bottom_navbar.dart b/lib/feature/navbar/bottom_navbar.dart index f233b28..ad70a7f 100644 --- a/lib/feature/navbar/bottom_navbar.dart +++ b/lib/feature/navbar/bottom_navbar.dart @@ -3,6 +3,8 @@ import 'package:flutter/cupertino.dart'; import 'package:harvest_manager/core/theme/theme.dart'; import 'package:harvest_manager/feature/drawer/app_drawer.dart'; +import '../home/screens/home_screen.dart'; + class BottomNavbar extends StatefulWidget { const BottomNavbar({super.key}); @@ -14,11 +16,11 @@ class _BottomNavbarState extends State { int _selectedIndex = 0; static final List _screens = [ - Container(child: const Center(child: Text('Home Screen'))), // index 0 - Container(child: const Center(child: Text('Analytics Screen'))), // index 1 - Container(child: const Center(child: Text('Add'))), // index 2 - Container(child: const Center(child: Text('Notifications Screen'))), // index 3 - Container(child: const Center(child: Text('Menu Screen'))), // index 4 + const HomeScreen(), // index 0 - Your home screen + //const AnalyticsPage(), // index 1 - Analytics page + //const AddPage(), // index 2 - Add page + //const NotificationsPage(), // index 3 - Notifications page + const Center(child: Text('Menu Screen')), // index 4 - Keep as is since menu is in drawer ]; void _onItemTapped(int index) { diff --git a/lib/main.dart b/lib/main.dart index 5c222d9..8c23909 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:firebase_core/firebase_core.dart'; -import 'package:harvest_manager/wrapper.dart'; +import 'package:harvest_manager/feature/navbar/bottom_navbar.dart'; import 'firebase_options.dart'; void main() async { @@ -16,9 +16,9 @@ class MyApp extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp( - title: 'Flutter Demo', + title: 'Harvest Manager', debugShowCheckedModeBanner: false, - home: Wrapper(), + home: const BottomNavbar(), ); } -} +} \ No newline at end of file From 782d739678af1f7b9d3fa13c0ea2b563fd74c231 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Sun, 8 Jun 2025 11:42:30 +0530 Subject: [PATCH 10/50] add a logout button and customized --- lib/feature/drawer/app_drawer.dart | 26 +++++++++++++++++++++++ lib/feature/home/screens/home_screen.dart | 10 +++------ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/lib/feature/drawer/app_drawer.dart b/lib/feature/drawer/app_drawer.dart index 6462957..2b3cb12 100644 --- a/lib/feature/drawer/app_drawer.dart +++ b/lib/feature/drawer/app_drawer.dart @@ -1,3 +1,4 @@ +import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:harvest_manager/core/theme/theme.dart'; @@ -44,6 +45,31 @@ class AppDrawer extends StatelessWidget { }, ), + const Spacer(), + const Divider(), + ListTile( + leading: const Icon(CupertinoIcons.square_arrow_right), + title: const Text('Logout'), + onTap: ()async { + Navigator .pop(context); + try { + await FirebaseAuth.instance.signOut(); + + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Logged out successfully')), + ); + } + } + catch (e) { + if (context.mounted){ + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text('Error logging out: $e')), + ); + } + } + }, + ), ], ), ); diff --git a/lib/feature/home/screens/home_screen.dart b/lib/feature/home/screens/home_screen.dart index df75708..5b2d752 100644 --- a/lib/feature/home/screens/home_screen.dart +++ b/lib/feature/home/screens/home_screen.dart @@ -1,5 +1,6 @@ -import 'package:firebase_auth/firebase_auth.dart'; + import 'package:flutter/material.dart'; +import 'package:harvest_manager/core/theme/theme.dart'; class HomeScreen extends StatelessWidget { const HomeScreen({super.key}); @@ -7,13 +8,8 @@ class HomeScreen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: TeaTrackerTheme.creamBackground, appBar: AppBar(title: Text("Home")), - body: ElevatedButton( - onPressed: () async { - await FirebaseAuth.instance.signOut(); - }, - child: const Text('Logout'), - ), ); } } From 11291d6f377c88a148d4d29dca4bc44599f3a454 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Sun, 8 Jun 2025 12:16:53 +0530 Subject: [PATCH 11/50] brought logout button to bottom. --- lib/feature/drawer/app_drawer.dart | 63 +++++++++++++++++------------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/lib/feature/drawer/app_drawer.dart b/lib/feature/drawer/app_drawer.dart index 2b3cb12..7007d64 100644 --- a/lib/feature/drawer/app_drawer.dart +++ b/lib/feature/drawer/app_drawer.dart @@ -14,18 +14,23 @@ class AppDrawer extends StatelessWidget { @override Widget build(BuildContext context) { return Drawer( - child: ListView( - padding: EdgeInsets.zero, + backgroundColor: TeaTrackerTheme.creamBackground, + child: Column( children: [ - const DrawerHeader( - decoration: BoxDecoration( + Container( + height: 80, + width: double.infinity, + decoration: const BoxDecoration( color: TeaTrackerTheme.darkGreen, ), - child: Text( + alignment: Alignment.centerLeft, + padding: const EdgeInsets.only(left: 16), + child: const Text( 'Menu', style: TextStyle( color: TeaTrackerTheme.whiteBackground, - fontSize: 24, + fontSize: 20, + fontWeight: FontWeight.w500, ), ), ), @@ -42,33 +47,37 @@ class AppDrawer extends StatelessWidget { title: const Text('About'), onTap: () { Navigator.pop(context); - }, ), + const Spacer(), - const Divider(), - ListTile( - leading: const Icon(CupertinoIcons.square_arrow_right), - title: const Text('Logout'), - onTap: ()async { - Navigator .pop(context); - try { - await FirebaseAuth.instance.signOut(); + const Divider(height: 1), + Container( + padding: const EdgeInsets.only(bottom: 16), + child: ListTile( + leading: const Icon(CupertinoIcons.square_arrow_right), + title: const Text('Logout'), + dense: true, + onTap: ()async { + Navigator .pop(context); + try { + await FirebaseAuth.instance.signOut(); - if (context.mounted) { - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar(content: Text('Logged out successfully')), - ); + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Logged out successfully')), + ); + } } - } - catch (e) { - if (context.mounted){ - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text('Error logging out: $e')), - ); + catch (e) { + if (context.mounted){ + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text('Error logging out: $e')), + ); + } } - } - }, + }, + ), ), ], ), From 565d671d10ee994122fde80e59551a395d32a1b4 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Mon, 9 Jun 2025 10:35:00 +0530 Subject: [PATCH 12/50] updated analytics button --- lib/feature/navbar/bottom_navbar.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/feature/navbar/bottom_navbar.dart b/lib/feature/navbar/bottom_navbar.dart index ad70a7f..46a301e 100644 --- a/lib/feature/navbar/bottom_navbar.dart +++ b/lib/feature/navbar/bottom_navbar.dart @@ -42,7 +42,7 @@ class _BottomNavbarState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ buildNavBarItem(CupertinoIcons.home, 'Home', 0), - buildNavBarItem(CupertinoIcons.chart_bar, 'Analytics', 1), + buildNavBarItem(CupertinoIcons.chart_bar_alt_fill, 'Analytics', 1), const SizedBox( width: 20, ), From fddd5beeb9eef62aa1b8954c46947bd8d6cff83f Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:22:14 +0530 Subject: [PATCH 13/50] removed logout button from the --- lib/feature/home/screens/home_screen.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/feature/home/screens/home_screen.dart b/lib/feature/home/screens/home_screen.dart index 5b2d752..df75708 100644 --- a/lib/feature/home/screens/home_screen.dart +++ b/lib/feature/home/screens/home_screen.dart @@ -1,6 +1,5 @@ - +import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; -import 'package:harvest_manager/core/theme/theme.dart'; class HomeScreen extends StatelessWidget { const HomeScreen({super.key}); @@ -8,8 +7,13 @@ class HomeScreen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: TeaTrackerTheme.creamBackground, appBar: AppBar(title: Text("Home")), + body: ElevatedButton( + onPressed: () async { + await FirebaseAuth.instance.signOut(); + }, + child: const Text('Logout'), + ), ); } } From 7a295e0893b4a01e547488b75dbc94645d477e48 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:56:05 +0530 Subject: [PATCH 14/50] featuring bottom nav with a drawer on it --- lib/main.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/main.dart b/lib/main.dart index 3b3d537..b2e7098 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -15,6 +15,7 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { + return MaterialApp( title: 'Flutter Demo', debugShowCheckedModeBanner: false, From 588dbcecaef1a9968753f80de69c307656515fe7 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:11:08 +0530 Subject: [PATCH 15/50] hmoe_screens moved to the screens folder --- lib/{feature/home/components => Screens}/home_screen.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/{feature/home/components => Screens}/home_screen.dart (100%) diff --git a/lib/feature/home/components/home_screen.dart b/lib/Screens/home_screen.dart similarity index 100% rename from lib/feature/home/components/home_screen.dart rename to lib/Screens/home_screen.dart From 40abb9816fd62734f9a0c4667a559753510ebd06 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:13:14 +0530 Subject: [PATCH 16/50] sory my bad. --- lib/{Screens => feature/home/screens}/home_screen.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/{Screens => feature/home/screens}/home_screen.dart (100%) diff --git a/lib/Screens/home_screen.dart b/lib/feature/home/screens/home_screen.dart similarity index 100% rename from lib/Screens/home_screen.dart rename to lib/feature/home/screens/home_screen.dart From 6121f55d5b2205c65220bb4849b3e629639d32b6 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:43:19 +0530 Subject: [PATCH 17/50] created theme/theme.dart --- lib/core/theme/theme.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 lib/core/theme/theme.dart diff --git a/lib/core/theme/theme.dart b/lib/core/theme/theme.dart new file mode 100644 index 0000000..e69de29 From 4db18e9551007c3769b7538565c0d998ef909b0a Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 17:07:10 +0530 Subject: [PATCH 18/50] make changes on theme --- lib/core/theme/theme.dart | 477 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 477 insertions(+) diff --git a/lib/core/theme/theme.dart b/lib/core/theme/theme.dart index e69de29..a1ee860 100644 --- a/lib/core/theme/theme.dart +++ b/lib/core/theme/theme.dart @@ -0,0 +1,477 @@ +import 'package:flutter/material.dart'; + +class TeaTrackerTheme { + // Primary Colors from your Figma design + static const Color primaryGreen = Color(0xFF4CAF50); // Main green from buttons + static const Color darkGreen = Color(0xFF2E7D32); // Dark green for text/borders + static const Color lightGreen = Color(0xFF81C784); // Light green for accents + static const Color paleGreen = Color(0xFF66BB6A); // Medium green + static const Color teaGreen = Color(0xFF8BC34A); // Tea leaf green + + // Background Colors + static const Color creamBackground = Color(0xFFF1F8E9); // Main cream/light green background + static const Color whiteBackground = Color(0xFFFFFFFF); + static const Color cardBackground = Color(0xFFE8F5E8); // Light green card background + static const Color overlayBackground = Color(0xFFF5F5F5); // Light overlay + + // Text Colors + static const Color primaryText = Color(0xFF1B5E20); // Dark green text + static const Color secondaryText = Color(0xFF424242); // Dark gray text + static const Color lightText = Color(0xFF757575); // Light gray text + static const Color whiteText = Color(0xFFFFFFFF); + static const Color placeholderText = Color(0xFF9E9E9E); // Placeholder text + + // Accent Colors + static const Color errorRed = Color(0xFFE53935); // Red for errors/required fields + static const Color warningOrange = Color(0xFFFF9800); + static const Color successGreen = Color(0xFF4CAF50); + static const Color yellowAccent = Color(0xFFFFEB3B); // Yellow from color palette + + // Dashboard Colors + static const Color dashboardCard1 = Color(0xFFE8F5E8); // Light green + static const Color dashboardCard2 = Color(0xFFE1F5FE); // Light blue tint + static const Color dashboardCard3 = Color(0xFFF3E5F5); // Light purple tint + + // Bottom Navigation Colors + static const Color bottomNavBackground = Color(0xFF2E7D32); + static const Color bottomNavSelected = Color(0xFFFFFFFF); + static const Color bottomNavUnselected = Color.fromARGB(179, 0, 0, 0); + + // Gradient Colors + static const LinearGradient backgroundGradient = LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color(0xFFF1F8E9), + Color(0xFFE8F5E8), + ], + ); + + static const LinearGradient buttonGradient = LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + Color(0xFF66BB6A), + Color(0xFF4CAF50), + ], + ); + + static const LinearGradient cardGradient = LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + Color(0xFFFFFFFF), + Color(0xFFF8F8F8), + ], + ); + + // Tea Cup Icon Colors (for branding) + static const Color teaCupPrimary = Color(0xFF8D6E63); // Brown for tea cup + static const Color teaCupSecondary = Color(0xFF4CAF50); // Green tea color + static const Color teaLeafGreen = Color(0xFF689F38); // Tea leaf green + + // Text Styles + static const TextStyle appTitle = TextStyle( + fontSize: 32, + fontWeight: FontWeight.bold, + color: primaryText, + fontFamily: 'Inter', + letterSpacing: -0.5, + ); + + static const TextStyle welcomeTitle = TextStyle( + fontSize: 28, + fontWeight: FontWeight.bold, + color: primaryText, + fontFamily: 'Inter', + ); + + static const TextStyle screenTitle = TextStyle( + fontSize: 24, + fontWeight: FontWeight.w600, + color: primaryText, + fontFamily: 'Inter', + ); + + static const TextStyle sectionTitle = TextStyle( + fontSize: 20, + fontWeight: FontWeight.w600, + color: primaryText, + fontFamily: 'Inter', + ); + + static const TextStyle cardTitle = TextStyle( + fontSize: 18, + fontWeight: FontWeight.w600, + color: primaryText, + fontFamily: 'Inter', + ); + + static const TextStyle bodyLarge = TextStyle( + fontSize: 16, + fontWeight: FontWeight.normal, + color: secondaryText, + fontFamily: 'Inter', + ); + + static const TextStyle bodyMedium = TextStyle( + fontSize: 14, + fontWeight: FontWeight.normal, + color: secondaryText, + fontFamily: 'Inter', + ); + + static const TextStyle bodySmall = TextStyle( + fontSize: 12, + fontWeight: FontWeight.normal, + color: lightText, + fontFamily: 'Inter', + ); + + static const TextStyle buttonText = TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: whiteText, + fontFamily: 'Inter', + ); + + static const TextStyle linkText = TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: primaryGreen, + decoration: TextDecoration.underline, + fontFamily: 'Inter', + ); + + // Dashboard specific text styles + static const TextStyle dashboardMetricNumber = TextStyle( + fontSize: 32, + fontWeight: FontWeight.bold, + color: primaryGreen, + fontFamily: 'Inter', + ); + + static const TextStyle dashboardMetricLabel = TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: secondaryText, + fontFamily: 'Inter', + ); + + static const TextStyle dashboardSubtitle = TextStyle( + fontSize: 12, + fontWeight: FontWeight.normal, + color: lightText, + fontFamily: 'Inter', + ); + + // Form field styles + static const TextStyle fieldLabel = TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: primaryText, + fontFamily: 'Inter', + ); + + static const TextStyle fieldError = TextStyle( + fontSize: 12, + fontWeight: FontWeight.normal, + color: errorRed, + fontFamily: 'Inter', + ); + + // Input Decoration + static InputDecoration inputDecoration({ + required String labelText, + String? hintText, + IconData? prefixIcon, + Widget? suffixIcon, + bool isRequired = false, + }) { + return InputDecoration( + labelText: labelText, + hintText: hintText, + prefixIcon: prefixIcon != null ? Icon(prefixIcon, color: primaryGreen) : null, + suffixIcon: suffixIcon, + filled: true, + fillColor: whiteBackground, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: lightGreen, width: 1), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: lightGreen, width: 1), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: primaryGreen, width: 2), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: errorRed, width: 1), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: errorRed, width: 2), + ), + labelStyle: fieldLabel, + hintStyle: TextStyle(color: placeholderText), + errorStyle: fieldError, + contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), + ); + } + + // Button Styles + static final ElevatedButtonThemeData elevatedButtonTheme = ElevatedButtonThemeData( + style: ElevatedButton.styleFrom( + backgroundColor: primaryGreen, + foregroundColor: whiteText, + padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + elevation: 2, + shadowColor: primaryGreen.withOpacity(0.3), + textStyle: buttonText, + ), + ); + + static final OutlinedButtonThemeData outlinedButtonTheme = OutlinedButtonThemeData( + style: OutlinedButton.styleFrom( + foregroundColor: primaryGreen, + padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + side: const BorderSide(color: primaryGreen, width: 1.5), + textStyle: buttonText.copyWith(color: primaryGreen), + ), + ); + + // Card Theme + static final CardTheme cardTheme = CardTheme( + color: whiteBackground, + elevation: 4, + shadowColor: primaryGreen.withOpacity(0.15), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + ), + margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + ); + + // AppBar Theme + static const AppBarTheme appBarTheme = AppBarTheme( + backgroundColor: Colors.transparent, + elevation: 0, + iconTheme: IconThemeData(color: primaryText), + titleTextStyle: screenTitle, + centerTitle: true, + ); + + // Bottom Navigation Bar Theme + static final BottomNavigationBarThemeData bottomNavTheme = BottomNavigationBarThemeData( + backgroundColor: bottomNavBackground, + selectedItemColor: bottomNavSelected, + unselectedItemColor: bottomNavUnselected, + type: BottomNavigationBarType.fixed, + elevation: 8, + selectedLabelStyle: const TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + fontFamily: 'Inter', + ), + unselectedLabelStyle: const TextStyle( + fontSize: 11, + fontWeight: FontWeight.normal, + fontFamily: 'Inter', + ), + ); + + // Main Theme Data + static ThemeData get lightTheme { + return ThemeData( + useMaterial3: true, + + // Color Scheme + colorScheme: const ColorScheme.light( + primary: primaryGreen, + primaryContainer: lightGreen, + secondary: teaGreen, + secondaryContainer: cardBackground, + surface: whiteBackground, + background: creamBackground, + error: errorRed, + onPrimary: whiteText, + onSecondary: primaryText, + onSurface: primaryText, + onBackground: primaryText, + onError: whiteText, + ), + + // Scaffold Background + scaffoldBackgroundColor: creamBackground, + + // App Bar Theme + appBarTheme: appBarTheme, + + // Button Themes + elevatedButtonTheme: elevatedButtonTheme, + outlinedButtonTheme: outlinedButtonTheme, + + // Card Theme + cardTheme: cardTheme, + + // Bottom Navigation Theme + bottomNavigationBarTheme: bottomNavTheme, + + // Input Decoration Theme + inputDecorationTheme: InputDecorationTheme( + filled: true, + fillColor: whiteBackground, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: lightGreen, width: 1), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: lightGreen, width: 1), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: primaryGreen, width: 2), + ), + labelStyle: fieldLabel, + hintStyle: TextStyle(color: placeholderText), + contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), + ), + + // Text Theme + textTheme: const TextTheme( + displayLarge: appTitle, + displayMedium: welcomeTitle, + displaySmall: screenTitle, + headlineLarge: welcomeTitle, + headlineMedium: screenTitle, + headlineSmall: sectionTitle, + titleLarge: sectionTitle, + titleMedium: cardTitle, + titleSmall: bodyLarge, + bodyLarge: bodyLarge, + bodyMedium: bodyMedium, + bodySmall: bodySmall, + labelLarge: buttonText, + labelMedium: bodyMedium, + labelSmall: bodySmall, + ), + + // Icon Theme + iconTheme: const IconThemeData( + color: primaryGreen, + size: 24, + ), + + // Divider Theme + dividerTheme: DividerThemeData( + color: lightGreen.withOpacity(0.3), + thickness: 1, + space: 16, + ), + + // Checkbox Theme + checkboxTheme: CheckboxThemeData( + fillColor: MaterialStateProperty.resolveWith((states) { + if (states.contains(MaterialState.selected)) { + return primaryGreen; + } + return null; + }), + checkColor: MaterialStateProperty.all(whiteText), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)), + ), + + // Font Family + fontFamily: 'Inter', + ); + } + + // Custom Box Decorations + static BoxDecoration get authCardDecoration => BoxDecoration( + gradient: cardGradient, + borderRadius: BorderRadius.circular(20), + boxShadow: [ + BoxShadow( + color: primaryGreen.withOpacity(0.1), + blurRadius: 20, + offset: const Offset(0, 8), + ), + ], + ); + + static BoxDecoration get dashboardCardDecoration => BoxDecoration( + color: whiteBackground, + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: primaryGreen.withOpacity(0.08), + blurRadius: 8, + offset: const Offset(0, 4), + ), + ], + ); + + static BoxDecoration get factoryCardDecoration => BoxDecoration( + color: whiteBackground, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: lightGreen.withOpacity(0.3), width: 1), + ); + + static BoxDecoration get backgroundDecoration => const BoxDecoration( + gradient: backgroundGradient, + ); + + static BoxDecoration get buttonDecoration => const BoxDecoration( + gradient: buttonGradient, + borderRadius: BorderRadius.all(Radius.circular(12)), + ); + + // FAB decoration for the centered add button + static BoxDecoration get fabDecoration => BoxDecoration( + gradient: buttonGradient, + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + color: primaryGreen.withOpacity(0.3), + blurRadius: 12, + offset: const Offset(0, 6), + ), + ], + ); + + // Welcome screen specific decorations + static BoxDecoration get welcomeBackgroundDecoration => const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color(0xFFF1F8E9), + Color(0xFFE8F5E8), + ], + ), + ); + + // Chart colors for analytics + static List get chartColors => [ + primaryGreen, + lightGreen, + teaGreen, + paleGreen, + darkGreen, + ]; + + // Status colors + static const Color activeStatus = Color(0xFF4CAF50); + static const Color inactiveStatus = Color(0xFF9E9E9E); + static const Color pendingStatus = Color(0xFFFF9800); + static const Color completedStatus = Color(0xFF66BB6A); +} \ No newline at end of file From d93a1a93e6f1ac2dde9881343df4ec1121afe36d Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 17:07:24 +0530 Subject: [PATCH 19/50] add theme colors to nav bar --- lib/feature/navbar/bottom_navbar.dart | 46 ++++++++++++++------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/lib/feature/navbar/bottom_navbar.dart b/lib/feature/navbar/bottom_navbar.dart index 138cac7..f233b28 100644 --- a/lib/feature/navbar/bottom_navbar.dart +++ b/lib/feature/navbar/bottom_navbar.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; +import 'package:harvest_manager/core/theme/theme.dart'; import 'package:harvest_manager/feature/drawer/app_drawer.dart'; class BottomNavbar extends StatefulWidget { @@ -29,10 +30,12 @@ class _BottomNavbarState extends State { @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: TeaTrackerTheme.creamBackground, body: _screens[_selectedIndex], drawer: AppDrawer(onItemTapped: _onItemTapped), // Use the separate drawer bottomNavigationBar: BottomAppBar( - color: const Color.fromARGB(214, 13, 110, 17), + color: TeaTrackerTheme.bottomNavBackground, + elevation: 8, child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ @@ -42,24 +45,20 @@ class _BottomNavbarState extends State { width: 20, ), buildNavBarItem(CupertinoIcons.bell, 'Notifications', 3), - buildDrawerItem(), // Drawer icon instead of menu + buildDrawerItem(), ], ), ), - floatingActionButton: ClipOval( - child: Material( - color: const Color.fromARGB(214, 155, 236, 157), - elevation: 10, - child: InkWell( - child: const SizedBox( - width: 56, - height: 56, - child: Icon( - CupertinoIcons.add_circled, - size: 56, - color: Colors.black, - ), - ), + floatingActionButton: Container( + decoration: TeaTrackerTheme.fabDecoration, + child: FloatingActionButton( + onPressed: () => _onItemTapped(2), + backgroundColor: Colors.transparent, + elevation: 0, + child: const Icon( + CupertinoIcons.add, + size: 28, + color: TeaTrackerTheme.whiteText, ), ), ), @@ -70,21 +69,23 @@ class _BottomNavbarState extends State { Widget buildNavBarItem(IconData icon, String label, int index) { return InkWell( onTap: () => _onItemTapped(index), + borderRadius: BorderRadius.circular(8), child: Column( mainAxisSize: MainAxisSize.min, children: [ Icon( icon, color: _selectedIndex == index - ? const Color.fromARGB(214, 155, 236, 157) - : Colors.black87, + ? TeaTrackerTheme.bottomNavSelected + : TeaTrackerTheme.bottomNavUnselected, ), Text( label, style: TextStyle( color: _selectedIndex == index - ? const Color.fromARGB(214, 155, 236, 157) - : Colors.black87, + ? TeaTrackerTheme.bottomNavSelected + : TeaTrackerTheme.bottomNavUnselected, + fontFamily: 'Inder', ), ), ], @@ -99,17 +100,18 @@ class _BottomNavbarState extends State { onTap: () { Scaffold.of(context).openDrawer(); }, + borderRadius: BorderRadius.circular(8), child: const Column( mainAxisSize: MainAxisSize.min, children: [ Icon( CupertinoIcons.line_horizontal_3, - color: Colors.black87, + color: TeaTrackerTheme.bottomNavUnselected, ), Text( 'Menu', style: TextStyle( - color: Colors.black87, + color: TeaTrackerTheme.bottomNavUnselected, ), ), ], From bcc2f081cb703a83439916ead1c37c8733aedb07 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 17:09:52 +0530 Subject: [PATCH 20/50] add theme colors to drawer --- lib/feature/drawer/app_drawer.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/feature/drawer/app_drawer.dart b/lib/feature/drawer/app_drawer.dart index ad55eaa..6462957 100644 --- a/lib/feature/drawer/app_drawer.dart +++ b/lib/feature/drawer/app_drawer.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; +import 'package:harvest_manager/core/theme/theme.dart'; class AppDrawer extends StatelessWidget { final Function(int) onItemTapped; @@ -17,12 +18,12 @@ class AppDrawer extends StatelessWidget { children: [ const DrawerHeader( decoration: BoxDecoration( - color: Color.fromARGB(214, 13, 110, 17), + color: TeaTrackerTheme.darkGreen, ), child: Text( 'Menu', style: TextStyle( - color: Colors.white, + color: TeaTrackerTheme.whiteBackground, fontSize: 24, ), ), From 235fa9b70ec8c76f00aae2fc0f14afadb420e743 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Fri, 6 Jun 2025 23:15:39 +0530 Subject: [PATCH 21/50] change while resolving complicts --- lib/feature/home/screens/home_screen.dart | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/feature/home/screens/home_screen.dart b/lib/feature/home/screens/home_screen.dart index eca400f..df75708 100644 --- a/lib/feature/home/screens/home_screen.dart +++ b/lib/feature/home/screens/home_screen.dart @@ -1,15 +1,19 @@ +import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; -class HomeScreen extends StatefulWidget { +class HomeScreen extends StatelessWidget { const HomeScreen({super.key}); - @override - State createState() => _HomeScreenState(); -} - -class _HomeScreenState extends State { @override Widget build(BuildContext context) { - return const Placeholder(); + return Scaffold( + appBar: AppBar(title: Text("Home")), + body: ElevatedButton( + onPressed: () async { + await FirebaseAuth.instance.signOut(); + }, + child: const Text('Logout'), + ), + ); } -} \ No newline at end of file +} From 3fbb2b3b89d96fa95e98b40aa6469e21eac477dc Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Sun, 8 Jun 2025 11:41:40 +0530 Subject: [PATCH 22/50] romed unwated thinggs and change routing --- lib/core/theme/theme.dart | 77 ++------------------------- lib/feature/navbar/bottom_navbar.dart | 12 +++-- lib/main.dart | 6 +-- 3 files changed, 13 insertions(+), 82 deletions(-) diff --git a/lib/core/theme/theme.dart b/lib/core/theme/theme.dart index a1ee860..77d1a5e 100644 --- a/lib/core/theme/theme.dart +++ b/lib/core/theme/theme.dart @@ -27,25 +27,12 @@ class TeaTrackerTheme { static const Color successGreen = Color(0xFF4CAF50); static const Color yellowAccent = Color(0xFFFFEB3B); // Yellow from color palette - // Dashboard Colors - static const Color dashboardCard1 = Color(0xFFE8F5E8); // Light green - static const Color dashboardCard2 = Color(0xFFE1F5FE); // Light blue tint - static const Color dashboardCard3 = Color(0xFFF3E5F5); // Light purple tint // Bottom Navigation Colors static const Color bottomNavBackground = Color(0xFF2E7D32); static const Color bottomNavSelected = Color(0xFFFFFFFF); static const Color bottomNavUnselected = Color.fromARGB(179, 0, 0, 0); - // Gradient Colors - static const LinearGradient backgroundGradient = LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Color(0xFFF1F8E9), - Color(0xFFE8F5E8), - ], - ); static const LinearGradient buttonGradient = LinearGradient( begin: Alignment.topLeft, @@ -237,28 +224,6 @@ class TeaTrackerTheme { ), ); - static final OutlinedButtonThemeData outlinedButtonTheme = OutlinedButtonThemeData( - style: OutlinedButton.styleFrom( - foregroundColor: primaryGreen, - padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - ), - side: const BorderSide(color: primaryGreen, width: 1.5), - textStyle: buttonText.copyWith(color: primaryGreen), - ), - ); - - // Card Theme - static final CardTheme cardTheme = CardTheme( - color: whiteBackground, - elevation: 4, - shadowColor: primaryGreen.withOpacity(0.15), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(16), - ), - margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), - ); // AppBar Theme static const AppBarTheme appBarTheme = AppBarTheme( @@ -300,12 +265,10 @@ class TeaTrackerTheme { secondary: teaGreen, secondaryContainer: cardBackground, surface: whiteBackground, - background: creamBackground, error: errorRed, onPrimary: whiteText, onSecondary: primaryText, onSurface: primaryText, - onBackground: primaryText, onError: whiteText, ), @@ -315,13 +278,6 @@ class TeaTrackerTheme { // App Bar Theme appBarTheme: appBarTheme, - // Button Themes - elevatedButtonTheme: elevatedButtonTheme, - outlinedButtonTheme: outlinedButtonTheme, - - // Card Theme - cardTheme: cardTheme, - // Bottom Navigation Theme bottomNavigationBarTheme: bottomNavTheme, @@ -380,13 +336,13 @@ class TeaTrackerTheme { // Checkbox Theme checkboxTheme: CheckboxThemeData( - fillColor: MaterialStateProperty.resolveWith((states) { - if (states.contains(MaterialState.selected)) { + fillColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.selected)) { return primaryGreen; } return null; }), - checkColor: MaterialStateProperty.all(whiteText), + checkColor: WidgetStateProperty.all(whiteText), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)), ), @@ -395,19 +351,6 @@ class TeaTrackerTheme { ); } - // Custom Box Decorations - static BoxDecoration get authCardDecoration => BoxDecoration( - gradient: cardGradient, - borderRadius: BorderRadius.circular(20), - boxShadow: [ - BoxShadow( - color: primaryGreen.withOpacity(0.1), - blurRadius: 20, - offset: const Offset(0, 8), - ), - ], - ); - static BoxDecoration get dashboardCardDecoration => BoxDecoration( color: whiteBackground, borderRadius: BorderRadius.circular(16), @@ -426,15 +369,6 @@ class TeaTrackerTheme { border: Border.all(color: lightGreen.withOpacity(0.3), width: 1), ); - static BoxDecoration get backgroundDecoration => const BoxDecoration( - gradient: backgroundGradient, - ); - - static BoxDecoration get buttonDecoration => const BoxDecoration( - gradient: buttonGradient, - borderRadius: BorderRadius.all(Radius.circular(12)), - ); - // FAB decoration for the centered add button static BoxDecoration get fabDecoration => BoxDecoration( gradient: buttonGradient, @@ -469,9 +403,4 @@ class TeaTrackerTheme { darkGreen, ]; - // Status colors - static const Color activeStatus = Color(0xFF4CAF50); - static const Color inactiveStatus = Color(0xFF9E9E9E); - static const Color pendingStatus = Color(0xFFFF9800); - static const Color completedStatus = Color(0xFF66BB6A); } \ No newline at end of file diff --git a/lib/feature/navbar/bottom_navbar.dart b/lib/feature/navbar/bottom_navbar.dart index f233b28..ad70a7f 100644 --- a/lib/feature/navbar/bottom_navbar.dart +++ b/lib/feature/navbar/bottom_navbar.dart @@ -3,6 +3,8 @@ import 'package:flutter/cupertino.dart'; import 'package:harvest_manager/core/theme/theme.dart'; import 'package:harvest_manager/feature/drawer/app_drawer.dart'; +import '../home/screens/home_screen.dart'; + class BottomNavbar extends StatefulWidget { const BottomNavbar({super.key}); @@ -14,11 +16,11 @@ class _BottomNavbarState extends State { int _selectedIndex = 0; static final List _screens = [ - Container(child: const Center(child: Text('Home Screen'))), // index 0 - Container(child: const Center(child: Text('Analytics Screen'))), // index 1 - Container(child: const Center(child: Text('Add'))), // index 2 - Container(child: const Center(child: Text('Notifications Screen'))), // index 3 - Container(child: const Center(child: Text('Menu Screen'))), // index 4 + const HomeScreen(), // index 0 - Your home screen + //const AnalyticsPage(), // index 1 - Analytics page + //const AddPage(), // index 2 - Add page + //const NotificationsPage(), // index 3 - Notifications page + const Center(child: Text('Menu Screen')), // index 4 - Keep as is since menu is in drawer ]; void _onItemTapped(int index) { diff --git a/lib/main.dart b/lib/main.dart index b2e7098..13e84a7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:firebase_core/firebase_core.dart'; -import 'package:harvest_manager/wrapper.dart'; +import 'package:harvest_manager/feature/navbar/bottom_navbar.dart'; import 'firebase_options.dart'; @@ -17,9 +17,9 @@ class MyApp extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp( - title: 'Flutter Demo', + title: 'Harvest Manager', debugShowCheckedModeBanner: false, - home: Wrapper(), + home: const BottomNavbar(), ); } } \ No newline at end of file From 1c84d904ecdc79edb1e30279c15e545c65132523 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Sun, 8 Jun 2025 11:42:30 +0530 Subject: [PATCH 23/50] add a logout button and customized --- lib/feature/drawer/app_drawer.dart | 26 +++++++++++++++++++++++ lib/feature/home/screens/home_screen.dart | 10 +++------ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/lib/feature/drawer/app_drawer.dart b/lib/feature/drawer/app_drawer.dart index 6462957..2b3cb12 100644 --- a/lib/feature/drawer/app_drawer.dart +++ b/lib/feature/drawer/app_drawer.dart @@ -1,3 +1,4 @@ +import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:harvest_manager/core/theme/theme.dart'; @@ -44,6 +45,31 @@ class AppDrawer extends StatelessWidget { }, ), + const Spacer(), + const Divider(), + ListTile( + leading: const Icon(CupertinoIcons.square_arrow_right), + title: const Text('Logout'), + onTap: ()async { + Navigator .pop(context); + try { + await FirebaseAuth.instance.signOut(); + + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Logged out successfully')), + ); + } + } + catch (e) { + if (context.mounted){ + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text('Error logging out: $e')), + ); + } + } + }, + ), ], ), ); diff --git a/lib/feature/home/screens/home_screen.dart b/lib/feature/home/screens/home_screen.dart index df75708..5b2d752 100644 --- a/lib/feature/home/screens/home_screen.dart +++ b/lib/feature/home/screens/home_screen.dart @@ -1,5 +1,6 @@ -import 'package:firebase_auth/firebase_auth.dart'; + import 'package:flutter/material.dart'; +import 'package:harvest_manager/core/theme/theme.dart'; class HomeScreen extends StatelessWidget { const HomeScreen({super.key}); @@ -7,13 +8,8 @@ class HomeScreen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: TeaTrackerTheme.creamBackground, appBar: AppBar(title: Text("Home")), - body: ElevatedButton( - onPressed: () async { - await FirebaseAuth.instance.signOut(); - }, - child: const Text('Logout'), - ), ); } } From 1160fcdcb11f9dfa5366a9d2fcd31179c1a4c7dd Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Sun, 8 Jun 2025 12:16:53 +0530 Subject: [PATCH 24/50] brought logout button to bottom. --- lib/feature/drawer/app_drawer.dart | 63 +++++++++++++++++------------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/lib/feature/drawer/app_drawer.dart b/lib/feature/drawer/app_drawer.dart index 2b3cb12..7007d64 100644 --- a/lib/feature/drawer/app_drawer.dart +++ b/lib/feature/drawer/app_drawer.dart @@ -14,18 +14,23 @@ class AppDrawer extends StatelessWidget { @override Widget build(BuildContext context) { return Drawer( - child: ListView( - padding: EdgeInsets.zero, + backgroundColor: TeaTrackerTheme.creamBackground, + child: Column( children: [ - const DrawerHeader( - decoration: BoxDecoration( + Container( + height: 80, + width: double.infinity, + decoration: const BoxDecoration( color: TeaTrackerTheme.darkGreen, ), - child: Text( + alignment: Alignment.centerLeft, + padding: const EdgeInsets.only(left: 16), + child: const Text( 'Menu', style: TextStyle( color: TeaTrackerTheme.whiteBackground, - fontSize: 24, + fontSize: 20, + fontWeight: FontWeight.w500, ), ), ), @@ -42,33 +47,37 @@ class AppDrawer extends StatelessWidget { title: const Text('About'), onTap: () { Navigator.pop(context); - }, ), + const Spacer(), - const Divider(), - ListTile( - leading: const Icon(CupertinoIcons.square_arrow_right), - title: const Text('Logout'), - onTap: ()async { - Navigator .pop(context); - try { - await FirebaseAuth.instance.signOut(); + const Divider(height: 1), + Container( + padding: const EdgeInsets.only(bottom: 16), + child: ListTile( + leading: const Icon(CupertinoIcons.square_arrow_right), + title: const Text('Logout'), + dense: true, + onTap: ()async { + Navigator .pop(context); + try { + await FirebaseAuth.instance.signOut(); - if (context.mounted) { - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar(content: Text('Logged out successfully')), - ); + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Logged out successfully')), + ); + } } - } - catch (e) { - if (context.mounted){ - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text('Error logging out: $e')), - ); + catch (e) { + if (context.mounted){ + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text('Error logging out: $e')), + ); + } } - } - }, + }, + ), ), ], ), From fe7b3f64d61255a21d01d8deafa21d687c08b921 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Mon, 9 Jun 2025 10:35:00 +0530 Subject: [PATCH 25/50] updated analytics button --- lib/feature/navbar/bottom_navbar.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/feature/navbar/bottom_navbar.dart b/lib/feature/navbar/bottom_navbar.dart index ad70a7f..46a301e 100644 --- a/lib/feature/navbar/bottom_navbar.dart +++ b/lib/feature/navbar/bottom_navbar.dart @@ -42,7 +42,7 @@ class _BottomNavbarState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ buildNavBarItem(CupertinoIcons.home, 'Home', 0), - buildNavBarItem(CupertinoIcons.chart_bar, 'Analytics', 1), + buildNavBarItem(CupertinoIcons.chart_bar_alt_fill, 'Analytics', 1), const SizedBox( width: 20, ), From 287c1b4cc9eeddf930d0a1fec13b50ab47896afd Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:22:14 +0530 Subject: [PATCH 26/50] removed logout button from the --- lib/feature/home/screens/home_screen.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/feature/home/screens/home_screen.dart b/lib/feature/home/screens/home_screen.dart index 5b2d752..df75708 100644 --- a/lib/feature/home/screens/home_screen.dart +++ b/lib/feature/home/screens/home_screen.dart @@ -1,6 +1,5 @@ - +import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; -import 'package:harvest_manager/core/theme/theme.dart'; class HomeScreen extends StatelessWidget { const HomeScreen({super.key}); @@ -8,8 +7,13 @@ class HomeScreen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: TeaTrackerTheme.creamBackground, appBar: AppBar(title: Text("Home")), + body: ElevatedButton( + onPressed: () async { + await FirebaseAuth.instance.signOut(); + }, + child: const Text('Logout'), + ), ); } } From 4ec91371b65092c98a428a49eb6fca7fa2e30e7d Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:56:05 +0530 Subject: [PATCH 27/50] featuring bottom nav with a drawer on it --- lib/main.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/main.dart b/lib/main.dart index 3b3d537..b2e7098 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -15,6 +15,7 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { + return MaterialApp( title: 'Flutter Demo', debugShowCheckedModeBanner: false, From b44f2d8fbfe4b35b0b953308e001d073f88884ef Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:11:08 +0530 Subject: [PATCH 28/50] hmoe_screens moved to the screens folder --- lib/{feature/home/components => Screens}/home_screen.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/{feature/home/components => Screens}/home_screen.dart (100%) diff --git a/lib/feature/home/components/home_screen.dart b/lib/Screens/home_screen.dart similarity index 100% rename from lib/feature/home/components/home_screen.dart rename to lib/Screens/home_screen.dart From 2537d12623b774fef4effb369b670ee4a5004473 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:13:14 +0530 Subject: [PATCH 29/50] sory my bad. --- lib/{Screens => feature/home/screens}/home_screen.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/{Screens => feature/home/screens}/home_screen.dart (100%) diff --git a/lib/Screens/home_screen.dart b/lib/feature/home/screens/home_screen.dart similarity index 100% rename from lib/Screens/home_screen.dart rename to lib/feature/home/screens/home_screen.dart From 17cd79215aa06e23bd2f3efa080f67f17af129bc Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:43:19 +0530 Subject: [PATCH 30/50] created theme/theme.dart --- lib/core/theme/theme.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 lib/core/theme/theme.dart diff --git a/lib/core/theme/theme.dart b/lib/core/theme/theme.dart new file mode 100644 index 0000000..e69de29 From 56e70640681846241e1199f43af03067452b25f9 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 17:07:10 +0530 Subject: [PATCH 31/50] make changes on theme --- lib/core/theme/theme.dart | 477 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 477 insertions(+) diff --git a/lib/core/theme/theme.dart b/lib/core/theme/theme.dart index e69de29..a1ee860 100644 --- a/lib/core/theme/theme.dart +++ b/lib/core/theme/theme.dart @@ -0,0 +1,477 @@ +import 'package:flutter/material.dart'; + +class TeaTrackerTheme { + // Primary Colors from your Figma design + static const Color primaryGreen = Color(0xFF4CAF50); // Main green from buttons + static const Color darkGreen = Color(0xFF2E7D32); // Dark green for text/borders + static const Color lightGreen = Color(0xFF81C784); // Light green for accents + static const Color paleGreen = Color(0xFF66BB6A); // Medium green + static const Color teaGreen = Color(0xFF8BC34A); // Tea leaf green + + // Background Colors + static const Color creamBackground = Color(0xFFF1F8E9); // Main cream/light green background + static const Color whiteBackground = Color(0xFFFFFFFF); + static const Color cardBackground = Color(0xFFE8F5E8); // Light green card background + static const Color overlayBackground = Color(0xFFF5F5F5); // Light overlay + + // Text Colors + static const Color primaryText = Color(0xFF1B5E20); // Dark green text + static const Color secondaryText = Color(0xFF424242); // Dark gray text + static const Color lightText = Color(0xFF757575); // Light gray text + static const Color whiteText = Color(0xFFFFFFFF); + static const Color placeholderText = Color(0xFF9E9E9E); // Placeholder text + + // Accent Colors + static const Color errorRed = Color(0xFFE53935); // Red for errors/required fields + static const Color warningOrange = Color(0xFFFF9800); + static const Color successGreen = Color(0xFF4CAF50); + static const Color yellowAccent = Color(0xFFFFEB3B); // Yellow from color palette + + // Dashboard Colors + static const Color dashboardCard1 = Color(0xFFE8F5E8); // Light green + static const Color dashboardCard2 = Color(0xFFE1F5FE); // Light blue tint + static const Color dashboardCard3 = Color(0xFFF3E5F5); // Light purple tint + + // Bottom Navigation Colors + static const Color bottomNavBackground = Color(0xFF2E7D32); + static const Color bottomNavSelected = Color(0xFFFFFFFF); + static const Color bottomNavUnselected = Color.fromARGB(179, 0, 0, 0); + + // Gradient Colors + static const LinearGradient backgroundGradient = LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color(0xFFF1F8E9), + Color(0xFFE8F5E8), + ], + ); + + static const LinearGradient buttonGradient = LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + Color(0xFF66BB6A), + Color(0xFF4CAF50), + ], + ); + + static const LinearGradient cardGradient = LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + Color(0xFFFFFFFF), + Color(0xFFF8F8F8), + ], + ); + + // Tea Cup Icon Colors (for branding) + static const Color teaCupPrimary = Color(0xFF8D6E63); // Brown for tea cup + static const Color teaCupSecondary = Color(0xFF4CAF50); // Green tea color + static const Color teaLeafGreen = Color(0xFF689F38); // Tea leaf green + + // Text Styles + static const TextStyle appTitle = TextStyle( + fontSize: 32, + fontWeight: FontWeight.bold, + color: primaryText, + fontFamily: 'Inter', + letterSpacing: -0.5, + ); + + static const TextStyle welcomeTitle = TextStyle( + fontSize: 28, + fontWeight: FontWeight.bold, + color: primaryText, + fontFamily: 'Inter', + ); + + static const TextStyle screenTitle = TextStyle( + fontSize: 24, + fontWeight: FontWeight.w600, + color: primaryText, + fontFamily: 'Inter', + ); + + static const TextStyle sectionTitle = TextStyle( + fontSize: 20, + fontWeight: FontWeight.w600, + color: primaryText, + fontFamily: 'Inter', + ); + + static const TextStyle cardTitle = TextStyle( + fontSize: 18, + fontWeight: FontWeight.w600, + color: primaryText, + fontFamily: 'Inter', + ); + + static const TextStyle bodyLarge = TextStyle( + fontSize: 16, + fontWeight: FontWeight.normal, + color: secondaryText, + fontFamily: 'Inter', + ); + + static const TextStyle bodyMedium = TextStyle( + fontSize: 14, + fontWeight: FontWeight.normal, + color: secondaryText, + fontFamily: 'Inter', + ); + + static const TextStyle bodySmall = TextStyle( + fontSize: 12, + fontWeight: FontWeight.normal, + color: lightText, + fontFamily: 'Inter', + ); + + static const TextStyle buttonText = TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: whiteText, + fontFamily: 'Inter', + ); + + static const TextStyle linkText = TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: primaryGreen, + decoration: TextDecoration.underline, + fontFamily: 'Inter', + ); + + // Dashboard specific text styles + static const TextStyle dashboardMetricNumber = TextStyle( + fontSize: 32, + fontWeight: FontWeight.bold, + color: primaryGreen, + fontFamily: 'Inter', + ); + + static const TextStyle dashboardMetricLabel = TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: secondaryText, + fontFamily: 'Inter', + ); + + static const TextStyle dashboardSubtitle = TextStyle( + fontSize: 12, + fontWeight: FontWeight.normal, + color: lightText, + fontFamily: 'Inter', + ); + + // Form field styles + static const TextStyle fieldLabel = TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: primaryText, + fontFamily: 'Inter', + ); + + static const TextStyle fieldError = TextStyle( + fontSize: 12, + fontWeight: FontWeight.normal, + color: errorRed, + fontFamily: 'Inter', + ); + + // Input Decoration + static InputDecoration inputDecoration({ + required String labelText, + String? hintText, + IconData? prefixIcon, + Widget? suffixIcon, + bool isRequired = false, + }) { + return InputDecoration( + labelText: labelText, + hintText: hintText, + prefixIcon: prefixIcon != null ? Icon(prefixIcon, color: primaryGreen) : null, + suffixIcon: suffixIcon, + filled: true, + fillColor: whiteBackground, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: lightGreen, width: 1), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: lightGreen, width: 1), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: primaryGreen, width: 2), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: errorRed, width: 1), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: errorRed, width: 2), + ), + labelStyle: fieldLabel, + hintStyle: TextStyle(color: placeholderText), + errorStyle: fieldError, + contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), + ); + } + + // Button Styles + static final ElevatedButtonThemeData elevatedButtonTheme = ElevatedButtonThemeData( + style: ElevatedButton.styleFrom( + backgroundColor: primaryGreen, + foregroundColor: whiteText, + padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + elevation: 2, + shadowColor: primaryGreen.withOpacity(0.3), + textStyle: buttonText, + ), + ); + + static final OutlinedButtonThemeData outlinedButtonTheme = OutlinedButtonThemeData( + style: OutlinedButton.styleFrom( + foregroundColor: primaryGreen, + padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + side: const BorderSide(color: primaryGreen, width: 1.5), + textStyle: buttonText.copyWith(color: primaryGreen), + ), + ); + + // Card Theme + static final CardTheme cardTheme = CardTheme( + color: whiteBackground, + elevation: 4, + shadowColor: primaryGreen.withOpacity(0.15), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + ), + margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + ); + + // AppBar Theme + static const AppBarTheme appBarTheme = AppBarTheme( + backgroundColor: Colors.transparent, + elevation: 0, + iconTheme: IconThemeData(color: primaryText), + titleTextStyle: screenTitle, + centerTitle: true, + ); + + // Bottom Navigation Bar Theme + static final BottomNavigationBarThemeData bottomNavTheme = BottomNavigationBarThemeData( + backgroundColor: bottomNavBackground, + selectedItemColor: bottomNavSelected, + unselectedItemColor: bottomNavUnselected, + type: BottomNavigationBarType.fixed, + elevation: 8, + selectedLabelStyle: const TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + fontFamily: 'Inter', + ), + unselectedLabelStyle: const TextStyle( + fontSize: 11, + fontWeight: FontWeight.normal, + fontFamily: 'Inter', + ), + ); + + // Main Theme Data + static ThemeData get lightTheme { + return ThemeData( + useMaterial3: true, + + // Color Scheme + colorScheme: const ColorScheme.light( + primary: primaryGreen, + primaryContainer: lightGreen, + secondary: teaGreen, + secondaryContainer: cardBackground, + surface: whiteBackground, + background: creamBackground, + error: errorRed, + onPrimary: whiteText, + onSecondary: primaryText, + onSurface: primaryText, + onBackground: primaryText, + onError: whiteText, + ), + + // Scaffold Background + scaffoldBackgroundColor: creamBackground, + + // App Bar Theme + appBarTheme: appBarTheme, + + // Button Themes + elevatedButtonTheme: elevatedButtonTheme, + outlinedButtonTheme: outlinedButtonTheme, + + // Card Theme + cardTheme: cardTheme, + + // Bottom Navigation Theme + bottomNavigationBarTheme: bottomNavTheme, + + // Input Decoration Theme + inputDecorationTheme: InputDecorationTheme( + filled: true, + fillColor: whiteBackground, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: lightGreen, width: 1), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: lightGreen, width: 1), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: primaryGreen, width: 2), + ), + labelStyle: fieldLabel, + hintStyle: TextStyle(color: placeholderText), + contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), + ), + + // Text Theme + textTheme: const TextTheme( + displayLarge: appTitle, + displayMedium: welcomeTitle, + displaySmall: screenTitle, + headlineLarge: welcomeTitle, + headlineMedium: screenTitle, + headlineSmall: sectionTitle, + titleLarge: sectionTitle, + titleMedium: cardTitle, + titleSmall: bodyLarge, + bodyLarge: bodyLarge, + bodyMedium: bodyMedium, + bodySmall: bodySmall, + labelLarge: buttonText, + labelMedium: bodyMedium, + labelSmall: bodySmall, + ), + + // Icon Theme + iconTheme: const IconThemeData( + color: primaryGreen, + size: 24, + ), + + // Divider Theme + dividerTheme: DividerThemeData( + color: lightGreen.withOpacity(0.3), + thickness: 1, + space: 16, + ), + + // Checkbox Theme + checkboxTheme: CheckboxThemeData( + fillColor: MaterialStateProperty.resolveWith((states) { + if (states.contains(MaterialState.selected)) { + return primaryGreen; + } + return null; + }), + checkColor: MaterialStateProperty.all(whiteText), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)), + ), + + // Font Family + fontFamily: 'Inter', + ); + } + + // Custom Box Decorations + static BoxDecoration get authCardDecoration => BoxDecoration( + gradient: cardGradient, + borderRadius: BorderRadius.circular(20), + boxShadow: [ + BoxShadow( + color: primaryGreen.withOpacity(0.1), + blurRadius: 20, + offset: const Offset(0, 8), + ), + ], + ); + + static BoxDecoration get dashboardCardDecoration => BoxDecoration( + color: whiteBackground, + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: primaryGreen.withOpacity(0.08), + blurRadius: 8, + offset: const Offset(0, 4), + ), + ], + ); + + static BoxDecoration get factoryCardDecoration => BoxDecoration( + color: whiteBackground, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: lightGreen.withOpacity(0.3), width: 1), + ); + + static BoxDecoration get backgroundDecoration => const BoxDecoration( + gradient: backgroundGradient, + ); + + static BoxDecoration get buttonDecoration => const BoxDecoration( + gradient: buttonGradient, + borderRadius: BorderRadius.all(Radius.circular(12)), + ); + + // FAB decoration for the centered add button + static BoxDecoration get fabDecoration => BoxDecoration( + gradient: buttonGradient, + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + color: primaryGreen.withOpacity(0.3), + blurRadius: 12, + offset: const Offset(0, 6), + ), + ], + ); + + // Welcome screen specific decorations + static BoxDecoration get welcomeBackgroundDecoration => const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color(0xFFF1F8E9), + Color(0xFFE8F5E8), + ], + ), + ); + + // Chart colors for analytics + static List get chartColors => [ + primaryGreen, + lightGreen, + teaGreen, + paleGreen, + darkGreen, + ]; + + // Status colors + static const Color activeStatus = Color(0xFF4CAF50); + static const Color inactiveStatus = Color(0xFF9E9E9E); + static const Color pendingStatus = Color(0xFFFF9800); + static const Color completedStatus = Color(0xFF66BB6A); +} \ No newline at end of file From d4a9d22bfd95c7faeae61051bac26addf64c1539 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 17:07:24 +0530 Subject: [PATCH 32/50] add theme colors to nav bar --- lib/feature/navbar/bottom_navbar.dart | 46 ++++++++++++++------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/lib/feature/navbar/bottom_navbar.dart b/lib/feature/navbar/bottom_navbar.dart index 138cac7..f233b28 100644 --- a/lib/feature/navbar/bottom_navbar.dart +++ b/lib/feature/navbar/bottom_navbar.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; +import 'package:harvest_manager/core/theme/theme.dart'; import 'package:harvest_manager/feature/drawer/app_drawer.dart'; class BottomNavbar extends StatefulWidget { @@ -29,10 +30,12 @@ class _BottomNavbarState extends State { @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: TeaTrackerTheme.creamBackground, body: _screens[_selectedIndex], drawer: AppDrawer(onItemTapped: _onItemTapped), // Use the separate drawer bottomNavigationBar: BottomAppBar( - color: const Color.fromARGB(214, 13, 110, 17), + color: TeaTrackerTheme.bottomNavBackground, + elevation: 8, child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ @@ -42,24 +45,20 @@ class _BottomNavbarState extends State { width: 20, ), buildNavBarItem(CupertinoIcons.bell, 'Notifications', 3), - buildDrawerItem(), // Drawer icon instead of menu + buildDrawerItem(), ], ), ), - floatingActionButton: ClipOval( - child: Material( - color: const Color.fromARGB(214, 155, 236, 157), - elevation: 10, - child: InkWell( - child: const SizedBox( - width: 56, - height: 56, - child: Icon( - CupertinoIcons.add_circled, - size: 56, - color: Colors.black, - ), - ), + floatingActionButton: Container( + decoration: TeaTrackerTheme.fabDecoration, + child: FloatingActionButton( + onPressed: () => _onItemTapped(2), + backgroundColor: Colors.transparent, + elevation: 0, + child: const Icon( + CupertinoIcons.add, + size: 28, + color: TeaTrackerTheme.whiteText, ), ), ), @@ -70,21 +69,23 @@ class _BottomNavbarState extends State { Widget buildNavBarItem(IconData icon, String label, int index) { return InkWell( onTap: () => _onItemTapped(index), + borderRadius: BorderRadius.circular(8), child: Column( mainAxisSize: MainAxisSize.min, children: [ Icon( icon, color: _selectedIndex == index - ? const Color.fromARGB(214, 155, 236, 157) - : Colors.black87, + ? TeaTrackerTheme.bottomNavSelected + : TeaTrackerTheme.bottomNavUnselected, ), Text( label, style: TextStyle( color: _selectedIndex == index - ? const Color.fromARGB(214, 155, 236, 157) - : Colors.black87, + ? TeaTrackerTheme.bottomNavSelected + : TeaTrackerTheme.bottomNavUnselected, + fontFamily: 'Inder', ), ), ], @@ -99,17 +100,18 @@ class _BottomNavbarState extends State { onTap: () { Scaffold.of(context).openDrawer(); }, + borderRadius: BorderRadius.circular(8), child: const Column( mainAxisSize: MainAxisSize.min, children: [ Icon( CupertinoIcons.line_horizontal_3, - color: Colors.black87, + color: TeaTrackerTheme.bottomNavUnselected, ), Text( 'Menu', style: TextStyle( - color: Colors.black87, + color: TeaTrackerTheme.bottomNavUnselected, ), ), ], From 8a868d616e4ccd09e785b8dc5a900b31e2c65a36 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 17:09:52 +0530 Subject: [PATCH 33/50] add theme colors to drawer --- lib/feature/drawer/app_drawer.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/feature/drawer/app_drawer.dart b/lib/feature/drawer/app_drawer.dart index ad55eaa..6462957 100644 --- a/lib/feature/drawer/app_drawer.dart +++ b/lib/feature/drawer/app_drawer.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; +import 'package:harvest_manager/core/theme/theme.dart'; class AppDrawer extends StatelessWidget { final Function(int) onItemTapped; @@ -17,12 +18,12 @@ class AppDrawer extends StatelessWidget { children: [ const DrawerHeader( decoration: BoxDecoration( - color: Color.fromARGB(214, 13, 110, 17), + color: TeaTrackerTheme.darkGreen, ), child: Text( 'Menu', style: TextStyle( - color: Colors.white, + color: TeaTrackerTheme.whiteBackground, fontSize: 24, ), ), From a2c3ea5e3528707b07aeeb88c22ab572529b22c4 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Fri, 6 Jun 2025 23:15:39 +0530 Subject: [PATCH 34/50] change while resolving complicts --- lib/feature/home/screens/home_screen.dart | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/feature/home/screens/home_screen.dart b/lib/feature/home/screens/home_screen.dart index eca400f..df75708 100644 --- a/lib/feature/home/screens/home_screen.dart +++ b/lib/feature/home/screens/home_screen.dart @@ -1,15 +1,19 @@ +import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; -class HomeScreen extends StatefulWidget { +class HomeScreen extends StatelessWidget { const HomeScreen({super.key}); - @override - State createState() => _HomeScreenState(); -} - -class _HomeScreenState extends State { @override Widget build(BuildContext context) { - return const Placeholder(); + return Scaffold( + appBar: AppBar(title: Text("Home")), + body: ElevatedButton( + onPressed: () async { + await FirebaseAuth.instance.signOut(); + }, + child: const Text('Logout'), + ), + ); } -} \ No newline at end of file +} From 32298dcf31d1781fc6019d6d4fc4f2dd8d5b8e37 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Sun, 8 Jun 2025 11:41:40 +0530 Subject: [PATCH 35/50] romed unwated thinggs and change routing --- lib/core/theme/theme.dart | 77 ++------------------------- lib/feature/navbar/bottom_navbar.dart | 12 +++-- lib/main.dart | 6 +-- 3 files changed, 13 insertions(+), 82 deletions(-) diff --git a/lib/core/theme/theme.dart b/lib/core/theme/theme.dart index a1ee860..77d1a5e 100644 --- a/lib/core/theme/theme.dart +++ b/lib/core/theme/theme.dart @@ -27,25 +27,12 @@ class TeaTrackerTheme { static const Color successGreen = Color(0xFF4CAF50); static const Color yellowAccent = Color(0xFFFFEB3B); // Yellow from color palette - // Dashboard Colors - static const Color dashboardCard1 = Color(0xFFE8F5E8); // Light green - static const Color dashboardCard2 = Color(0xFFE1F5FE); // Light blue tint - static const Color dashboardCard3 = Color(0xFFF3E5F5); // Light purple tint // Bottom Navigation Colors static const Color bottomNavBackground = Color(0xFF2E7D32); static const Color bottomNavSelected = Color(0xFFFFFFFF); static const Color bottomNavUnselected = Color.fromARGB(179, 0, 0, 0); - // Gradient Colors - static const LinearGradient backgroundGradient = LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Color(0xFFF1F8E9), - Color(0xFFE8F5E8), - ], - ); static const LinearGradient buttonGradient = LinearGradient( begin: Alignment.topLeft, @@ -237,28 +224,6 @@ class TeaTrackerTheme { ), ); - static final OutlinedButtonThemeData outlinedButtonTheme = OutlinedButtonThemeData( - style: OutlinedButton.styleFrom( - foregroundColor: primaryGreen, - padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - ), - side: const BorderSide(color: primaryGreen, width: 1.5), - textStyle: buttonText.copyWith(color: primaryGreen), - ), - ); - - // Card Theme - static final CardTheme cardTheme = CardTheme( - color: whiteBackground, - elevation: 4, - shadowColor: primaryGreen.withOpacity(0.15), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(16), - ), - margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), - ); // AppBar Theme static const AppBarTheme appBarTheme = AppBarTheme( @@ -300,12 +265,10 @@ class TeaTrackerTheme { secondary: teaGreen, secondaryContainer: cardBackground, surface: whiteBackground, - background: creamBackground, error: errorRed, onPrimary: whiteText, onSecondary: primaryText, onSurface: primaryText, - onBackground: primaryText, onError: whiteText, ), @@ -315,13 +278,6 @@ class TeaTrackerTheme { // App Bar Theme appBarTheme: appBarTheme, - // Button Themes - elevatedButtonTheme: elevatedButtonTheme, - outlinedButtonTheme: outlinedButtonTheme, - - // Card Theme - cardTheme: cardTheme, - // Bottom Navigation Theme bottomNavigationBarTheme: bottomNavTheme, @@ -380,13 +336,13 @@ class TeaTrackerTheme { // Checkbox Theme checkboxTheme: CheckboxThemeData( - fillColor: MaterialStateProperty.resolveWith((states) { - if (states.contains(MaterialState.selected)) { + fillColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.selected)) { return primaryGreen; } return null; }), - checkColor: MaterialStateProperty.all(whiteText), + checkColor: WidgetStateProperty.all(whiteText), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)), ), @@ -395,19 +351,6 @@ class TeaTrackerTheme { ); } - // Custom Box Decorations - static BoxDecoration get authCardDecoration => BoxDecoration( - gradient: cardGradient, - borderRadius: BorderRadius.circular(20), - boxShadow: [ - BoxShadow( - color: primaryGreen.withOpacity(0.1), - blurRadius: 20, - offset: const Offset(0, 8), - ), - ], - ); - static BoxDecoration get dashboardCardDecoration => BoxDecoration( color: whiteBackground, borderRadius: BorderRadius.circular(16), @@ -426,15 +369,6 @@ class TeaTrackerTheme { border: Border.all(color: lightGreen.withOpacity(0.3), width: 1), ); - static BoxDecoration get backgroundDecoration => const BoxDecoration( - gradient: backgroundGradient, - ); - - static BoxDecoration get buttonDecoration => const BoxDecoration( - gradient: buttonGradient, - borderRadius: BorderRadius.all(Radius.circular(12)), - ); - // FAB decoration for the centered add button static BoxDecoration get fabDecoration => BoxDecoration( gradient: buttonGradient, @@ -469,9 +403,4 @@ class TeaTrackerTheme { darkGreen, ]; - // Status colors - static const Color activeStatus = Color(0xFF4CAF50); - static const Color inactiveStatus = Color(0xFF9E9E9E); - static const Color pendingStatus = Color(0xFFFF9800); - static const Color completedStatus = Color(0xFF66BB6A); } \ No newline at end of file diff --git a/lib/feature/navbar/bottom_navbar.dart b/lib/feature/navbar/bottom_navbar.dart index f233b28..ad70a7f 100644 --- a/lib/feature/navbar/bottom_navbar.dart +++ b/lib/feature/navbar/bottom_navbar.dart @@ -3,6 +3,8 @@ import 'package:flutter/cupertino.dart'; import 'package:harvest_manager/core/theme/theme.dart'; import 'package:harvest_manager/feature/drawer/app_drawer.dart'; +import '../home/screens/home_screen.dart'; + class BottomNavbar extends StatefulWidget { const BottomNavbar({super.key}); @@ -14,11 +16,11 @@ class _BottomNavbarState extends State { int _selectedIndex = 0; static final List _screens = [ - Container(child: const Center(child: Text('Home Screen'))), // index 0 - Container(child: const Center(child: Text('Analytics Screen'))), // index 1 - Container(child: const Center(child: Text('Add'))), // index 2 - Container(child: const Center(child: Text('Notifications Screen'))), // index 3 - Container(child: const Center(child: Text('Menu Screen'))), // index 4 + const HomeScreen(), // index 0 - Your home screen + //const AnalyticsPage(), // index 1 - Analytics page + //const AddPage(), // index 2 - Add page + //const NotificationsPage(), // index 3 - Notifications page + const Center(child: Text('Menu Screen')), // index 4 - Keep as is since menu is in drawer ]; void _onItemTapped(int index) { diff --git a/lib/main.dart b/lib/main.dart index b2e7098..13e84a7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:firebase_core/firebase_core.dart'; -import 'package:harvest_manager/wrapper.dart'; +import 'package:harvest_manager/feature/navbar/bottom_navbar.dart'; import 'firebase_options.dart'; @@ -17,9 +17,9 @@ class MyApp extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp( - title: 'Flutter Demo', + title: 'Harvest Manager', debugShowCheckedModeBanner: false, - home: Wrapper(), + home: const BottomNavbar(), ); } } \ No newline at end of file From ad6139848f348c3a7940de38324f2eafb5689529 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Sun, 8 Jun 2025 11:42:30 +0530 Subject: [PATCH 36/50] add a logout button and customized --- lib/feature/drawer/app_drawer.dart | 26 +++++++++++++++++++++++ lib/feature/home/screens/home_screen.dart | 10 +++------ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/lib/feature/drawer/app_drawer.dart b/lib/feature/drawer/app_drawer.dart index 6462957..2b3cb12 100644 --- a/lib/feature/drawer/app_drawer.dart +++ b/lib/feature/drawer/app_drawer.dart @@ -1,3 +1,4 @@ +import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:harvest_manager/core/theme/theme.dart'; @@ -44,6 +45,31 @@ class AppDrawer extends StatelessWidget { }, ), + const Spacer(), + const Divider(), + ListTile( + leading: const Icon(CupertinoIcons.square_arrow_right), + title: const Text('Logout'), + onTap: ()async { + Navigator .pop(context); + try { + await FirebaseAuth.instance.signOut(); + + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Logged out successfully')), + ); + } + } + catch (e) { + if (context.mounted){ + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text('Error logging out: $e')), + ); + } + } + }, + ), ], ), ); diff --git a/lib/feature/home/screens/home_screen.dart b/lib/feature/home/screens/home_screen.dart index df75708..5b2d752 100644 --- a/lib/feature/home/screens/home_screen.dart +++ b/lib/feature/home/screens/home_screen.dart @@ -1,5 +1,6 @@ -import 'package:firebase_auth/firebase_auth.dart'; + import 'package:flutter/material.dart'; +import 'package:harvest_manager/core/theme/theme.dart'; class HomeScreen extends StatelessWidget { const HomeScreen({super.key}); @@ -7,13 +8,8 @@ class HomeScreen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: TeaTrackerTheme.creamBackground, appBar: AppBar(title: Text("Home")), - body: ElevatedButton( - onPressed: () async { - await FirebaseAuth.instance.signOut(); - }, - child: const Text('Logout'), - ), ); } } From 0238dfd55edbec30a8c0feca511d247226b21474 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Sun, 8 Jun 2025 12:16:53 +0530 Subject: [PATCH 37/50] brought logout button to bottom. --- lib/feature/drawer/app_drawer.dart | 63 +++++++++++++++++------------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/lib/feature/drawer/app_drawer.dart b/lib/feature/drawer/app_drawer.dart index 2b3cb12..7007d64 100644 --- a/lib/feature/drawer/app_drawer.dart +++ b/lib/feature/drawer/app_drawer.dart @@ -14,18 +14,23 @@ class AppDrawer extends StatelessWidget { @override Widget build(BuildContext context) { return Drawer( - child: ListView( - padding: EdgeInsets.zero, + backgroundColor: TeaTrackerTheme.creamBackground, + child: Column( children: [ - const DrawerHeader( - decoration: BoxDecoration( + Container( + height: 80, + width: double.infinity, + decoration: const BoxDecoration( color: TeaTrackerTheme.darkGreen, ), - child: Text( + alignment: Alignment.centerLeft, + padding: const EdgeInsets.only(left: 16), + child: const Text( 'Menu', style: TextStyle( color: TeaTrackerTheme.whiteBackground, - fontSize: 24, + fontSize: 20, + fontWeight: FontWeight.w500, ), ), ), @@ -42,33 +47,37 @@ class AppDrawer extends StatelessWidget { title: const Text('About'), onTap: () { Navigator.pop(context); - }, ), + const Spacer(), - const Divider(), - ListTile( - leading: const Icon(CupertinoIcons.square_arrow_right), - title: const Text('Logout'), - onTap: ()async { - Navigator .pop(context); - try { - await FirebaseAuth.instance.signOut(); + const Divider(height: 1), + Container( + padding: const EdgeInsets.only(bottom: 16), + child: ListTile( + leading: const Icon(CupertinoIcons.square_arrow_right), + title: const Text('Logout'), + dense: true, + onTap: ()async { + Navigator .pop(context); + try { + await FirebaseAuth.instance.signOut(); - if (context.mounted) { - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar(content: Text('Logged out successfully')), - ); + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Logged out successfully')), + ); + } } - } - catch (e) { - if (context.mounted){ - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text('Error logging out: $e')), - ); + catch (e) { + if (context.mounted){ + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text('Error logging out: $e')), + ); + } } - } - }, + }, + ), ), ], ), From f44c3e3357a025ffd47ea9c563cfbaf3845e08ee Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Mon, 9 Jun 2025 10:35:00 +0530 Subject: [PATCH 38/50] updated analytics button --- lib/feature/navbar/bottom_navbar.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/feature/navbar/bottom_navbar.dart b/lib/feature/navbar/bottom_navbar.dart index ad70a7f..46a301e 100644 --- a/lib/feature/navbar/bottom_navbar.dart +++ b/lib/feature/navbar/bottom_navbar.dart @@ -42,7 +42,7 @@ class _BottomNavbarState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ buildNavBarItem(CupertinoIcons.home, 'Home', 0), - buildNavBarItem(CupertinoIcons.chart_bar, 'Analytics', 1), + buildNavBarItem(CupertinoIcons.chart_bar_alt_fill, 'Analytics', 1), const SizedBox( width: 20, ), From d46c56cd43256c46b8e46dadd962df9ca141ff10 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:22:14 +0530 Subject: [PATCH 39/50] removed logout button from the --- lib/feature/home/screens/home_screen.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/feature/home/screens/home_screen.dart b/lib/feature/home/screens/home_screen.dart index 5b2d752..df75708 100644 --- a/lib/feature/home/screens/home_screen.dart +++ b/lib/feature/home/screens/home_screen.dart @@ -1,6 +1,5 @@ - +import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; -import 'package:harvest_manager/core/theme/theme.dart'; class HomeScreen extends StatelessWidget { const HomeScreen({super.key}); @@ -8,8 +7,13 @@ class HomeScreen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: TeaTrackerTheme.creamBackground, appBar: AppBar(title: Text("Home")), + body: ElevatedButton( + onPressed: () async { + await FirebaseAuth.instance.signOut(); + }, + child: const Text('Logout'), + ), ); } } From b481bd1314c1f5320e364e35f21f1e45e2d0c7b4 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:56:05 +0530 Subject: [PATCH 40/50] featuring bottom nav with a drawer on it --- lib/feature/home/components/home_screen.dart | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/feature/home/components/home_screen.dart diff --git a/lib/feature/home/components/home_screen.dart b/lib/feature/home/components/home_screen.dart new file mode 100644 index 0000000..eca400f --- /dev/null +++ b/lib/feature/home/components/home_screen.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class HomeScreen extends StatefulWidget { + const HomeScreen({super.key}); + + @override + State createState() => _HomeScreenState(); +} + +class _HomeScreenState extends State { + @override + Widget build(BuildContext context) { + return const Placeholder(); + } +} \ No newline at end of file From 79c79498c136c7583f309a89bdb78d3afb90651a Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:11:08 +0530 Subject: [PATCH 41/50] hmoe_screens moved to the screens folder --- lib/{feature/home/components => Screens}/home_screen.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/{feature/home/components => Screens}/home_screen.dart (100%) diff --git a/lib/feature/home/components/home_screen.dart b/lib/Screens/home_screen.dart similarity index 100% rename from lib/feature/home/components/home_screen.dart rename to lib/Screens/home_screen.dart From 34670265c32a7ff87697fd97f13a9700aff19e3a Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:13:14 +0530 Subject: [PATCH 42/50] sory my bad. --- lib/Screens/home_screen.dart | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 lib/Screens/home_screen.dart diff --git a/lib/Screens/home_screen.dart b/lib/Screens/home_screen.dart deleted file mode 100644 index eca400f..0000000 --- a/lib/Screens/home_screen.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:flutter/material.dart'; - -class HomeScreen extends StatefulWidget { - const HomeScreen({super.key}); - - @override - State createState() => _HomeScreenState(); -} - -class _HomeScreenState extends State { - @override - Widget build(BuildContext context) { - return const Placeholder(); - } -} \ No newline at end of file From 2f506c4acac369184baa6ddbfcdc8afb01367504 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 11 Jun 2025 09:46:50 +0530 Subject: [PATCH 43/50] changed authentication work flow --- lib/main.dart | 4 ++-- lib/wrapper.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 13e84a7..f244c19 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:firebase_core/firebase_core.dart'; -import 'package:harvest_manager/feature/navbar/bottom_navbar.dart'; +import 'package:harvest_manager/wrapper.dart'; import 'firebase_options.dart'; @@ -19,7 +19,7 @@ class MyApp extends StatelessWidget { return MaterialApp( title: 'Harvest Manager', debugShowCheckedModeBanner: false, - home: const BottomNavbar(), + home: const Wrapper(), ); } } \ No newline at end of file diff --git a/lib/wrapper.dart b/lib/wrapper.dart index a49da07..4676e23 100644 --- a/lib/wrapper.dart +++ b/lib/wrapper.dart @@ -1,6 +1,6 @@ import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; -import 'package:harvest_manager/feature/home/screens/home_screen.dart'; +import 'package:harvest_manager/feature/navbar/bottom_navbar.dart'; import 'package:harvest_manager/feature/sign-up/screens/sign_up_screen.dart'; import 'package:harvest_manager/feature/splash-screen/screens/splash_screen.dart'; import 'package:harvest_manager/feature/sign-in/screens/sign_in_screen.dart'; @@ -48,7 +48,7 @@ class _WrapperState extends State { if (!_isDelayOver || snapshot.connectionState == ConnectionState.waiting) { return const SplashScreen(); } else if (snapshot.hasData) { - return const HomeScreen(); + return const BottomNavbar(); } else { return switchPages ? SignInFormScreen(onToggle: toggleScreens) From 3e5a24c7142d0da6334fe2da02808b04f8e0d715 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:11:08 +0530 Subject: [PATCH 44/50] hmoe_screens moved to the screens folder --- lib/Screens/home_screen.dart | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/Screens/home_screen.dart diff --git a/lib/Screens/home_screen.dart b/lib/Screens/home_screen.dart new file mode 100644 index 0000000..eca400f --- /dev/null +++ b/lib/Screens/home_screen.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class HomeScreen extends StatefulWidget { + const HomeScreen({super.key}); + + @override + State createState() => _HomeScreenState(); +} + +class _HomeScreenState extends State { + @override + Widget build(BuildContext context) { + return const Placeholder(); + } +} \ No newline at end of file From 30a096a026945e0a6727739e2a13c850e73b8a3d Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:13:14 +0530 Subject: [PATCH 45/50] sory my bad. --- lib/Screens/home_screen.dart | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 lib/Screens/home_screen.dart diff --git a/lib/Screens/home_screen.dart b/lib/Screens/home_screen.dart deleted file mode 100644 index eca400f..0000000 --- a/lib/Screens/home_screen.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:flutter/material.dart'; - -class HomeScreen extends StatefulWidget { - const HomeScreen({super.key}); - - @override - State createState() => _HomeScreenState(); -} - -class _HomeScreenState extends State { - @override - Widget build(BuildContext context) { - return const Placeholder(); - } -} \ No newline at end of file From 744a19116f7f02555391a1368dfa95e15a86d508 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:56:05 +0530 Subject: [PATCH 46/50] featuring bottom nav with a drawer on it --- lib/feature/home/components/home_screen.dart | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/feature/home/components/home_screen.dart diff --git a/lib/feature/home/components/home_screen.dart b/lib/feature/home/components/home_screen.dart new file mode 100644 index 0000000..eca400f --- /dev/null +++ b/lib/feature/home/components/home_screen.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class HomeScreen extends StatefulWidget { + const HomeScreen({super.key}); + + @override + State createState() => _HomeScreenState(); +} + +class _HomeScreenState extends State { + @override + Widget build(BuildContext context) { + return const Placeholder(); + } +} \ No newline at end of file From 5c4e7078f78c0e5c3674f818a4185e9878e3d032 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:11:08 +0530 Subject: [PATCH 47/50] hmoe_screens moved to the screens folder --- lib/{feature/home/components => Screens}/home_screen.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/{feature/home/components => Screens}/home_screen.dart (100%) diff --git a/lib/feature/home/components/home_screen.dart b/lib/Screens/home_screen.dart similarity index 100% rename from lib/feature/home/components/home_screen.dart rename to lib/Screens/home_screen.dart From 725f5b37d5571ae11449f1d057feab58b3636b85 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:13:14 +0530 Subject: [PATCH 48/50] sory my bad. --- lib/Screens/home_screen.dart | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 lib/Screens/home_screen.dart diff --git a/lib/Screens/home_screen.dart b/lib/Screens/home_screen.dart deleted file mode 100644 index eca400f..0000000 --- a/lib/Screens/home_screen.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:flutter/material.dart'; - -class HomeScreen extends StatefulWidget { - const HomeScreen({super.key}); - - @override - State createState() => _HomeScreenState(); -} - -class _HomeScreenState extends State { - @override - Widget build(BuildContext context) { - return const Placeholder(); - } -} \ No newline at end of file From 0b0c1d4745a11117367a4e3b481dcea9456aba99 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 11 Jun 2025 09:46:50 +0530 Subject: [PATCH 49/50] changed authentication work flow --- lib/main.dart | 4 ++-- lib/wrapper.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 13e84a7..f244c19 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:firebase_core/firebase_core.dart'; -import 'package:harvest_manager/feature/navbar/bottom_navbar.dart'; +import 'package:harvest_manager/wrapper.dart'; import 'firebase_options.dart'; @@ -19,7 +19,7 @@ class MyApp extends StatelessWidget { return MaterialApp( title: 'Harvest Manager', debugShowCheckedModeBanner: false, - home: const BottomNavbar(), + home: const Wrapper(), ); } } \ No newline at end of file diff --git a/lib/wrapper.dart b/lib/wrapper.dart index a49da07..4676e23 100644 --- a/lib/wrapper.dart +++ b/lib/wrapper.dart @@ -1,6 +1,6 @@ import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; -import 'package:harvest_manager/feature/home/screens/home_screen.dart'; +import 'package:harvest_manager/feature/navbar/bottom_navbar.dart'; import 'package:harvest_manager/feature/sign-up/screens/sign_up_screen.dart'; import 'package:harvest_manager/feature/splash-screen/screens/splash_screen.dart'; import 'package:harvest_manager/feature/sign-in/screens/sign_in_screen.dart'; @@ -48,7 +48,7 @@ class _WrapperState extends State { if (!_isDelayOver || snapshot.connectionState == ConnectionState.waiting) { return const SplashScreen(); } else if (snapshot.hasData) { - return const HomeScreen(); + return const BottomNavbar(); } else { return switchPages ? SignInFormScreen(onToggle: toggleScreens) From be5072c8002c3aa8b8e95e282e32f91d0c14a654 Mon Sep 17 00:00:00 2001 From: Hasiru Randeepa <160104611+haz1ru@users.noreply.github.com> Date: Wed, 11 Jun 2025 10:01:29 +0530 Subject: [PATCH 50/50] resolve the service error --- android/build.gradle.kts | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/android/build.gradle.kts b/android/build.gradle.kts index 89176ef..519054c 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -1,21 +1,33 @@ -allprojects { +buildscript { repositories { google() mavenCentral() } + dependencies { + classpath("com.android.tools.build:gradle:8.8.0") + classpath("com.google.gms:google-services:4.4.0") + } } -val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() -rootProject.layout.buildDirectory.value(newBuildDir) +// ✅ Set build directory +val newBuildDir = rootProject.layout.buildDirectory.dir("../../build").get() +rootProject.layout.buildDirectory.set(newBuildDir) +// ✅ Ensure all subprojects (like :app) use proper build directories subprojects { - val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) - project.layout.buildDirectory.value(newSubprojectBuildDir) -} -subprojects { - project.evaluationDependsOn(":app") + layout.buildDirectory.set(newBuildDir.dir(name)) + + // ✅ Add repositories so subprojects can resolve dependencies + repositories { + google() + mavenCentral() + } + + // Optional but helps ensure proper evaluation order + evaluationDependsOn(":app") } +// ✅ Clean task tasks.register("clean") { delete(rootProject.layout.buildDirectory) -} +} \ No newline at end of file