Skip to content

panditsamik/BMI-Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BMI Calculator

The BMI calculator uses technology to determine if a person is underweight, overweight or obese.

BMI = weight (kg) / height^2

The BMI calculator uses smart technology to help people decide if they are underweight, overweight, obese or in the normal category.

The body weight values (kg/m2) for adults (men and women above 18 years of age) are:

  • Underweight - less than 18.5
  • Normal- 18.5 - 25
  • Overweight - 25 - 30
  • Obese - above 30

Documentation and References :

Link

The free Font Awesome Icon pack available as set of Flutter Icons - based on font awesome version 6.2.1.

This icon pack includes only the free icons offered by Font Awesome out-of-the-box.

Installation:

Use this package as a library

Depend on it

Run this command:

With Flutter:

flutter pub add font_awesome_flutter

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  font_awesome_flutter: ^10.4.0

Import it

Now in your Dart code, you can use:

import 'package:font_awesome_flutter/font_awesome_flutter.dart';

Slider Widget

The easy way is to get the actual SliderTheme used in your context and modify only the properties you need. For example, to modify one slide:

SliderTheme(
            data: SliderTheme.of(context).copyWith(
              activeTrackColor: const Color(0xFF28afb0),
              inactiveTrackColor: const Color(0xFFadb5bd),
              thumbColor: const Color(0xFF28afb0),
              overlayColor: const Color(0xFFaecae2),
              thumbShape: const RoundSliderThumbShape(enabledThumbRadius: 15.0),
              overlayShape: const RoundSliderOverlayShape(overlayRadius: 30.0),
            ),
            child: Slider(
              value: height.toDouble(),
              min: 120.0,
              max: 320.0,
              onChanged: (double newValue) {
                setState(() {
                  height = newValue.round();
                });
              },
            ),
          ),

Navigate to a new screen and back

Link

Navigate to the second route using Navigator.push()

To switch to a new route, use the Navigator.push() method. The push() method adds a Route to the stack of routes managed by the Navigator. Where does the Route come from? You can create your own, or use a MaterialPageRoute, which is useful because it transitions to the new route using a platform-specific animation.

In the build() method of the FirstRoute widget, update the onPressed() callback:

// Within the `FirstRoute` widget
onPressed: () {
  Navigator.push(
    context,
    MaterialPageRoute(builder: (context) => const SecondRoute()),
  );
}

Return to the first route using Navigator.pop()

The pop() method removes the current Route from the stack of routes managed by the Navigator.

To implement a return to the original route, update the onPressed() callback in the SecondRoute widget:

// Within the SecondRoute widget
onPressed: () {
  Navigator.pop(context);
}

Screenshots:

WhatsApp Image 2023-03-02 at 10 42 42 PM

WhatsApp Image 2023-03-02 at 10 42 42 PM (1)

WhatsApp Image 2023-03-02 at 10 42 42 PM (2)

Video:

WhatsApp.Video.2023-03-02.at.10.42.44.PM.mp4