I was trying to use the indexOf method in Dart and this error occurs. I have simply used two strings and thats it.
Asked
Active
Viewed 104 times
1 Answers
2
You cannot access instance fields before you initialized the object, in this case _MyHomePageState
.
See also https://stackoverflow.com/a/63542846/9479695
I think in your case you want to use the initState Method for your Stateful Widget. See https://api.flutter.dev/flutter/widgets/EditableTextState/initState.html

smotastic
- 388
- 1
- 11
-
Thank you! I shall surely look into it and post the progress. – Rituraj Tripathy Aug 19 '21 at 12:45