The BMI calculator uses smart technology to help people decide if they are underweight, overweight, obese or in the normal category.
- Underweight - less than 18.5
- Normal- 18.5 - 25
- Overweight - 25 - 30
- Obese - above 30
The free Font Awesome Icon pack available as set of Flutter Icons - based on font awesome version 6.2.1.
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 'package:font_awesome_flutter/font_awesome_flutter.dart';
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();
});
},
),
),
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()),
);
}
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);
}