flutter_mapbox_navigation icon indicating copy to clipboard operation
flutter_mapbox_navigation copied to clipboard

Fields are not initialised

Open plants2002 opened this issue 3 years ago • 3 comments

Copied the example but i get this error:

lib/navigation.dart:42:20: Error: Field '_directions' should be initialized because its type 'MapBoxNavigation' doesn't allow null. Running Gradle task 'assembleDebug'...

  • 'MapBoxNavigation' is from 'package:flutter_mapbox_navigation/library.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_mapbox_navigation-0.0.26/lib/library.dart'). Running Gradle task 'assembleDebug'... MapBoxNavigation _directions; Running Gradle task 'assembleDebug'... ^^^^^^^^^^^ Running Gradle task 'assembleDebug'... lib/navigation.dart:43:17: Error: Field '_options' should be initialized because its type 'MapBoxOptions' doesn't allow null. Running Gradle task 'assembleDebug'...
  • 'MapBoxOptions' is from 'package:flutter_mapbox_navigation/library.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_mapbox_navigation-0.0.26/lib/library.dart'). Running Gradle task 'assembleDebug'... MapBoxOptions _options; Running Gradle task 'assembleDebug'... ^^^^^^^^ Running Gradle task 'assembleDebug'... lib/navigation.dart:46:10: Error: Field '_distanceRemaining' should be initialized because its type 'double' doesn't allow null. Running Gradle task 'assembleDebug'... double _distanceRemaining, _durationRemaining; Running Gradle task 'assembleDebug'... ^^^^^^^^^^^^^^^^^^ Running Gradle task 'assembleDebug'... lib/navigation.dart:46:30: Error: Field '_durationRemaining' should be initialized because its type 'double' doesn't allow null. Running Gradle task 'assembleDebug'... double _distanceRemaining, _durationRemaining; Running Gradle task 'assembleDebug'... ^^^^^^^^^^^^^^^^^^ Running Gradle task 'assembleDebug'... lib/navigation.dart:47:34: Error: Field '_controller' should be initialized because its type 'MapBoxNavigationViewController' doesn't allow null. Running Gradle task 'assembleDebug'...
  • 'MapBoxNavigationViewController' is from 'package:flutter_mapbox_navigation/library.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_mapbox_navigation-0.0.26/lib/library.dart').

plants2002 avatar Feb 12 '22 17:02 plants2002

I'm having the same issue! :(

FarihaChoudhury avatar Feb 12 '22 17:02 FarihaChoudhury

Late initialize or simply initializing to 0 got my app running I was having this same issue

razaen801 avatar Mar 07 '22 10:03 razaen801

Late initialize or simply initializing to 0 got my app running I was having this same issue

Im strugling with this.. Where i have to change that? Late initialize not working for what i try with initialize.

renzo-massaro avatar May 18 '22 09:05 renzo-massaro

Stale issue message

eopeter avatar May 23 '23 01:05 eopeter

should be resolved in latest

eopeter avatar May 25 '23 12:05 eopeter