update favorite, chat

This commit is contained in:
Phuoc Nguyen
2025-11-03 17:05:47 +07:00
parent 988216b151
commit b3d7637760
6 changed files with 530 additions and 81 deletions

View File

@@ -6,6 +6,8 @@ library;
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:worker/core/router/app_router.dart';
import 'package:worker/core/theme/colors.dart';
import 'package:worker/features/account/presentation/pages/account_page.dart';
import 'package:worker/features/home/presentation/pages/home_page.dart';
@@ -40,25 +42,15 @@ class MainScaffold extends ConsumerWidget {
];
return Scaffold(
body: IndexedStack(
index: currentIndex,
children: pages,
),
floatingActionButton: currentIndex == 0
body: IndexedStack(index: currentIndex, children: pages),
floatingActionButton: currentIndex < 4
? Padding(
padding: const EdgeInsets.only(bottom: 20),
child: FloatingActionButton(
onPressed: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Chat - Đang phát triển'),
duration: Duration(seconds: 1),
),
);
},
backgroundColor: AppColors.accentCyan,
elevation: 8,
child: const Icon(Icons.chat_bubble, size: 24, color: Colors.white),
onPressed: () => context.push(RouteNames.chat),
backgroundColor: const Color(0xFF35C6F4), // Accent cyan color
elevation: 4,
child: const Icon(Icons.chat_bubble, color: AppColors.white, size: 28),
),
)
: null,
@@ -66,11 +58,7 @@ class MainScaffold extends ConsumerWidget {
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withValues(alpha: 0.05),
blurRadius: 10,
offset: const Offset(0, -2),
),
BoxShadow(color: Colors.black.withValues(alpha: 0.05), blurRadius: 10, offset: const Offset(0, -2)),
],
),
child: SafeArea(
@@ -87,18 +75,9 @@ class MainScaffold extends ConsumerWidget {
currentIndex: currentIndex,
elevation: 0,
items: [
const BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Trang chủ',
),
const BottomNavigationBarItem(
icon: Icon(Icons.loyalty),
label: 'Hội viên',
),
const BottomNavigationBarItem(
icon: Icon(Icons.local_offer),
label: 'Tin tức',
),
const BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Trang chủ'),
const BottomNavigationBarItem(icon: Icon(Icons.loyalty), label: 'Hội viên'),
const BottomNavigationBarItem(icon: Icon(Icons.local_offer), label: 'Tin tức'),
BottomNavigationBarItem(
icon: Stack(
clipBehavior: Clip.none,
@@ -108,25 +87,12 @@ class MainScaffold extends ConsumerWidget {
top: -4,
right: -4,
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 6,
vertical: 2,
),
decoration: BoxDecoration(
color: AppColors.danger,
borderRadius: BorderRadius.circular(12),
),
constraints: const BoxConstraints(
minWidth: 20,
minHeight: 20,
),
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
decoration: BoxDecoration(color: AppColors.danger, borderRadius: BorderRadius.circular(12)),
constraints: const BoxConstraints(minWidth: 20, minHeight: 20),
child: const Text(
'5',
style: TextStyle(
color: Colors.white,
fontSize: 11,
fontWeight: FontWeight.w700,
),
style: TextStyle(color: Colors.white, fontSize: 11, fontWeight: FontWeight.w700),
textAlign: TextAlign.center,
),
),
@@ -135,10 +101,7 @@ class MainScaffold extends ConsumerWidget {
),
label: 'Thông báo',
),
const BottomNavigationBarItem(
icon: Icon(Icons.account_circle),
label: 'Cài đặt',
),
const BottomNavigationBarItem(icon: Icon(Icons.account_circle), label: 'Cài đặt'),
],
onTap: (index) {
ref.read(currentPageIndexProvider.notifier).setIndex(index);