Skip to content

Commit 7a77888

Browse files
authored
fix: error screen in main.dart (#34)
1 parent ae8e44c commit 7a77888

3 files changed

Lines changed: 9 additions & 19 deletions

File tree

src/lib/features/statistics/model/StatisticsModel.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ class UserStatisticsModel {
4242
final int thisWeekTotal;
4343
final double growthPercentage;
4444
final List<RecentTaskModel> recentTasks;
45-
final List<int> dailyCounts; // <--- THÊM DÒNG NÀY (Hứng mảng 7 ngày)
45+
final List<int> dailyCounts;
4646

4747
UserStatisticsModel({
4848
required this.today,
4949
required this.todayCompletedPercentage,
5050
required this.thisWeekTotal,
5151
required this.growthPercentage,
5252
required this.recentTasks,
53-
required this.dailyCounts, // <--- Cập nhật constructor
53+
required this.dailyCounts,
5454
});
5555

5656
factory UserStatisticsModel.fromJson(Map<String, dynamic> json) {

src/lib/features/tasks/view/screens/home_screen.dart

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -178,20 +178,9 @@ class HomeScreen extends StatelessWidget {
178178
? Colors.white
179179
: AppColors.primaryBlue,
180180
),
181-
const SizedBox(width: 5),
182-
Text(
183-
'Sort',
184-
style: TextStyle(
185-
fontSize: 12,
186-
fontWeight: FontWeight.w600,
187-
color: viewModel.sortByPriority
188-
? Colors.white
189-
: AppColors.primaryBlue,
190-
),
191-
),
192-
],
181+
]
193182
),
194-
),
183+
)
195184
),
196185
const SizedBox(width: 8),
197186

src/lib/main.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ import 'package:flutter/material.dart';
22
import 'package:flutter/services.dart';
33
import 'package:provider/provider.dart';
44
import 'package:task_management_app/features/auth/presentation/view/auth_gate.dart';
5-
import 'package:task_management_app/features/auth/presentation/view/login_view.dart';
65
import 'package:task_management_app/features/main/view/screens/main_screen.dart';
6+
import 'package:task_management_app/features/tasks/viewmodel/task_viewmodel.dart';
77
import 'core/theme/app_theme.dart';
88
import 'package:flutter_dotenv/flutter_dotenv.dart';
99
import 'package:supabase_flutter/supabase_flutter.dart';
10-
import 'package:provider/provider.dart';
11-
import 'features/tasks/viewmodel/task_viewmodel.dart';
1210

1311
import 'core/theme/theme_provider.dart';
1412

@@ -34,6 +32,9 @@ Future<void> main() async {
3432
MultiProvider(
3533
providers: [
3634
ChangeNotifierProvider(create: (_) => ThemeProvider()),
35+
ChangeNotifierProvider<TaskViewModel>(
36+
create: (_) => TaskViewModel(),
37+
),
3738
],
3839
child: const TaskApp()));
3940
}
@@ -51,7 +52,7 @@ class TaskApp extends StatelessWidget {
5152
themeMode: themeProvider.themeMode,
5253
theme: AppTheme.lightTheme, // Bộ màu sáng ông vừa map xong
5354
darkTheme: AppTheme.darkTheme,
54-
home: const MainScreen(),
55+
home: const AuthGate(),
5556
debugShowCheckedModeBanner: false,
5657
);
5758
}

0 commit comments

Comments
 (0)