Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Flutter 2.5 floatingActionButton centerDocked notch problem #90024

Closed
Assignees
HansMuller
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
@fleoparra

Description

@fleoparra

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: () {},            ),          ],        ),      ),    );  }}

Result:
Screenshot_1631588469

Removing SafeArea result is fine:
Screenshot_1631588517

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp