Update home.dart

This commit is contained in:
Gaurav Kumar
2025-09-09 08:48:07 +05:30
parent f9043173c0
commit 13eca99151

View File

@@ -10,9 +10,6 @@ import 'package:provider/provider.dart';
import 'package:base_project/view_model/system_params/system_params_view_model.dart'; import 'package:base_project/view_model/system_params/system_params_view_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../Entity/angulardatatype/Basicp1/Basicp1View/Basicp1_entity_list_screen.dart';
import '../../Entity/angulardatatype/Basicp1/Basicp1_viewModel/Basicp1_view_model_screen.dart';
class HomeView extends StatefulWidget { class HomeView extends StatefulWidget {
const HomeView({super.key}); const HomeView({super.key});
@@ -90,22 +87,7 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
// NEW ITEMS // NEW ITEMS
DrawerItem( // NEW MENU
icon: Icons.data_object,
title: 'Basicp1 Management',
subtitle: 'Manage Basicp1 entities',
onTap: (context) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ChangeNotifierProvider(
create: (context) => Basicp1ViewModelScreen(),
child: const Basicp1EntityListScreen(),
),
),
);
},
),
]; ];
@override @override
@@ -136,39 +118,36 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
); );
// Page Animations // Page Animations
_pageFadeAnimation = Tween<double>( _pageFadeAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
begin: 0.0, CurvedAnimation(
end: 1.0,
).animate(CurvedAnimation(
parent: _pageAnimationController, parent: _pageAnimationController,
curve: UIConstants.curveNormal, curve: UIConstants.curveNormal,
)); ),
);
_pageSlideAnimation = Tween<Offset>( _pageSlideAnimation =
begin: const Offset(0, 0.3), Tween<Offset>(begin: const Offset(0, 0.3), end: Offset.zero).animate(
end: Offset.zero, CurvedAnimation(
).animate(CurvedAnimation(
parent: _pageAnimationController, parent: _pageAnimationController,
curve: UIConstants.curveNormal, curve: UIConstants.curveNormal,
)); ),
);
// Cards Animations // Cards Animations
_cardsScaleAnimation = Tween<double>( _cardsScaleAnimation = Tween<double>(begin: 0.8, end: 1.0).animate(
begin: 0.8, CurvedAnimation(
end: 1.0,
).animate(CurvedAnimation(
parent: _cardsAnimationController, parent: _cardsAnimationController,
curve: UIConstants.curveElastic, curve: UIConstants.curveElastic,
)); ),
);
// Actions Animations // Actions Animations
_actionsScaleAnimation = Tween<double>( _actionsScaleAnimation = Tween<double>(begin: 0.8, end: 1.0).animate(
begin: 0.8, CurvedAnimation(
end: 1.0,
).animate(CurvedAnimation(
parent: _actionsAnimationController, parent: _actionsAnimationController,
curve: UIConstants.curveElastic, curve: UIConstants.curveElastic,
)); ),
);
} }
void _startPageAnimation() async { void _startPageAnimation() async {
@@ -258,9 +237,7 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
Navigator.pushNamed(context, RouteNames.profileView); Navigator.pushNamed(context, RouteNames.profileView);
}, },
), ),
drawer: ModernDrawer( drawer: ModernDrawer(items: _drawerItems),
items: _drawerItems,
),
body: Container( body: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( gradient: LinearGradient(
@@ -293,7 +270,8 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
mobile: UIConstants.spacing32, mobile: UIConstants.spacing32,
tablet: UIConstants.spacing40, tablet: UIConstants.spacing40,
desktop: UIConstants.spacing48, desktop: UIConstants.spacing48,
)), ),
),
// Dashboard Stats // Dashboard Stats
_buildDashboardStats(theme, colorScheme), _buildDashboardStats(theme, colorScheme),
@@ -304,7 +282,8 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
mobile: UIConstants.spacing40, mobile: UIConstants.spacing40,
tablet: UIConstants.spacing56, tablet: UIConstants.spacing56,
desktop: UIConstants.spacing72, desktop: UIConstants.spacing72,
)), ),
),
// Quick Actions // Quick Actions
_buildQuickActions(theme, colorScheme), _buildQuickActions(theme, colorScheme),
@@ -315,7 +294,8 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
mobile: UIConstants.spacing40, mobile: UIConstants.spacing40,
tablet: UIConstants.spacing56, tablet: UIConstants.spacing56,
desktop: UIConstants.spacing72, desktop: UIConstants.spacing72,
)), ),
),
// Recent Activity Section // Recent Activity Section
_buildRecentActivity(theme, colorScheme), _buildRecentActivity(theme, colorScheme),
@@ -344,7 +324,10 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
} }
Widget _buildWelcomeSection( Widget _buildWelcomeSection(
ThemeData theme, ColorScheme colorScheme, String? userName) { ThemeData theme,
ColorScheme colorScheme,
String? userName,
) {
return AnimatedBuilder( return AnimatedBuilder(
animation: _pageAnimationController, animation: _pageAnimationController,
builder: (context, child) { builder: (context, child) {
@@ -586,11 +569,7 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
color: iconColor.withOpacity(0.1), color: iconColor.withOpacity(0.1),
borderRadius: BorderRadius.circular(UIConstants.radius8), borderRadius: BorderRadius.circular(UIConstants.radius8),
), ),
child: Icon( child: Icon(icon, color: iconColor, size: UIConstants.iconSizeMedium),
icon,
color: iconColor,
size: UIConstants.iconSizeMedium,
),
), ),
const SizedBox(width: UIConstants.spacing16), const SizedBox(width: UIConstants.spacing16),
Expanded( Expanded(