Issue
When i am creating a path for hive database it's showing an error. "Null check operator used on a null value"
void main() async{
Directory appDocDir = await getApplicationDocumentsDirectory();
runApp(const EntryWidget());
}
Solution
You should wait for the widget to initialize as it must be searching before that and getting null value somewhere in the library. Try using below line of code before the await command.
WidgetsFlutterBinding.ensureInitialized();
Directory appDir = await getApplicationDocumentsDirectory();
Answered By - akdev
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.