skip to Main Content

error: Non-nullable instance field ‘textResult’ must be initialized. (not_initialized_non_nullable_instance_field at [aplikasi_scan_plat_nomor] libscreenhome.dart:18)

class _HomeState extends State {
String textResult;

2

Answers


  1. With the sound null safety, our definitions should care about null cases.
    So you can use String textResult = ""; or String? textResult; for your code.

    Login or Signup to reply.
  2. You can add late keyword before the variable.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search