setBackButtonVisibility method

  1. @override
Future<bool> setBackButtonVisibility({
  1. required bool visible,
})
override

Set the back button visibility dynamically.

This method allows you to show or hide the back button in the app bar.

Parameters:

  • visible - Whether the back button should be visible

Returns true if the back button visibility was set successfully, false otherwise.

Implementation

@override
Future<bool> setBackButtonVisibility({required bool visible}) async {
  try {
    final result = await methodChannel.invokeMethod<bool>('setBackButtonVisibility', <String, bool>{
      'visible': visible,
    });
    return result ?? false;
  } on PlatformException catch (e) {
    debugPrint('Failed to set back button visibility: ${e.message}');
    return false;
  }
}