Advertisement
PotiSolhdoost

Untitled

Mar 20th, 2024
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.42 KB | None | 0 0
  1. import 'package:fl_chart/fl_chart.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:smartflask/components/ArcProgressIndicator.dart';
  4. import 'package:smartflask/main.dart';
  5. import 'package:smartflask/components/pie_chart.dart';
  6.  
  7. void main() {
  8. runApp(const MyApp());
  9. }
  10. class MyApp extends StatefulWidget {
  11. const MyApp({Key? key}) : super(key: key);
  12.  
  13. @override
  14. State<MyApp> createState() => _MyAppState();
  15. }
  16. class _MyAppState extends State<MyApp> {
  17. int selectedPageIndex = 0;
  18. double progress = 0.152;
  19. @override
  20. Widget build(BuildContext context)
  21. {
  22. return MaterialApp(
  23. theme: ThemeData(fontFamily: 'OpenSans'),
  24. home: Scaffold(
  25. appBar: AppBar(
  26. title: const Text('Smart Flask',
  27. style: TextStyle(fontFamily: 'Raleway')),
  28.  
  29. backgroundColor: Colors.blue,
  30. ),
  31. body: Center(
  32.  
  33. child: Column(
  34. mainAxisAlignment: MainAxisAlignment.start,
  35. children: <Widget>[
  36. Card(
  37. margin: EdgeInsets.all(10),
  38. child: Padding(
  39. padding: EdgeInsets.all(20),
  40. child: Column(
  41. children: <Widget> [
  42. Positioned(
  43. bottom: 8,
  44. child: ArcProgressIndicator(
  45. progress: progress,
  46. strokeWidth: 8.0,
  47. child: const Icon(Icons.water_drop_outlined,
  48. color: Colors.blue,
  49. size:75,
  50. ),
  51. ),
  52. ),
  53. const Positioned(
  54. bottom: 2,
  55. child: Text(
  56. '764/500 ml drank',
  57. style: TextStyle(fontSize: 24),
  58. ),
  59. ),
  60. TextButton(onPressed: () {},
  61. child: const Row (
  62. mainAxisAlignment: MainAxisAlignment.center,
  63. children: <Widget> [
  64. Text('Refresh'),
  65. Icon(Icons.refresh),
  66. ]
  67. )
  68. ),
  69. SizedBox(height: 20),
  70. ]
  71. )
  72. )
  73. ),
  74. Card(
  75. margin: EdgeInsets.all(10),
  76. child: Padding(
  77. padding: EdgeInsets.all(20),
  78.  
  79. child: TextButton(onPressed: () {},
  80. child: const Row (
  81. mainAxisAlignment: MainAxisAlignment.center,
  82.  
  83. children: <Widget> [
  84. Text('Amount of water this week',
  85. style: TextStyle(fontSize: 28,color:Colors.blue),),
  86. Icon(Icons.arrow_forward, color: Colors.blue,),
  87. ],
  88. ),
  89. ),
  90. ),
  91. ),
  92. Card (
  93. margin: EdgeInsets.all(10),
  94. child: Padding(
  95. padding: EdgeInsets.all(20),
  96.  
  97. child: TextButton(onPressed: () {}, child: const Row (
  98. mainAxisAlignment: MainAxisAlignment.center,
  99. children: <Widget> [
  100. Icon(Icons.insert_chart, color: Colors.blue),
  101. Text('See my insights',
  102. style: TextStyle(fontSize: 28,color:Colors.blue)),
  103. ]
  104. ),
  105. ),
  106. ),
  107. ),
  108. Card (
  109. margin: EdgeInsets.all(10),
  110. child: Padding(
  111. padding: EdgeInsets.all(20),
  112.  
  113. child: TextButton(onPressed: () {}, child: const Row (
  114. mainAxisAlignment: MainAxisAlignment.center,
  115. children: <Widget> [
  116. Text('Set Reminder',
  117. style: TextStyle(fontSize: 20,color:Colors.blue)),
  118. ]
  119. )
  120. ),
  121. )
  122. ),
  123. ]
  124. ),
  125. ),
  126.  
  127.  
  128. bottomNavigationBar: NavigationBar(
  129. destinations: const [
  130. NavigationDestination(
  131. icon: Icon(Icons.home),
  132. label: 'Home'),
  133. NavigationDestination(
  134. icon: Icon(Icons.explore),
  135. label: 'Explore'),
  136. NavigationDestination(
  137. icon: Icon(Icons.bar_chart),
  138. label: 'Insights'),
  139. NavigationDestination(
  140. icon: Icon(Icons.account_circle),
  141. label: 'Profile')
  142. ],
  143. backgroundColor: Color.fromRGBO(224, 224, 224, 1),
  144.  
  145. shadowColor: Colors.black,
  146. selectedIndex: selectedPageIndex,
  147. onDestinationSelected: (int index) {
  148. setState(() {
  149. selectedPageIndex = index;
  150. });
  151. },
  152. animationDuration: Duration(milliseconds: 1000),
  153. ),
  154.  
  155. ),
  156. );
  157. }
  158.  
  159. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement