-1

error: Non-nullable instance field 'pickedImage' must be initialized. error: Non-nullable instance field 'textResult' must be initialized. error: The non-nullable variable 'hasilScan' must be initialized.

  File pickedImage;
  String textResult;
  static String hasilScan;
Saad
  • 539
  • 2
  • 19

2 Answers2

0

Thats simple either assign a value to variable or make variable type Nullablae using ?. Like File? File; String? string;

Vikas
  • 432
  • 4
  • 17
-1

In flutter after null safety was enabled, you can't leave a variable without assiging a value to it.
you can either use late modifier, but you have to assign a value to it later

late String textResult;

or make it nullable using null check operator

String? textResult;

or just assign a value to it :

String textResult = 'some text';
Saad
  • 539
  • 2
  • 19