Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib/features/statistics/model/StatisticsModel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ class UserStatisticsModel {
final int thisWeekTotal;
final double growthPercentage;
final List<RecentTaskModel> recentTasks;
final List<int> dailyCounts; // <--- THÊM DÒNG NÀY (Hứng mảng 7 ngày)
final List<int> dailyCounts;

UserStatisticsModel({
required this.today,
required this.todayCompletedPercentage,
required this.thisWeekTotal,
required this.growthPercentage,
required this.recentTasks,
required this.dailyCounts, // <--- Cập nhật constructor
required this.dailyCounts,
});

factory UserStatisticsModel.fromJson(Map<String, dynamic> json) {
Expand Down
36 changes: 2 additions & 34 deletions src/lib/features/tasks/view/screens/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,42 +177,10 @@ class HomeScreen extends StatelessWidget {
color: viewModel.sortByPriority
? Colors.white
: AppColors.primaryBlue,
// --- SỬ DỤNG MOCK DATA VÀO TASKCARD ---
TaskCard(
task: task1, // Truyền task1 vào đây
leading: Stack(
children: [
const CircleAvatar(radius: 15, backgroundImage: NetworkImage('https://i.pravatar.cc/150?u=user2')),
const Positioned(left: 10, child: CircleAvatar(radius: 15, backgroundImage: NetworkImage('https://i.pravatar.cc/150?u=user3'))),
const Positioned(left: 20, child: CircleAvatar(radius: 15, backgroundImage: NetworkImage('https://i.pravatar.cc/150?u=user4'))),
Positioned(
left: 30,
child: Container(
padding: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface,
shape: BoxShape.circle,
),
child: Icon(
Icons.add_rounded,
size: 20,
color: Theme.of(context).colorScheme.primary,
),
),
const SizedBox(width: 5),
Text(
'Sort',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: viewModel.sortByPriority
? Colors.white
: AppColors.primaryBlue,
),
),
],
]
),
),
)
),
const SizedBox(width: 8),

Expand Down
9 changes: 5 additions & 4 deletions src/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import 'package:task_management_app/features/auth/presentation/view/auth_gate.dart';
import 'package:task_management_app/features/auth/presentation/view/login_view.dart';
import 'package:task_management_app/features/main/view/screens/main_screen.dart';
import 'package:task_management_app/features/tasks/viewmodel/task_viewmodel.dart';
import 'core/theme/app_theme.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:supabase_flutter/supabase_flutter.dart';
import 'package:provider/provider.dart';
import 'features/tasks/viewmodel/task_viewmodel.dart';

import 'core/theme/theme_provider.dart';

Expand All @@ -34,6 +32,9 @@ Future<void> main() async {
MultiProvider(
providers: [
ChangeNotifierProvider(create: (_) => ThemeProvider()),
ChangeNotifierProvider<TaskViewModel>(
create: (_) => TaskViewModel(),
),
],
child: const TaskApp()));
}
Expand All @@ -51,7 +52,7 @@ class TaskApp extends StatelessWidget {
themeMode: themeProvider.themeMode,
theme: AppTheme.lightTheme, // Bộ màu sáng ông vừa map xong
darkTheme: AppTheme.darkTheme,
home: const MainScreen(),
home: const AuthGate(),
debugShowCheckedModeBanner: false,
);
}
Expand Down
Loading