-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Revert "Fix SnackBar clipping when it is floating due to FloatingActionButton positioning" #50516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
cc/ @filaps I'll try to figure out what's broken since you cannot view the internal tests and share my findings here when I can |
dnfield
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
For a little more details: on an internal test we found that the snackbar was coming in a bit lower than expected after this change. Hopefully we can add a similar test to the Flutter repo covering the same case. |
|
In an example where Test case: import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class CustomSnackBar {
void show(BuildContext context) {
final snackBar = message(context);
Scaffold.of(context).hideCurrentSnackBar();
Scaffold.of(context).showSnackBar(snackBar);
}
SnackBar message(BuildContext context) {
return SnackBar(
behavior: SnackBarBehavior.floating,
content: FlutterLogo(),
);
}
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Builder(
builder: (BuildContext context) => Center(
child: OutlineButton(
onPressed: () {
final accountSnackBar = CustomSnackBar();
accountSnackBar.show(context);
},
child: Text('Tap me'),
),
),
),
),
);
}
} |
|
I just realized that the change is intentional. @filaps, how do you reproduce the case in your second screenshot where the SnackBar seems clipped by the bottom nav bar / space saved for the FAB rect? Also, it may seem like we might have to make a breaking change announcement of some sort because while it is a fix, other developers might rely on the implementation or work around it. Still trying to figure out what to do in that case. cc/ @Hixie |
To reproduce the clipped SnackBar, you have to drag it a bit to the bottom (like if you were going to dismiss it). #43716 |
|
Right now, I think we should initiate the breaking change process. @filaps, I could write the design doc and help land the changes in the steps required. If you'd prefer to take ownership of some parts of the process, please let me know! |
|
IMO this does not require a design doc - just a migration guide and a flag so that we can soft migrate downstream users. |
|
I say this because I suspect this is a change most users want without knowing they want it, and the migration guide is to update your golden image testing :) |
Unfortunately, it seems like #47616 broke some internal tests. We will have to revert until we can figure out what caused the change.