setAppBarVisibility method
Set the app bar visibility dynamically.
This method allows you to show or hide the app bar at runtime.
Parameters:
visible- Whether the app bar should be visible
Returns true if the visibility was set successfully, false otherwise.
Implementation
@override
Future<bool> setAppBarVisibility({required bool visible}) async {
try {
final result = await methodChannel.invokeMethod<bool>('setAppBarVisibility', <String, bool>{
'visible': visible,
});
return result ?? false;
} on PlatformException catch (e) {
debugPrint('Failed to set app bar visibility: ${e.message}');
return false;
}
}