Skip to content

Conversation

deenamanick
Copy link
Contributor

@deenamanick deenamanick commented Nov 10, 2021

Performing hot restart...
Syncing files to device Android SDK built for x86...
lib/main.dart:25:17: Error: Field 'controller' should be initialized because its type 'TabController' doesn't allow null.

  • 'TabController' is from 'package:flutter/src/material/tab_controller.dart' ('../../snap/flutter/common/flutter/packages/flutter/lib/src/material/tab_controller.dart').
    TabController controller;
    ^^^^^^^^^^
    Restarted application in 256ms.

We are getting this error when we are running the program. This error can be fixed by introducing "late" variable in front of Tabcontroller Class.

Will declare late variable before create TabController controller to Lazily initializing a variable
Copy link
Contributor Author

@deenamanick deenamanick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performing hot restart...
Syncing files to device Android SDK built for x86...
lib/main.dart:25:17: Error: Field 'controller' should be initialized because its type 'TabController' doesn't allow null.

'TabController' is from 'package:flutter/src/material/tab_controller.dart' ('../../snap/flutter/common/flutter/packages/flutter/lib/src/material/tab_controller.dart').
TabController controller;
^^^^^^^^^^
Restarted application in 256ms.
We are getting this error when we are running the program. This error can be fixed by introducing "late" variable in front of Tabcontroller Class.

@nisrulz nisrulz merged commit 0df530c into nisrulz:develop Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants