onError property

dynamic Function(Object, StackTrace)? onError
final

Error handler
Can be used to show custom dialog, snackbar, etc. when location is disabled, or permission denied, and other search error occured
Example

FMWidget(
  onError: (e, st) {
    if (e.toString().contains('LOCATION_DISABLED')) {
      // show snackbar asking user to enable device location
    } else if (e.toString().contains('PERMISSION_DENIED')) {
      // show dialog asking user to grant location permission
    }
  },
)

Implementation

final Function(Object, StackTrace)? onError;