How to conditionally assign a value to "ingList" based on the value of recipeList?
 class Calculator extends StatefulWidget {
    List<IngredientList> recipeList;
    Calculator(this.recipeList, {Key? key}) : super(key: key);

  @override
  State<Calculator> createState() => _CalculatorState();
}

class _CalculatorState extends State<Calculator> {
  List<IngredientList> ingList = [];


How to conditionally assign a value to Flutter List
You can use initState to do that
class Calculator extends StatefulWidget {
  List<IngredientList> recipeList;
  Calculator(this.recipeList, {Key? key}) : super(key: key);

  @override
  State<Calculator> createState() => _CalculatorState();
}

class _CalculatorState extends State<Calculator> {
  List<IngredientList> ingList = [];

  @override
  void initState() {
    super.initState();

    ingList = widget.recipeList; // you can do any condition here
  }
}

