Revert "Fix SnackBar clipping when it is floating due to FloatingActionButton positioning"#50516
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 |
|
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.