-
Notifications
You must be signed in to change notification settings - Fork 0
/
Overweight.dart
118 lines (110 loc) · 3.73 KB
/
Overweight.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
import 'home.dart';
import 'package:flutter/material.dart';
// import 'main.dart';
void main() {
runApp(const ODietPlanApp());
}
class ODietPlanApp extends StatelessWidget {
const ODietPlanApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Diet Plan for Overweight',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const ODietPlanScreen(),
);
}
}
class ODietPlanScreen extends StatelessWidget {
const ODietPlanScreen({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(
'Diet Plan for Overweight',
style: TextStyle(color: Color(0xFFF4F6FB)),
),
backgroundColor: const Color(0xFF071026),
),
body: const ODietPlanDetails(),
);
}
}
class ODietPlanDetails extends StatelessWidget {
const ODietPlanDetails({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', 'Smoothie with spinach, kale, and berries', '250 kcal', 'Vitamins: A, C, K'),
dietPlanItem('Mid-Morning Snack', 'Apple slices with almond butter', '150 kcal', 'Vitamins: E, B2, B6'),
dietPlanItem('Lunch', 'Grilled chicken salad with mixed greens', '400 kcal', 'Vitamins: B3, B6, C, K'),
dietPlanItem('Afternoon Snack', 'Carrot sticks with hummus', '100 kcal', 'Vitamins: A, E, K'),
dietPlanItem('Evening Snack', 'Handful of mixed nuts', '200 kcal', 'Vitamins: E, B6'),
dietPlanItem('Dinner', 'Baked salmon with steamed broccoli', '450 kcal', 'Vitamins: D, B12, 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),
),
],
),
);
}
}