Skip to content

Commit b18c1ff

Browse files
authored
Merge pull request #29 from AbdoWa7eed/features/insights-ui
Introduce Insights Feature UI
2 parents 86b025a + 818b285 commit b18c1ff

25 files changed

+941
-12
lines changed

assets/icons/calories.svg

Lines changed: 3 additions & 0 deletions
Loading

assets/icons/carbs.svg

Lines changed: 10 additions & 0 deletions
Loading

assets/icons/fats.svg

Lines changed: 4 additions & 0 deletions
Loading

assets/icons/protein.svg

Lines changed: 27 additions & 0 deletions
Loading

lib/core/res/assets_manager.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,10 @@ class AssetsManager {
7171
static const String info = 'assets/icons/info.svg';
7272
static const String theme = 'assets/icons/theme.svg';
7373
static const String logout = 'assets/icons/logout.svg';
74+
75+
// Nutrition Icons
76+
static const String calories = 'assets/icons/calories.svg';
77+
static const String fats = 'assets/icons/fats.svg';
78+
static const String carbs = 'assets/icons/carbs.svg';
79+
static const String protein = 'assets/icons/protein.svg';
7480
}

lib/core/res/strings_manager.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,14 @@ abstract class AppStrings {
213213
static const String aboutUs = "About Us";
214214
static const String darkTheme = "Dark Theme";
215215
static const String logout = "Logout";
216+
217+
// Insights
218+
static const String burningProgress = "Burning Progress";
219+
static const String nutritionProgress = "Nutrition Progress";
220+
static const String fats = "Fats";
221+
static const String carbs = "Carbs";
222+
static const String protein = "Protein";
223+
static const String workouts = "Workouts";
224+
static const String kcal = "Kcal";
225+
static const String mins = "Mins";
216226
}

lib/core/res/styles_manager.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ abstract class StylesManager {
2626
fontWeight: FontWeightManager.semiBold,
2727
color: ColorManager.black,
2828
);
29+
30+
static const TextStyle semiBold16 = TextStyle(
31+
fontSize: FontSize.s16,
32+
fontWeight: FontWeightManager.semiBold,
33+
color: ColorManager.white,
34+
);
35+
36+
static const TextStyle semiBold16Gray = TextStyle(
37+
fontSize: FontSize.s16,
38+
fontWeight: FontWeightManager.semiBold,
39+
color: ColorManager.mediumGray,
40+
);
41+
2942
static const TextStyle semiBold20 = TextStyle(
3043
fontSize: FontSize.s20,
3144
fontWeight: FontWeightManager.semiBold,

lib/core/res/ui_constants.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ abstract class UiConstants {
33
static const int pageTransitionDelay = 800;
44
static const int duration500 = 500;
55
static const int duration300 = 300;
6+
static const int duration1200 = 1200;
67
static RegExp passwordRegex = RegExp(
78
r'^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$',
89
);

lib/core/utils/calendar_utils.dart

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
class CalendarUtils {
2+
static bool isSameDay(DateTime a, DateTime b) {
3+
return a.year == b.year && a.month == b.month && a.day == b.day;
4+
}
5+
6+
static bool isCurrentMonth(DateTime date) {
7+
final now = DateTime.now();
8+
return date.year == now.year && date.month == now.month;
9+
}
10+
11+
static bool isDateInFuture(DateTime date) {
12+
final now = DateTime.now();
13+
return date.isAfter(now);
14+
}
15+
16+
static List<DateTime> getMonthDates(DateTime selectedDate) {
17+
final now = DateTime.now();
18+
final lastDay = DateTime(selectedDate.year, selectedDate.month + 1, 0);
19+
final maxDay = isCurrentMonth(selectedDate) ? now.day : lastDay.day;
20+
21+
return List.generate(
22+
maxDay,
23+
(i) => DateTime(selectedDate.year, selectedDate.month, i + 1),
24+
);
25+
}
26+
27+
static DateTime getPreviousMonth(DateTime currentDate) {
28+
return DateTime(currentDate.year, currentDate.month - 1, 1);
29+
}
30+
31+
static DateTime getNextMonth(DateTime currentDate) {
32+
return DateTime(currentDate.year, currentDate.month + 1, 1);
33+
}
34+
}

lib/features/home_layout/presentation/widgets/home_layout_view_body.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
33
import 'package:graduation_project/features/discover/presentation/views/discover_view.dart';
44
import 'package:graduation_project/features/home/presentation/views/home_view.dart';
55
import 'package:graduation_project/features/home_layout/presentation/cubit/home_layout_cubit.dart';
6+
import 'package:graduation_project/features/insights/presentation/views/insights_view.dart';
67
import 'package:graduation_project/features/profile/presentation/views/profile_view.dart';
78

89
class HomeLayoutViewBody extends StatelessWidget {
@@ -17,7 +18,7 @@ class HomeLayoutViewBody extends StatelessWidget {
1718
children: const [
1819
HomeView(),
1920
DiscoverView(),
20-
Placeholder(color: Colors.green),
21+
InsightsView(),
2122
ProfileView(),
2223
],
2324
);

0 commit comments

Comments
 (0)