How to Fix the Error

How to fix the error, Each child must be laid out exactly once. in flutter

Here the solution for the problem, there is a Expanded that is a child of other Expanded:

  @override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('BMI CALCULATOR'),
centerTitle: true,
),
body: Column(
children: [
Expanded(
child: Row(
children: [
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
print('Male');
updateColor(1);
});
},
child: ReusableCard(
colour: maleCardColor,
cardChild: IconContent(
label: 'MALE',
cardIcon: FontAwesomeIcons.mars,
),
),
),
),
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
print('Female');
updateColor(2);
});
},
child: ReusableCard(
colour: femaleCardColor,
cardChild: IconContent(
label: 'FEMALE',
cardIcon: FontAwesomeIcons.venus,
),
),
),
),
],
),
),
Expanded( // <----- just remove the Expanded that was a parent of this one
child: ReusableCard(
colour: activeCardColor,
),
),
Expanded(
child: Row(
children: [
Expanded(
child: ReusableCard(
colour: activeCardColor,
),
),
Expanded(
child: ReusableCard(
colour: activeCardColor,
),
),
],
),
),
Container(
color: bottomContainerColor,
margin: EdgeInsets.only(top: 10.0),
width: double.infinity,
height: bottomContainerHeight,
)
],
),
);
}

How do I fix error CS8803? I think it might have to do with .NET 6.0 but what do I know

Your problem is the last two lines. These lines are executable code. Executable code must be inside a method.

Executable code is also allowed as top-level statements with specific syntax, hence the error message, but that is not relevant to your use case.

I don't know when you want to execute those two lines of code, but you probably do, so you should move them to the correct location

How to fix error in sql Execution finished with errors. Result: near ( : syntax error ?

You can use this because I believe there is no LEFT function in SQLite:

UPDATE bal
SET Perevod = substr(Perevod, 1, INSTR(Perevod, '/')-1)
WHERE INSTR(Perevod, '/')>0;

DEMO



Related Topics



Leave a reply



Submit