We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have implemented the functions as First Order Objects, but getting the error when running the app. I am implementing the Gender Selection buttons-
import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'icon_content.dart'; import 'package:calcbmi/reusable_cart.dart'; class InputPage extends StatefulWidget { const InputPage({Key? key}) : super(key: key); @override State<InputPage> createState() => _InputPageState(); } const Color inactiveCardColor = Color(0xFF281B54); const Color activeCardColor = Color(0xFF7D49C4); enum Gender { male, female, } class _InputPageState extends State<InputPage> { late Gender selectedGender = Gender.male; **//Gives error if not assigned a value even when late is used.** @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('CALC BMI'), centerTitle: true, ), body: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: <Widget>[ /* Widget for gender */ Expanded( child: Row( children: <Widget>[ Expanded( child: ReusableCard( cardColor: selectedGender == Gender.male ? activeCardColor : inactiveCardColor, cardChild: IconContent(FontAwesomeIcons.mars, "MALE"), onPress: () { setState(() { selectedGender = Gender.male; }); }, ), ), Expanded( //Female card child: ReusableCard( cardColor: selectedGender == Gender.female ? activeCardColor : inactiveCardColor, cardChild: IconContent(FontAwesomeIcons.venus, "FEMALE"), onPress: () { setState(() { selectedGender = Gender.female; }); }, ), ), ], ), ), /* Widget for height */ Expanded( child: ReusableCard( activeCardColor, ), ), Expanded( child: Row( children: <Widget>[ Expanded( child: ReusableCard(activeCardColor), ), Expanded( child: ReusableCard(activeCardColor), ), ], ), ), Container( margin: EdgeInsets.symmetric(vertical: 20, horizontal: 30), height: 50, width: 60, child: ElevatedButton( onPressed: () {}, child: const Text('Calculate BMI'), ), ), ], ), ); } } ![Screenshot_20220707-165211](https://user-images.githubusercontent.com/78680067/177763632-5643ab74-89eb-4aa0-99e4-f97245468084.jpg)
The text was updated successfully, but these errors were encountered:
Hello have you resolved this?
Sorry, something went wrong.
No branches or pull requests
I have implemented the functions as First Order Objects, but getting the error when running the app. I am implementing the Gender Selection buttons-
The text was updated successfully, but these errors were encountered: