- Notifications
You must be signed in to change notification settings - Fork29.7k
Closed
Labels
c: regressionIt was better in the past than it is nowf: material designflutter/packages/flutter/material repository.found in release: 2.5Found to occur in 2.5frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionwaiting for PR to land (fixed)A fix is in flight
Description
Hello. When floatingActionButton is centerDocked in BottomNavigationBar with CircularNotchedRectangle on a widget with SafeArea the notch is wrong.
If you remove SafeArea widget works fine. The problem is with Flutter 2.5
Sample code:
import'package:flutter/material.dart';voidmain() {runApp(MyApp());}classMyAppextendsStatelessWidget {@overrideWidgetbuild(BuildContext context) {returnMaterialApp( home:SafeArea(child:Home()), ); }}classHomeextendsStatefulWidget {@override_HomeStatecreateState()=>_HomeState();}class_HomeStateextendsState<Home> {@overrideWidgetbuild(BuildContext context) {returnScaffold( floatingActionButton:FloatingActionButton(//Floating action button on Scaffold onPressed: () {//code to execute on button press }, child:Column( mainAxisAlignment:MainAxisAlignment.center, children: [Icon(Icons.directions, color:Colors.white, ),Text('Viaje', style:TextStyle( fontSize:10.0, color:Colors.white, ), ), ], ),//icon inside button ), floatingActionButtonLocation:FloatingActionButtonLocation.centerDocked,//floating action button position to center bottomNavigationBar:BottomAppBar(//bottom navigation bar on scaffold color:Colors.redAccent, shape:CircularNotchedRectangle(),//shape of notch notchMargin:5,//notche margin between floating button and bottom appbar child:Row(//children inside bottom appbar mainAxisSize:MainAxisSize.max, mainAxisAlignment:MainAxisAlignment.spaceBetween, children:<Widget>[IconButton( icon:Icon(Icons.menu, color:Colors.white, ), onPressed: () {}, ),IconButton( icon:Icon(Icons.search, color:Colors.white, ), onPressed: () {}, ),IconButton( icon:Icon(Icons.print, color:Colors.white, ), onPressed: () {}, ),IconButton( icon:Icon(Icons.people, color:Colors.white, ), onPressed: () {}, ), ], ), ), ); }}
Removing SafeArea result is fine:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.5.0, on Microsoft Windows [Version 10.0.19043.1165], locale es-CO)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] VS Code, 64-bit edition (version 1.55.2)
[√] Connected device (3 available)
• No issues found!
Metadata
Metadata
Assignees
Labels
c: regressionIt was better in the past than it is nowf: material designflutter/packages/flutter/material repository.found in release: 2.5Found to occur in 2.5frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionwaiting for PR to land (fixed)A fix is in flight
