Last Commit before UI change
This commit is contained in:
parent
330edb6715
commit
c53b0e1885
3 changed files with 150 additions and 71 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
MONGO_URI=mongodb+srv://velar:Lokesh%401234@cluster0.mplyn1q.mongodb.net/
|
MONGO_URI=mongodb+srv://velar:Lokesh%401234@cluster0.mplyn1q.mongodb.net/finance
|
||||||
HOST=0.0.0.0
|
HOST=0.0.0.0
|
||||||
PORT=3000
|
PORT=3000
|
||||||
CORS_ORIGIN=http://192.168.1.100:3000
|
CORS_ORIGIN=http://192.168.1.100:3000
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ app.use(cors({
|
||||||
const predictRoute = require('./predict');
|
const predictRoute = require('./predict');
|
||||||
app.use('/api/predict', predictRoute);
|
app.use('/api/predict', predictRoute);
|
||||||
|
|
||||||
mongoose.connect('mongodb+srv://velar:Lokesh%401234@cluster0.mplyn1q.mongodb.net/finance?retryWrites=true&w=majority&ssl=true&appName=VelarApp', {
|
mongoose.connect(PROCESS.env.MONGODB_URI, {
|
||||||
useNewUrlParser: true,
|
useNewUrlParser: true,
|
||||||
useUnifiedTopology: true,
|
useUnifiedTopology: true,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
// ignore_for_file: deprecated_member_use, unused_local_variable, use_super_parameters, avoid_print
|
// ignore_for_file: deprecated_member_use, unused_local_variable, use_super_parameters, avoid_print
|
||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:monarch/other_pages/colors.dart';
|
import 'package:monarch/other_pages/colors.dart';
|
||||||
|
|
@ -9,7 +8,6 @@ import 'package:monarch/main_pages/HomePage/hero_card.dart';
|
||||||
import 'package:monarch/main_pages/HomePage/navbar.dart';
|
import 'package:monarch/main_pages/HomePage/navbar.dart';
|
||||||
import 'package:monarch/main_pages/HomePage/quick_actions.dart';
|
import 'package:monarch/main_pages/HomePage/quick_actions.dart';
|
||||||
import 'package:monarch/support/transcations_recent.dart';
|
import 'package:monarch/support/transcations_recent.dart';
|
||||||
//import 'package:monarch/static.dart';
|
|
||||||
|
|
||||||
class FinTrackHomePage extends StatefulWidget {
|
class FinTrackHomePage extends StatefulWidget {
|
||||||
const FinTrackHomePage({Key? key}) : super(key: key);
|
const FinTrackHomePage({Key? key}) : super(key: key);
|
||||||
|
|
@ -20,25 +18,39 @@ class FinTrackHomePage extends StatefulWidget {
|
||||||
|
|
||||||
class _FinTrackHomePageState extends State<FinTrackHomePage>
|
class _FinTrackHomePageState extends State<FinTrackHomePage>
|
||||||
with TickerProviderStateMixin {
|
with TickerProviderStateMixin {
|
||||||
// Modern color palette
|
|
||||||
|
|
||||||
// List to hold recent transactions
|
|
||||||
|
|
||||||
|
|
||||||
|
// Animation Controllers
|
||||||
late AnimationController _fadeController;
|
late AnimationController _fadeController;
|
||||||
late AnimationController _slideController;
|
late AnimationController _slideController;
|
||||||
late Animation<double> _fadeAnimation;
|
late Animation<double> _fadeAnimation;
|
||||||
late Animation<Offset> _slideAnimation;
|
late Animation<Offset> _slideAnimation;
|
||||||
|
|
||||||
// Sample data for dashboard
|
// Navigation State
|
||||||
|
int _selectedIndex = 0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
fetchRecentTransactions().then((transactions) {
|
_initializeData();
|
||||||
// Do something with the transactions
|
_setupAnimations();
|
||||||
});
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_fadeController.dispose();
|
||||||
|
_slideController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize data fetching
|
||||||
|
void _initializeData() {
|
||||||
|
fetchRecentTransactions().then((transactions) {
|
||||||
|
// Handle transactions data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setup animation controllers and animations
|
||||||
|
void _setupAnimations() {
|
||||||
_fadeController = AnimationController(
|
_fadeController = AnimationController(
|
||||||
duration: const Duration(milliseconds: 1200),
|
duration: const Duration(milliseconds: 1200),
|
||||||
vsync: this,
|
vsync: this,
|
||||||
|
|
@ -52,28 +64,128 @@ class _FinTrackHomePageState extends State<FinTrackHomePage>
|
||||||
_fadeAnimation = Tween<double>(
|
_fadeAnimation = Tween<double>(
|
||||||
begin: 0.0,
|
begin: 0.0,
|
||||||
end: 1.0,
|
end: 1.0,
|
||||||
).animate(CurvedAnimation(parent: _fadeController, curve: Curves.easeOut));
|
).animate(CurvedAnimation(
|
||||||
|
parent: _fadeController,
|
||||||
|
curve: Curves.easeOut,
|
||||||
|
));
|
||||||
|
|
||||||
_slideAnimation = Tween<Offset>(
|
_slideAnimation = Tween<Offset>(
|
||||||
begin: const Offset(0, 0.3),
|
begin: const Offset(0, 0.3),
|
||||||
end: Offset.zero,
|
end: Offset.zero,
|
||||||
).animate(
|
).animate(CurvedAnimation(
|
||||||
CurvedAnimation(parent: _slideController, curve: Curves.easeOutCubic),
|
parent: _slideController,
|
||||||
);
|
curve: Curves.easeOutCubic,
|
||||||
|
));
|
||||||
|
|
||||||
// Start animations
|
// Start animations
|
||||||
_fadeController.forward();
|
_fadeController.forward();
|
||||||
_slideController.forward();
|
_slideController.forward();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
// Build greeting header with enhanced styling
|
||||||
void dispose() {
|
Widget _buildGreetingHeader() {
|
||||||
_fadeController.dispose();
|
return Container(
|
||||||
_slideController.dispose();
|
margin: const EdgeInsets.only(bottom: 24),
|
||||||
super.dispose();
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
// Greeting Section
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Good Morning! 👋',
|
||||||
|
style: GoogleFonts.inter(
|
||||||
|
color: primaryColor,
|
||||||
|
fontSize: 28,
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
height: 1.2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
'Welcome back to your financial dashboard',
|
||||||
|
style: GoogleFonts.inter(
|
||||||
|
color: primaryColor.withOpacity(0.7),
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// Notification Button with enhanced design
|
||||||
|
Container(
|
||||||
|
width: 52,
|
||||||
|
height: 52,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: cardColor,
|
||||||
|
borderRadius: BorderRadius.circular(18),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: accentColor.withOpacity(0.1),
|
||||||
|
blurRadius: 12,
|
||||||
|
offset: const Offset(0, 4),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
border: Border.all(
|
||||||
|
color: accentColor.withOpacity(0.1),
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Material(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(18),
|
||||||
|
onTap: () {
|
||||||
|
// Handle notification tap
|
||||||
|
},
|
||||||
|
child: Icon(
|
||||||
|
Icons.notifications_outlined,
|
||||||
|
color: accentColor,
|
||||||
|
size: 26,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
int _selectedIndex = 0;
|
// Build main content sections
|
||||||
|
Widget _buildMainContent() {
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// Balance Card Section
|
||||||
|
Container(
|
||||||
|
margin: const EdgeInsets.only(bottom: 28),
|
||||||
|
child: const BalanceCardPage(),
|
||||||
|
),
|
||||||
|
|
||||||
|
// Quick Actions Section
|
||||||
|
Container(
|
||||||
|
margin: const EdgeInsets.only(bottom: 28),
|
||||||
|
child: QuickActionsPage(),
|
||||||
|
),
|
||||||
|
|
||||||
|
// Recent Transactions Section
|
||||||
|
Container(
|
||||||
|
margin: const EdgeInsets.only(bottom: 32),
|
||||||
|
child: RecentTransactionsWidget(
|
||||||
|
recentTransactions: fetchRecentTransactions(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// Bottom spacing for FAB
|
||||||
|
const SizedBox(height: 100),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -84,60 +196,28 @@ class _FinTrackHomePageState extends State<FinTrackHomePage>
|
||||||
opacity: _fadeAnimation,
|
opacity: _fadeAnimation,
|
||||||
child: SlideTransition(
|
child: SlideTransition(
|
||||||
position: _slideAnimation,
|
position: _slideAnimation,
|
||||||
child: SingleChildScrollView(
|
child: CustomScrollView(
|
||||||
padding: const EdgeInsets.all(20),
|
physics: const BouncingScrollPhysics(),
|
||||||
|
slivers: [
|
||||||
|
SliverToBoxAdapter(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.fromLTRB(20, 16, 20, 0),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
_buildGreetingHeader(),
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
_buildMainContent(),
|
||||||
children: [
|
],
|
||||||
Column(
|
),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'Good Morning! 👋',
|
|
||||||
style: GoogleFonts.inter(
|
|
||||||
color: primaryColor,
|
|
||||||
fontSize: 24,
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Container(
|
|
||||||
width: 48,
|
|
||||||
height: 48,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: accentColor.withOpacity(0.1),
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
),
|
|
||||||
child: Icon(
|
|
||||||
Icons.notifications_outlined,
|
|
||||||
color: accentColor,
|
|
||||||
size: 24,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
const BalanceCardPage(),
|
|
||||||
const SizedBox(height: 24),
|
|
||||||
QuickActionsPage(),
|
|
||||||
const SizedBox(height: 24),
|
|
||||||
RecentTransactionsWidget(
|
|
||||||
recentTransactions: fetchRecentTransactions(),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 24),
|
|
||||||
|
|
||||||
const SizedBox(height: 32),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
// Enhanced Floating Action Button
|
||||||
floatingActionButton: CustomNavBar(
|
floatingActionButton: CustomNavBar(
|
||||||
currentIndex: _selectedIndex,
|
currentIndex: _selectedIndex,
|
||||||
onTap: (index) {
|
onTap: (index) {
|
||||||
|
|
@ -147,7 +227,6 @@ class _FinTrackHomePageState extends State<FinTrackHomePage>
|
||||||
accentColor: accentColor,
|
accentColor: accentColor,
|
||||||
primaryColor: primaryColor,
|
primaryColor: primaryColor,
|
||||||
cardColor: cardColor,
|
cardColor: cardColor,
|
||||||
|
|
||||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerTop,
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerTop,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue