Update home.dart

This commit is contained in:
string 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: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 {
const HomeView({super.key});
@ -90,22 +87,7 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
// NEW ITEMS
DrawerItem(
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(),
),
),
);
},
),
// NEW MENU
];
@override
@ -136,39 +118,36 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
);
// Page Animations
_pageFadeAnimation = Tween<double>(
begin: 0.0,
end: 1.0,
).animate(CurvedAnimation(
_pageFadeAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
CurvedAnimation(
parent: _pageAnimationController,
curve: UIConstants.curveNormal,
));
),
);
_pageSlideAnimation = Tween<Offset>(
begin: const Offset(0, 0.3),
end: Offset.zero,
).animate(CurvedAnimation(
_pageSlideAnimation =
Tween<Offset>(begin: const Offset(0, 0.3), end: Offset.zero).animate(
CurvedAnimation(
parent: _pageAnimationController,
curve: UIConstants.curveNormal,
));
),
);
// Cards Animations
_cardsScaleAnimation = Tween<double>(
begin: 0.8,
end: 1.0,
).animate(CurvedAnimation(
_cardsScaleAnimation = Tween<double>(begin: 0.8, end: 1.0).animate(
CurvedAnimation(
parent: _cardsAnimationController,
curve: UIConstants.curveElastic,
));
),
);
// Actions Animations
_actionsScaleAnimation = Tween<double>(
begin: 0.8,
end: 1.0,
).animate(CurvedAnimation(
_actionsScaleAnimation = Tween<double>(begin: 0.8, end: 1.0).animate(
CurvedAnimation(
parent: _actionsAnimationController,
curve: UIConstants.curveElastic,
));
),
);
}
void _startPageAnimation() async {
@ -258,9 +237,7 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
Navigator.pushNamed(context, RouteNames.profileView);
},
),
drawer: ModernDrawer(
items: _drawerItems,
),
drawer: ModernDrawer(items: _drawerItems),
body: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
@ -293,7 +270,8 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
mobile: UIConstants.spacing32,
tablet: UIConstants.spacing40,
desktop: UIConstants.spacing48,
)),
),
),
// Dashboard Stats
_buildDashboardStats(theme, colorScheme),
@ -304,7 +282,8 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
mobile: UIConstants.spacing40,
tablet: UIConstants.spacing56,
desktop: UIConstants.spacing72,
)),
),
),
// Quick Actions
_buildQuickActions(theme, colorScheme),
@ -315,7 +294,8 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
mobile: UIConstants.spacing40,
tablet: UIConstants.spacing56,
desktop: UIConstants.spacing72,
)),
),
),
// Recent Activity Section
_buildRecentActivity(theme, colorScheme),
@ -344,7 +324,10 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
}
Widget _buildWelcomeSection(
ThemeData theme, ColorScheme colorScheme, String? userName) {
ThemeData theme,
ColorScheme colorScheme,
String? userName,
) {
return AnimatedBuilder(
animation: _pageAnimationController,
builder: (context, child) {
@ -586,11 +569,7 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
color: iconColor.withOpacity(0.1),
borderRadius: BorderRadius.circular(UIConstants.radius8),
),
child: Icon(
icon,
color: iconColor,
size: UIConstants.iconSizeMedium,
),
child: Icon(icon, color: iconColor, size: UIConstants.iconSizeMedium),
),
const SizedBox(width: UIConstants.spacing16),
Expanded(