-
Notifications
You must be signed in to change notification settings - Fork 0
/
Normaldiet.dart
121 lines (113 loc) · 3.81 KB
/
Normaldiet.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import 'home.dart';
import 'package:flutter/material.dart';
// import 'main.dart';
void main() {
runApp(const NDietPlanApp());
}
class NDietPlanApp extends StatelessWidget {
const NDietPlanApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Balanced Diet Plan',
theme: ThemeData(
primarySwatch: Colors.green,
),
home: const NDietPlanScreen(),
);
}
}
class NDietPlanScreen extends StatelessWidget {
const NDietPlanScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xFF071026),
appBar: AppBar(
leading: IconButton(
color: const Color(0xFFF4F6FB),
icon: const Icon(Icons.arrow_back),
onPressed: () {
runApp(const MyAppSecond()); // Navigate back to the Home screen
},
),
title: const Text(
'Balanced Diet Plan',
style: TextStyle(color: Color(0xFFF4F6FB)),
),
backgroundColor: const Color(0xFF071026),
),
body: const NDietPlanDetails(),
);
}
}
class NDietPlanDetails extends StatelessWidget {
const NDietPlanDetails({super.key});
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(16.0),
child: Scrollbar(
thumbVisibility: true,
thickness: 5,
radius: const Radius.circular(10),
trackVisibility: true,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'Diet Plan',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.white),
),
const SizedBox(height: 16),
dietPlanItem('Breakfast', 'Whole grain toast with avocado and poached egg', '350 kcal', 'Vitamins: A, B6, C, D'),
dietPlanItem('Mid-Morning Snack', 'Apple slices with almond butter', '150 kcal', 'Vitamins: A, E, B2'),
dietPlanItem('Lunch', 'Turkey sandwich with mixed greens and tomato', '450 kcal', 'Vitamins: A, B6, C, K'),
dietPlanItem('Afternoon Snack', 'Carrot sticks with hummus', '100 kcal', 'Vitamins: A, C, E'),
dietPlanItem('Evening Snack', 'Mixed nuts', '200 kcal', 'Vitamins: E, B3, B1'),
dietPlanItem('Dinner', 'Grilled chicken with brown rice and steamed vegetables', '500 kcal', 'Vitamins: B6, C, K'),
],
),
),
),
);
}
Widget dietPlanItem(String meal, String description, String calories, String vitamins) {
return Container(
margin: const EdgeInsets.only(bottom: 16),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white24,
borderRadius: BorderRadius.circular(8),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
meal,
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: Colors.white),
),
const SizedBox(height: 8, width: 400),
Text(
description,
style: const TextStyle(fontSize: 16, color: Colors.white),
),
const SizedBox(height: 4),
Text(
calories,
style: const TextStyle(fontSize: 16, color: Colors.white),
),
const SizedBox(height: 4),
Text(
vitamins,
style: const TextStyle(fontSize: 16, color: Colors.white),
),
],
),
);
}
}