├── .gitignore
├── Assets
├── Images
│ ├── banner.jpg
│ ├── daynight.png
│ ├── fitmen.jpg
│ ├── ic_launcher.png
│ ├── icon.png
│ ├── insurance.png
│ ├── star.png
│ ├── star_fill.png
│ └── star_unfill.png
└── fonts
│ └── GoogleSansRegular.ttf
├── LICENSE
├── README.md
├── android
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ ├── com
│ │ │ │ └── nividata
│ │ │ │ │ └── bmi_calculator
│ │ │ │ │ └── MainActivity.java
│ │ │ └── io
│ │ │ │ └── flutter
│ │ │ │ └── plugins
│ │ │ │ └── GeneratedPluginRegistrant.java
│ │ └── res
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── values-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── banner_new3.jpg
├── bmi_calculator.iml
├── ic_launcher.png
├── ios
├── .gitignore
├── BmiCalculator.swift
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Podfile.lock
├── Runner-Bridging-Header.h
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ ├── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcuserdata
│ │ │ └── nividata1.xcuserdatad
│ │ │ ├── UserInterfaceState.xcuserstate
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
│ └── xcuserdata
│ │ └── nividata1.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
├── Runner
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x-1.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x-1.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x-1.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x-1.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ └── ItunesArtwork@2x.png
│ │ └── LaunchImage.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ └── README.md
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── Info.plist
│ └── main.m
└── ServiceDefinitions.json
├── lib
├── core
│ ├── app_theme.dart
│ ├── color_scheme.dart
│ └── constants.dart
├── data
│ ├── model
│ │ └── bmi.dart
│ ├── repository
│ │ └── local_repository.dart
│ └── sharedpref
│ │ ├── preferences.dart
│ │ └── shared_preference_helper.dart
├── extension
│ └── datetime_extension.dart
├── main.dart
├── utility
│ ├── app_util.dart
│ └── bmi_util.dart
└── view
│ ├── about
│ └── about.dart
│ ├── app
│ ├── app_view.dart
│ ├── theme_controller.dart
│ └── theme_provider.dart
│ ├── common
│ ├── animate_button.dart
│ ├── common_alert_dialog.dart
│ ├── rate_dialog.dart
│ ├── scale_transition.dart
│ └── size_transition.dart
│ ├── dashboard
│ ├── bmi_controller.dart
│ ├── bmi_provider.dart
│ ├── dashboard_view.dart
│ ├── drawer_footer_view.dart
│ ├── drawer_header_view.dart
│ └── theme_icon_button.dart
│ ├── drawer
│ ├── drawer_scaffold.dart
│ ├── menu_screen.dart
│ └── utils.dart
│ ├── home
│ ├── age_card_view.dart
│ ├── calculate_button_view.dart
│ ├── gender_card_view.dart
│ ├── height_card_view.dart
│ ├── height_unit_switch.dart
│ ├── home_view.dart
│ └── weight_card_view.dart
│ ├── result
│ └── result_view.dart
│ ├── setting
│ ├── setting_view.dart
│ └── theme_change_switch.dart
│ └── splash
│ └── splash.dart
├── pubspec.yaml
└── test
└── widget_test.dart
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # Miscellaneous
3 | *.class
4 | *.lock
5 | *.log
6 | *.pyc
7 | *.swp
8 | .DS_Store
9 | .atom/
10 | .buildlog/
11 | .history
12 | .svn/
13 |
14 | # IntelliJ related
15 | *.iml
16 | *.ipr
17 | *.iws
18 | .idea/
19 |
20 | # Visual Studio Code related
21 | .classpath
22 | .project
23 | .settings/
24 | .vscode/
25 |
26 | # Flutter repo-specific
27 | /bin/cache/
28 | /bin/mingit/
29 | /dev/benchmarks/mega_gallery/
30 | /dev/bots/.recipe_deps
31 | /dev/bots/android_tools/
32 | /dev/docs/doc/
33 | /dev/docs/flutter.docs.zip
34 | /dev/docs/lib/
35 | /dev/docs/pubspec.yaml
36 | /dev/integration_tests/**/xcuserdata
37 | /dev/integration_tests/**/Pods
38 | /packages/flutter/coverage/
39 | version
40 |
41 | # packages file containing multi-root paths
42 | .packages.generated
43 |
44 | # Flutter/Dart/Pub related
45 | **/doc/api/
46 | .dart_tool/
47 | .flutter-plugins
48 | .flutter-plugins-dependencies
49 | .packages
50 | .pub-cache/
51 | .pub/
52 | build/
53 | flutter_*.png
54 | linked_*.ds
55 | unlinked.ds
56 | unlinked_spec.ds
57 |
58 | # Android related
59 | **/android/**/gradle-wrapper.jar
60 | **/android/.gradle
61 | **/android/captures/
62 | **/android/gradlew
63 | **/android/gradlew.bat
64 | **/android/local.properties
65 | **/android/**/GeneratedPluginRegistrant.java
66 | **/android/key.properties
67 | *.jks
68 |
69 | # iOS/XCode related
70 | **/ios/**/*.mode1v3
71 | **/ios/**/*.mode2v3
72 | **/ios/**/*.moved-aside
73 | **/ios/**/*.pbxuser
74 | **/ios/**/*.perspectivev3
75 | **/ios/**/*sync/
76 | **/ios/**/.sconsign.dblite
77 | **/ios/**/.tags*
78 | **/ios/**/.vagrant/
79 | **/ios/**/DerivedData/
80 | **/ios/**/Icon?
81 | **/ios/**/Pods/
82 | **/ios/**/.symlinks/
83 | **/ios/**/profile
84 | **/ios/**/xcuserdata
85 | **/ios/.generated/
86 | **/ios/Flutter/App.framework
87 | **/ios/Flutter/Flutter.framework
88 | **/ios/Flutter/Flutter.podspec
89 | **/ios/Flutter/Generated.xcconfig
90 | **/ios/Flutter/app.flx
91 | **/ios/Flutter/app.zip
92 | **/ios/Flutter/flutter_assets/
93 | **/ios/Flutter/flutter_export_environment.sh
94 | **/ios/ServiceDefinitions.json
95 | **/ios/Runner/GeneratedPluginRegistrant.*
96 |
97 | # macOS
98 | **/macos/Flutter/GeneratedPluginRegistrant.swift
99 | **/macos/Flutter/Flutter-Debug.xcconfig
100 | **/macos/Flutter/Flutter-Release.xcconfig
101 | **/macos/Flutter/Flutter-Profile.xcconfig
102 |
103 | # Coverage
104 | coverage/
105 |
106 | # Symbols
107 | app.*.symbols
108 |
109 | # Exceptions to above rules.
110 | !**/ios/**/default.mode1v3
111 | !**/ios/**/default.mode2v3
112 | !**/ios/**/default.pbxuser
113 | !**/ios/**/default.perspectivev3
114 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
115 | !/dev/ci/**/Gemfile.lock
116 |
117 |
118 |
119 | # Flutter repo-specific
120 | /bin/internal/bootstrap.bat
121 | /bin/internal/bootstrap.sh
122 | /dev/devicelab/ABresults*.json
123 | analysis_benchmark.json
124 |
125 |
126 | # Flutter/Dart/Pub related
127 | **/generated_plugin_registrant.dart
128 |
129 | # Android related
130 | .gradle/
131 | # iOS/XCode related
132 | **/ios/Flutter/.last_build_id
133 | **/ios/Flutter/ephemeral
134 |
135 | # macOS
136 | **/Flutter/ephemeral/
137 | **/Pods/
138 | **/macos/Flutter/ephemeral
139 | **/xcuserdata/
140 |
141 | /android/.gradle/
142 | /lib/firebase_options.dart
143 | /android/app/google-services.json
144 | /ios/firebase_app_id_file.json
145 | /ios/Runner/GoogleService-Info.plist
146 |
147 |
148 |
149 |
--------------------------------------------------------------------------------
/Assets/Images/banner.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/Assets/Images/banner.jpg
--------------------------------------------------------------------------------
/Assets/Images/daynight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/Assets/Images/daynight.png
--------------------------------------------------------------------------------
/Assets/Images/fitmen.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/Assets/Images/fitmen.jpg
--------------------------------------------------------------------------------
/Assets/Images/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/Assets/Images/ic_launcher.png
--------------------------------------------------------------------------------
/Assets/Images/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/Assets/Images/icon.png
--------------------------------------------------------------------------------
/Assets/Images/insurance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/Assets/Images/insurance.png
--------------------------------------------------------------------------------
/Assets/Images/star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/Assets/Images/star.png
--------------------------------------------------------------------------------
/Assets/Images/star_fill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/Assets/Images/star_fill.png
--------------------------------------------------------------------------------
/Assets/Images/star_unfill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/Assets/Images/star_unfill.png
--------------------------------------------------------------------------------
/Assets/fonts/GoogleSansRegular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/Assets/fonts/GoogleSansRegular.ttf
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Nividata Consultancy
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BMI Calculator
2 |
3 |
10 | [![Contributors][contributors-shield]][contributors-url]
11 | [![Forks][forks-shield]][forks-url]
12 | [![Stargazers][stars-shield]][stars-url]
13 | [![Issues][issues-shield]][issues-url]
14 | [![MIT License][license-shield]][license-url]
15 | [![LinkedIn][linkedin-shield]][linkedin-url]
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
BMI Calculator
27 |
28 |
29 |
30 | View Demo
31 | ·
32 | Report Bug
33 | ·
34 | Request Feature
35 |
36 |
37 |
38 |
39 |
40 |
41 | ## Table of Contents
42 |
43 | * [About the Project](#about-the-project)
44 | * [Roadmap](#roadmap)
45 | * [Contributing](#contributing)
46 | * [License](#license)
47 | * [Contact](#contact)
48 | * [Acknowledgements](#acknowledgements)
49 |
50 |
51 |
52 | ## About The Project
53 |
54 | [![Product Name Screen Shot][product-screenshot]](https://example.com)
55 |
56 | ## What is BMI?
57 | Body Mass Index(BMI) is value derived from person's weight and height. The result of BMI measurement can give an idea about weather a person has correct weight for
58 | their height.
59 |
60 | ## How to Calculate BMI?
61 | BMI calculation is based on simple formula using person's weight and height.
62 | The formula for BMI = kg/m2 where kg is person's weight in kilograms and m2 is their height in meters squared. In simplified format it would be
63 | BMI = (Weight in Kilograms)/(Height in meters * Height in meters)
64 |
65 | For example if person's weight is 68kg and height is 172cm then
66 | BMI = 68/(1.72*2) = 23
67 |
68 | BMI calculator indicate whether person falls under healthy weight, underweight or overweight. If person's BMI is out of healthy range, their health
69 | risk may significantly increases.
70 |
71 | BMI Range for adults
72 | BMI : weight status
73 | Below 18.5 : Underweight
74 | 18.5 – 24.9 : Normal or Healthy Weight
75 | 25.0 - 29.9 : Overweight
76 | 30.0 & above: Obese
77 |
78 | ## Doctors uses BMI too for
79 | evalution for diet and physical acitivty
80 | cadiovascular disease and other health related problems
81 | measure fat in body
82 |
83 | ## Health risks for extra weight
84 | raises blood pressure and cholesterol and triglyceride levels
85 | it can make diabetes and other health problems
86 | hypertension or high blood pressure
87 | type 2 diabetes
88 | coronary heart disease
89 | gallbladder disease
90 | osteoarthritis
91 | sleep apnea and respiratory problems
92 |
93 | ## Health risks for under weight
94 | malnutrition, anemia or vitamin deficiencies
95 | osteoporosis from too little vitamin D and calcium
96 | Decreased Immune System
97 | fertility issues caused by irregular menstrual cycles
98 | growth and development issues in children and teenagers
99 |
100 | ## Who shouldn't use a BMI calculator
101 | BMI should not be used for muscle builders, athletes, pregnant women, the elderly or young children.
102 | This is because BMI does not take into account whether the weight is carried as muscle or fat it's just the number. Those with a higher muscle mass, such as athletes, may have a high BMI but not be at greater health risk. Those with a lower muscle mass, such as children who have not completed their growth or the elderly who may be losing some muscle mass may have a lower BMI.
103 |
104 | ### Built With
105 | This application built [Flutter](https://flutter.dev/). Flutter is cross-platform open source mobile framework built by Google. Flutter use Dart as a primary language which is highly scalable and easy codebase.
106 | * [Getting started with Flutter](https://flutter.dev/docs).
107 | * [Dart](https://dart.dev/)
108 |
109 |
110 | ## Roadmap
111 |
112 | See the [open issues](https://github.com/Fenil-Nividata/FlutterBMI/issues) for a list of proposed features (and known issues).
113 |
114 |
115 |
116 | ## Contributing
117 |
118 | Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
119 |
120 | 1. Fork the Project
121 | 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
122 | 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
123 | 4. Push to the Branch (`git push origin feature/AmazingFeature`)
124 | 5. Open a Pull Request
125 |
126 |
127 | ## License
128 |
129 | Distributed under the MIT License. See [LICENSE](https://github.com/Fenil-Nividata/FlutterBMI/blob/master/LICENSE) for more information.
130 |
131 |
132 | ## Contact
133 |
134 | [Nividata Consultancy](https://www.nividata.com/contact/)
135 |
136 | ## Developers
137 |
138 | ### Fenil Patel
139 | Contact: [LinkedIn](https://www.linkedin.com/in/fenilpatel23/)
140 | [GitHub](https://github.com/Fenscode)
141 |
142 |
143 | ## This app using following awesome open source libraries
144 |
145 | * [Flutter Responsive Screen](https://pub.dev/packages/flutter_responsive_screen)
146 | * [Font Awesome Flutter](https://pub.dev/packages/font_awesome_flutter)
147 | * [Animated Text Kit](https://pub.dev/packages/animated_text_kit)
148 | * [Dynamic Theme](https://pub.dev/packages/dynamic_theme)
149 | * [Shared Preferences](https://pub.dev/packages/shared_preferences)
150 | * [Flutter Launcher Icons](https://pub.dev/packages/flutter_launcher_icons)
151 |
152 |
153 |
154 |
155 | [contributors-shield]: https://img.shields.io/github/contributors/othneildrew/Best-README-Template.svg?style=flat-square
156 | [contributors-url]: https://github.com/Fenil-Nividata/FlutterBMI/graphs/contributors
157 | [forks-shield]: https://img.shields.io/github/forks/othneildrew/Best-README-Template.svg?style=flat-square
158 | [forks-url]: https://github.com/Fenil-Nividata/FlutterBMI/network/members
159 | [stars-shield]: https://img.shields.io/github/stars/othneildrew/Best-README-Template.svg?style=flat-square
160 | [stars-url]: https://github.com/Fenil-Nividata/FlutterBMI/stargazers
161 | [issues-shield]: https://img.shields.io/github/issues/othneildrew/Best-README-Template.svg?style=flat-square
162 | [issues-url]: https://github.com/Fenil-Nividata/FlutterBMI/issues
163 | [license-shield]: https://img.shields.io/github/license/othneildrew/Best-README-Template.svg?style=flat-square
164 | [license-url]: https://github.com/Fenil-Nividata/FlutterBMI/blob/master/LICENSE
165 | [linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
166 | [linkedin-url]: https://in.linkedin.com/company/nividataconsultancy
167 | [product-screenshot]: https://github.com/Fenil-Nividata/FlutterBMI/blob/master/banner_new3.jpg
168 |
169 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def keystoreProperties = new Properties()
10 | def keystorePropertiesFile = rootProject.file('key.properties')
11 | if (keystorePropertiesFile.exists()) {
12 | keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
13 | }
14 |
15 |
16 | def flutterRoot = localProperties.getProperty('flutter.sdk')
17 | if (flutterRoot == null) {
18 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
19 | }
20 |
21 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
22 | if (flutterVersionCode == null) {
23 | flutterVersionCode = '5'
24 | }
25 |
26 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
27 | if (flutterVersionName == null) {
28 | flutterVersionName = '1.0.2'
29 | }
30 |
31 | apply plugin: 'com.android.application'
32 | apply plugin: 'kotlin-android'
33 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
34 |
35 | android {
36 | compileSdkVersion flutter.compileSdkVersion
37 | ndkVersion flutter.ndkVersion
38 |
39 | compileOptions {
40 | sourceCompatibility JavaVersion.VERSION_1_8
41 | targetCompatibility JavaVersion.VERSION_1_8
42 | }
43 |
44 | kotlinOptions {
45 | jvmTarget = '1.8'
46 | }
47 |
48 | sourceSets {
49 | main.java.srcDirs += 'src/main/kotlin'
50 | }
51 |
52 | lintOptions {
53 | disable 'InvalidPackage'
54 | }
55 |
56 | defaultConfig {
57 | applicationId "com.nividata.bmi_calculator"
58 | minSdkVersion 21
59 | targetSdkVersion flutter.targetSdkVersion
60 | versionCode flutterVersionCode.toInteger()
61 | versionName flutterVersionName
62 | }
63 |
64 | signingConfigs {
65 | release {
66 | keyAlias keystoreProperties['keyAlias']
67 | keyPassword keystoreProperties['keyPassword']
68 | storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
69 | storePassword keystoreProperties['storePassword']
70 | }
71 | }
72 | buildTypes {
73 | release {
74 | signingConfig signingConfigs.release
75 | }
76 | }
77 | }
78 |
79 | flutter {
80 | source '../..'
81 | }
82 |
83 | dependencies {
84 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
85 | }
86 |
87 | // START: FlutterFire Configuration
88 | apply plugin: 'com.google.gms.google-services'
89 | apply plugin: 'com.google.firebase.crashlytics'
90 | // END: FlutterFire Configuration
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
10 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/nividata/bmi_calculator/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.nividata.bmi_calculator;
2 |
3 | import io.flutter.embedding.android.FlutterActivity;
4 |
5 | public class MainActivity extends FlutterActivity {
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:
--------------------------------------------------------------------------------
1 | package io.flutter.plugins;
2 |
3 | import androidx.annotation.Keep;
4 | import androidx.annotation.NonNull;
5 | import io.flutter.Log;
6 |
7 | import io.flutter.embedding.engine.FlutterEngine;
8 |
9 | /**
10 | * Generated file. Do not edit.
11 | * This file is generated by the Flutter tool based on the
12 | * plugins that support the Android platform.
13 | */
14 | @Keep
15 | public final class GeneratedPluginRegistrant {
16 | private static final String TAG = "GeneratedPluginRegistrant";
17 | public static void registerWith(@NonNull FlutterEngine flutterEngine) {
18 | try {
19 | flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.analytics.FlutterFirebaseAnalyticsPlugin());
20 | } catch(Exception e) {
21 | Log.e(TAG, "Error registering plugin firebase_analytics, io.flutter.plugins.firebase.analytics.FlutterFirebaseAnalyticsPlugin", e);
22 | }
23 | try {
24 | flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin());
25 | } catch(Exception e) {
26 | Log.e(TAG, "Error registering plugin firebase_core, io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin", e);
27 | }
28 | try {
29 | flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.crashlytics.FlutterFirebaseCrashlyticsPlugin());
30 | } catch(Exception e) {
31 | Log.e(TAG, "Error registering plugin firebase_crashlytics, io.flutter.plugins.firebase.crashlytics.FlutterFirebaseCrashlyticsPlugin", e);
32 | }
33 | try {
34 | flutterEngine.getPlugins().add(new com.iyaffle.launchreview.LaunchReviewPlugin());
35 | } catch(Exception e) {
36 | Log.e(TAG, "Error registering plugin launch_review, com.iyaffle.launchreview.LaunchReviewPlugin", e);
37 | }
38 | try {
39 | flutterEngine.getPlugins().add(new dev.fluttercommunity.plus.packageinfo.PackageInfoPlugin());
40 | } catch(Exception e) {
41 | Log.e(TAG, "Error registering plugin package_info_plus, dev.fluttercommunity.plus.packageinfo.PackageInfoPlugin", e);
42 | }
43 | try {
44 | flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin());
45 | } catch(Exception e) {
46 | Log.e(TAG, "Error registering plugin path_provider_android, io.flutter.plugins.pathprovider.PathProviderPlugin", e);
47 | }
48 | try {
49 | flutterEngine.getPlugins().add(new dev.fluttercommunity.plus.share.SharePlusPlugin());
50 | } catch(Exception e) {
51 | Log.e(TAG, "Error registering plugin share_plus, dev.fluttercommunity.plus.share.SharePlusPlugin", e);
52 | }
53 | try {
54 | flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin());
55 | } catch(Exception e) {
56 | Log.e(TAG, "Error registering plugin shared_preferences_android, io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin", e);
57 | }
58 | try {
59 | flutterEngine.getPlugins().add(new io.flutter.plugins.urllauncher.UrlLauncherPlugin());
60 | } catch(Exception e) {
61 | Log.e(TAG, "Error registering plugin url_launcher_android, io.flutter.plugins.urllauncher.UrlLauncherPlugin", e);
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.7.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:7.3.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | // START: FlutterFire Configuration
12 | classpath 'com.google.gms:google-services:4.3.8'
13 | classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
14 | // END: FlutterFire Configuration
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | mavenCentral()
22 | }
23 | }
24 |
25 | rootProject.buildDir = '../build'
26 | subprojects {
27 | project.buildDir = "${rootProject.buildDir}/${project.name}"
28 | }
29 | subprojects {
30 | project.evaluationDependsOn(':app')
31 | }
32 |
33 | tasks.register("clean", Delete) {
34 | delete rootProject.buildDir
35 | }
36 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | android.enableJetifier=true
2 | android.useAndroidX=true
3 | org.gradle.jvmargs=-Xmx1536M
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/banner_new3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/banner_new3.jpg
--------------------------------------------------------------------------------
/bmi_calculator.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ic_launcher.png
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 | /firebase_app_id_file.json
34 | /Runner/GoogleService-Info.plist
35 |
--------------------------------------------------------------------------------
/ios/BmiCalculator.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BmiCalculator.swift
3 | // Runner
4 | //
5 | // Created by Jay Savsani on 18/10/19.
6 | // Copyright © 2019 The Chromium Authors. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 9.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Flutter (1.0.0)
3 | - launch_review (0.0.1):
4 | - Flutter
5 | - package_info_plus (0.4.5):
6 | - Flutter
7 | - share_plus (0.0.1):
8 | - Flutter
9 | - shared_preferences_ios (0.0.1):
10 | - Flutter
11 | - url_launcher_ios (0.0.1):
12 | - Flutter
13 |
14 | DEPENDENCIES:
15 | - Flutter (from `Flutter`)
16 | - launch_review (from `.symlinks/plugins/launch_review/ios`)
17 | - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
18 | - share_plus (from `.symlinks/plugins/share_plus/ios`)
19 | - shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
20 | - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
21 |
22 | EXTERNAL SOURCES:
23 | Flutter:
24 | :path: Flutter
25 | launch_review:
26 | :path: ".symlinks/plugins/launch_review/ios"
27 | package_info_plus:
28 | :path: ".symlinks/plugins/package_info_plus/ios"
29 | share_plus:
30 | :path: ".symlinks/plugins/share_plus/ios"
31 | shared_preferences_ios:
32 | :path: ".symlinks/plugins/shared_preferences_ios/ios"
33 | url_launcher_ios:
34 | :path: ".symlinks/plugins/url_launcher_ios/ios"
35 |
36 | SPEC CHECKSUMS:
37 | Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
38 | launch_review: 75d5a956ba8eaa493e9c9d4bf4c05e505e8d5ed0
39 | package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
40 | share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
41 | shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad
42 | url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
43 |
44 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
45 |
46 | COCOAPODS: 1.11.2
47 |
--------------------------------------------------------------------------------
/ios/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Use this file to import your target's public headers that you would like to expose to Swift.
3 | //
4 |
5 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcuserdata/nividata1.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner.xcodeproj/project.xcworkspace/xcuserdata/nividata1.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcuserdata/nividata1.xcuserdatad/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildLocationStyle
6 | UseTargetSettings
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcuserdata/nividata1.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner.xcworkspace/xcuserdata/nividata1.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #include "AppDelegate.h"
2 | #include "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application
7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8 | [GeneratedPluginRegistrant registerWithRegistry:self];
9 | // Override point for customization after application launch.
10 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
11 | }
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x-1.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x-1.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x-1.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x-1.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "ItunesArtwork@2x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x-1.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaysavsani07/FlutterBMI/e4e60a9b74e07cba6545eeb0be6267ec0e957c74/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | BMI
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(CURRENT_PROJECT_VERSION)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 | CADisableMinimumFrameDurationOnPhone
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/ios/Runner/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char* argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/ios/ServiceDefinitions.json:
--------------------------------------------------------------------------------
1 | {"services":[]}
--------------------------------------------------------------------------------
/lib/core/app_theme.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class AppTheme {
4 | static lightTheme() {
5 | final ThemeData base = ThemeData.light();
6 |
7 | TextTheme _buildTextThemeLight(TextTheme textTheme) {
8 | return textTheme.copyWith(
9 | titleSmall: textTheme.titleSmall!.copyWith(
10 | color: Color.fromRGBO(86, 81, 104, 1), fontWeight: FontWeight.w900),
11 | bodySmall: textTheme.bodySmall!.copyWith(color: Color(0xFF8D8E98)),
12 | );
13 | }
14 |
15 | return base.copyWith(
16 | primaryColor: Colors.white,
17 | primaryColorDark: Colors.white,
18 | brightness: Brightness.light,
19 | iconTheme: IconThemeData(color: Colors.deepPurple),
20 | textTheme: _buildTextThemeLight(base.textTheme),
21 | cardTheme: CardTheme(
22 | color: Colors.white,
23 | elevation: 2.0,
24 | ),
25 | appBarTheme: AppBarTheme(
26 | backgroundColor: Colors.white,
27 | iconTheme: IconThemeData(
28 | color: Colors.black38,
29 | ),
30 | actionsIconTheme: IconThemeData(
31 | color: Colors.black38,
32 | ),
33 | centerTitle: true,
34 | elevation: 1,
35 | titleTextStyle: TextStyle(
36 | color: Color.fromRGBO(86, 81, 104, 1),
37 | fontSize: 16.0,
38 | fontWeight: FontWeight.w900,
39 | ),
40 | ),
41 | dialogTheme: base.dialogTheme.copyWith(
42 | backgroundColor: Colors.white,
43 | ),
44 | chipTheme: ChipThemeData(
45 | selectedColor: Colors.deepPurple,
46 | backgroundColor: Color.fromRGBO(237, 231, 246, 1),
47 | secondaryLabelStyle:
48 | TextStyle(fontWeight: FontWeight.w900, color: Colors.white),
49 | brightness: Brightness.light,
50 | disabledColor: Colors.grey,
51 | labelPadding: EdgeInsets.symmetric(horizontal: 5),
52 | labelStyle:
53 | TextStyle(fontWeight: FontWeight.w600, color: Colors.black54),
54 | padding: EdgeInsets.all(10.0),
55 | secondarySelectedColor: Colors.deepPurple,
56 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
57 | ),
58 | bottomSheetTheme:
59 | BottomSheetThemeData(backgroundColor: Colors.black.withOpacity(0)),
60 | );
61 | }
62 |
63 | static ThemeData darkTheme() {
64 | final ThemeData base = ThemeData.dark();
65 |
66 | TextTheme _buildTextThemeLight(TextTheme textTheme) {
67 | return textTheme.copyWith(
68 | titleSmall: textTheme.titleSmall!
69 | .copyWith(color: Colors.white60, fontWeight: FontWeight.w900),
70 | bodySmall: textTheme.bodySmall!.copyWith(color: Color(0xFF8D8E98)),
71 | );
72 | }
73 |
74 | return base.copyWith(
75 | primaryColor: Colors.black,
76 | primaryColorDark: Colors.black87,
77 | brightness: Brightness.dark,
78 | cardColor: Colors.grey.shade800,
79 | iconTheme: IconThemeData(color: Colors.grey.shade300),
80 | cardTheme: CardTheme(
81 | color: Colors.grey.shade800,
82 | elevation: 2.0,
83 | ),
84 | textTheme: _buildTextThemeLight(base.textTheme),
85 | appBarTheme: AppBarTheme(
86 | backgroundColor: Colors.black87,
87 | iconTheme: IconThemeData(
88 | color: Colors.grey.shade300,
89 | ),
90 | actionsIconTheme: IconThemeData(
91 | color: Colors.grey.shade300,
92 | ),
93 | centerTitle: true,
94 | elevation: 1,
95 | titleTextStyle: TextStyle(
96 | color: Colors.white60,
97 | fontSize: 16.0,
98 | fontWeight: FontWeight.w900,
99 | ),
100 | ),
101 | dialogTheme: base.dialogTheme.copyWith(
102 | backgroundColor: Colors.black87,
103 | ),
104 | chipTheme: ChipThemeData(
105 | selectedColor: Colors.deepPurple,
106 | backgroundColor: Color.fromRGBO(237, 231, 246, 1),
107 | secondaryLabelStyle:
108 | TextStyle(fontWeight: FontWeight.w900, color: Colors.white),
109 | brightness: Brightness.dark,
110 | disabledColor: Colors.grey,
111 | labelPadding: EdgeInsets.symmetric(horizontal: 5),
112 | labelStyle:
113 | TextStyle(fontWeight: FontWeight.w600, color: Colors.black54),
114 | padding: EdgeInsets.all(10.0),
115 | secondarySelectedColor: Colors.deepPurple,
116 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
117 | ),
118 | bottomSheetTheme:
119 | BottomSheetThemeData(backgroundColor: Colors.black.withOpacity(0)),
120 | );
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/lib/core/color_scheme.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | extension CustomColorScheme on ColorScheme {
4 | Color get buttonColor =>
5 | brightness == Brightness.light ? Colors.grey.shade200 : Colors.grey.shade700;
6 |
7 | Color get accentColor =>
8 | brightness == Brightness.light ? Color.fromRGBO(86, 81, 104, 1) : Colors.white60;
9 | }
10 |
--------------------------------------------------------------------------------
/lib/core/constants.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:font_awesome_flutter/font_awesome_flutter.dart';
3 |
4 | const double kBottomContainerHeight = 80.0;
5 | const Color kBottomContainerColor = Color(0xFFEB1555);
6 | const Color kActiveCardColor = Color(0xFF1D1E33);
7 | const Color kInactiveCardColor = Color(0xFF111328);
8 | String platformVersion = "";
9 |
10 | enum Gender {
11 | Male,
12 | Female,
13 | }
14 |
15 | String aboutBMI =
16 | "Body Mass Index(BMI) is value derived from person's weight and height." +
17 | "The result of BMI measurement can give an idea about weather a person has correct weight for their height.";
18 |
19 | Icon themeIcon = Icon(
20 | FontAwesomeIcons.solidMoon,
21 | color: Colors.transparent,
22 | );
23 |
24 | const kLabelTextStyle = TextStyle(
25 | fontSize: 20.0,
26 | color: Color(0xFF8D8E98),
27 | );
28 |
29 | const listHeading =
30 | TextStyle(fontSize: 18.0, color: Colors.grey, fontWeight: FontWeight.w900);
31 |
32 | const listTitle = TextStyle(
33 | fontSize: 16.0, color: Colors.grey, fontWeight: FontWeight.normal);
34 |
35 | const listTrailing =
36 | TextStyle(fontSize: 14.0, color: Colors.grey, fontWeight: FontWeight.w900);
37 |
38 | const kNumberTextStyle = TextStyle(
39 | color: Color.fromRGBO(86, 81, 104, 1),
40 | fontSize: 50.0,
41 | fontWeight: FontWeight.w900);
42 |
43 | const kTitleTextStyle = TextStyle(
44 | fontSize: 50.0,
45 | fontWeight: FontWeight.bold,
46 | );
47 |
48 | const kResultTextStyle = TextStyle(
49 | color: Color(0xFF24D876),
50 | fontSize: 22.0,
51 | fontWeight: FontWeight.bold,
52 | );
53 |
54 | const kBMITextStyle = TextStyle(
55 | fontSize: 100.0,
56 | fontWeight: FontWeight.bold,
57 | );
58 |
59 | const kResultBodyTextStyle = TextStyle(
60 | fontSize: 22.0,
61 | );
62 |
--------------------------------------------------------------------------------
/lib/data/model/bmi.dart:
--------------------------------------------------------------------------------
1 | import 'package:bmi_calculator/core/constants.dart';
2 |
3 | class Bmi {
4 | final int age;
5 | final Weight weight;
6 | final Height height;
7 | final Gender gender;
8 |
9 | Bmi({
10 | required this.age,
11 | required this.weight,
12 | required this.height,
13 | required this.gender,
14 | });
15 |
16 | factory Bmi.initial() {
17 | return Bmi(
18 | age: 18,
19 | weight: Weight.initial(),
20 | height: Height.initial(),
21 | gender: Gender.Female,
22 | );
23 | }
24 |
25 | Bmi copyWith({
26 | int? age,
27 | Weight? weight,
28 | Height? height,
29 | Gender? gender,
30 | }) {
31 | return Bmi(
32 | age: age ?? this.age,
33 | weight: weight ?? this.weight,
34 | height: height ?? this.height,
35 | gender: gender ?? this.gender,
36 | );
37 | }
38 | }
39 |
40 | class Weight {
41 | final bool isKg;
42 | final int weight;
43 |
44 | Weight({
45 | required this.isKg,
46 | required this.weight,
47 | });
48 |
49 | factory Weight.initial() {
50 | return Weight(
51 | isKg: true,
52 | weight: 50,
53 | );
54 | }
55 |
56 | Weight copyWith({
57 | bool? isKg,
58 | int? weight,
59 | }) {
60 | return Weight(
61 | isKg: isKg ?? this.isKg,
62 | weight: weight ?? this.weight,
63 | );
64 | }
65 |
66 | Map toJson() {
67 | return {
68 | "is_kg": isKg,
69 | "weight": weight,
70 | };
71 | }
72 |
73 | factory Weight.fromJson({required Map json}) {
74 | return Weight(
75 | isKg: json["is_kg"],
76 | weight: json["weight"],
77 | );
78 | }
79 | }
80 |
81 | class Height {
82 | final bool isCm;
83 | final int height;
84 | final int feet;
85 | final int inch;
86 |
87 | Height({
88 | required this.isCm,
89 | required this.height,
90 | required this.feet,
91 | required this.inch,
92 | });
93 |
94 | factory Height.initial() {
95 | return Height(
96 | isCm: true,
97 | height: 170,
98 | feet: 4,
99 | inch: 8,
100 | );
101 | }
102 |
103 | Height copyWith({
104 | bool? isCm,
105 | int? height,
106 | int? feet,
107 | int? inch,
108 | }) {
109 | return Height(
110 | isCm: isCm ?? this.isCm,
111 | height: height ?? this.height,
112 | feet: feet ?? this.feet,
113 | inch: inch ?? this.inch,
114 | );
115 | }
116 |
117 | Map toJson() {
118 | return {
119 | "is_cm": isCm,
120 | "height": height,
121 | "feet": feet,
122 | "inch": inch,
123 | };
124 | }
125 |
126 | factory Height.fromJson({required Map json}) {
127 | return Height(
128 | isCm: json["is_cm"],
129 | height: json["height"],
130 | feet: json["feet"],
131 | inch: json["inch"],
132 | );
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/lib/data/repository/local_repository.dart:
--------------------------------------------------------------------------------
1 | import 'package:bmi_calculator/data/sharedpref/preferences.dart';
2 | import 'package:bmi_calculator/data/sharedpref/shared_preference_helper.dart';
3 |
4 | class LocalRepository {
5 | final SharedPreferencesHelper preferencesHelper;
6 |
7 | LocalRepository({
8 | required this.preferencesHelper,
9 | });
10 |
11 | Future saveIsFirstTime() {
12 | return preferencesHelper.putBool(Preferences.isFirstTime, false);
13 | }
14 |
15 | Future rated() {
16 | return preferencesHelper.putBool(Preferences.rated, true);
17 | }
18 |
19 | Future remindMeLater() {
20 | return preferencesHelper.putBool(Preferences.remindMeLater, true);
21 | }
22 |
23 | bool isRemindOrRated() {
24 | return preferencesHelper.getBool(Preferences.remindMeLater,
25 | defValue: false) ||
26 | preferencesHelper.getBool(Preferences.rated, defValue: false);
27 | }
28 |
29 | bool getFirstTime() {
30 | return preferencesHelper.getBool(Preferences.isFirstTime, defValue: true);
31 | }
32 |
33 | int getAppOpenCount() {
34 | return preferencesHelper.getInt(Preferences.appOpenCount, defValue: 0);
35 | }
36 |
37 | Future increaseAppOpenCount() {
38 | return preferencesHelper.putInt(
39 | Preferences.appOpenCount, getAppOpenCount() + 1);
40 | }
41 |
42 | Future setFirstTimeDate() {
43 | return preferencesHelper.putInt(
44 | Preferences.firstTimeDate, DateTime.now().millisecondsSinceEpoch);
45 | }
46 |
47 | DateTime getFirstTimeDate() {
48 | int dateTime = preferencesHelper.getInt(Preferences.firstTimeDate);
49 | if (dateTime == -1) {
50 | return DateTime.now();
51 | } else {
52 | return DateTime.fromMillisecondsSinceEpoch(dateTime);
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/lib/data/sharedpref/preferences.dart:
--------------------------------------------------------------------------------
1 | class Preferences {
2 | static const String theme = "theme";
3 | static const String isKg = "is_kg";
4 | static const String isCm = "is_cm";
5 | static const String isFirstTime = "isFirstTime";
6 | static const String firstTimeDate = "firstTimeDate";
7 | static const String appOpenCount = "appOpenCount";
8 | static const String remindMeLater = "remindMeLater";
9 | static const String rated = "rated";
10 | }
11 |
--------------------------------------------------------------------------------
/lib/data/sharedpref/shared_preference_helper.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'package:shared_preferences/shared_preferences.dart';
3 |
4 | class SharedPreferencesHelper {
5 | final SharedPreferences? _prefs;
6 |
7 | SharedPreferencesHelper(this._prefs);
8 |
9 | // get bool
10 | bool getBool(String key, {bool defValue = false}) {
11 | if (_prefs == null) return defValue;
12 | return _prefs!.getBool(key) ?? defValue;
13 | }
14 |
15 | // put bool
16 | Future putBool(String key, bool value) {
17 | if (_prefs == null) return Future.value(false);
18 | return _prefs!.setBool(key, value);
19 | }
20 |
21 | // get int
22 | int getInt(String key, {int defValue = -1}) {
23 | if (_prefs == null) return defValue;
24 | return _prefs!.getInt(key) ?? defValue;
25 | }
26 |
27 | // put int.
28 | Future putInt(String key, int value) {
29 | if (_prefs == null) return Future.value(false);
30 | return _prefs!.setInt(key, value);
31 | }
32 |
33 | // get double
34 | double getDouble(String key, {double defValue = -1}) {
35 | if (_prefs == null) return defValue;
36 | return _prefs!.getDouble(key) ?? defValue;
37 | }
38 |
39 | // put double
40 | Future putDouble(String key, double value) {
41 | if (_prefs == null) return Future.value(false);
42 | return _prefs!.setDouble(key, value);
43 | }
44 |
45 | // get string
46 | String getString(String key, {String defValue = ''}) {
47 | if (_prefs == null) return defValue;
48 | return _prefs!.getString(key) ?? defValue;
49 | }
50 |
51 | // put string
52 | Future putString(String key, String value) {
53 | if (_prefs == null) return Future.value(false);
54 | return _prefs!.setString(key, value);
55 | }
56 |
57 | // get string list
58 | List getStringList(String key, {List defValue = const []}) {
59 | if (_prefs == null) return defValue;
60 | return _prefs!.getStringList(key) ?? defValue;
61 | }
62 |
63 | // put string list
64 | Future putStringList(String key, List value) {
65 | if (_prefs == null) return Future.value(false);
66 | return _prefs!.setStringList(key, value);
67 | }
68 |
69 | // get object
70 | Map? getObj(String key) {
71 | if (_prefs == null) return null;
72 | String? data = _prefs!.getString(key);
73 | return (data == null || data.isEmpty)
74 | ? null
75 | : json.decode(data) as Map;
76 | }
77 |
78 | // put object
79 | Future putObj(String key, Map? value) {
80 | if (_prefs == null) return Future.value(false);
81 | return _prefs!.setString(key, value == null ? "" : json.encode(value));
82 | }
83 |
84 | // get object with mapper fun
85 | T? getObject(String key, T Function(Map v) f,
86 | {T? defValue}) {
87 | Map? map = getObj(key);
88 | return map == null ? defValue : f(map);
89 | }
90 |
91 | // put object with mapper fun
92 | Future putObject(
93 | String key, Map Function() toJson) {
94 | if (_prefs == null) return Future.value(false);
95 | return _prefs!.setString(key, json.encode(toJson()));
96 | }
97 |
98 | // get object list
99 | List