Unverified Commit 80f88a79 authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

Remove deprecated Scaffold.resizeToAvoidBottomPadding (#72890)

parent ca372891
......@@ -11,6 +11,29 @@
version: 1
transforms:
# Changes made in https://github.com/flutter/flutter/pull/26259
- title: 'Rename to resizeToAvoidBottomInset'
date: 2020-12-23
element:
uris: [ 'material.dart' ]
field: 'resizeToAvoidBottomPadding'
inClass: 'Scaffold'
changes:
- kind: 'rename'
newName: 'resizeToAvoidBottomInset'
# Changes made in https://github.com/flutter/flutter/pull/26259
- title: 'Rename to resizeToAvoidBottomInset'
date: 2020-12-23
element:
uris: [ 'material.dart' ]
constructor: ''
inClass: 'Scaffold'
changes:
- kind: 'renameParameter'
oldName: 'resizeToAvoidBottomPadding'
newName: 'resizeToAvoidBottomInset'
# Change made in https://github.com/flutter/flutter/pull/20649
# TODO(Piinks): Add tests when `bulkApply:false` testing is supported, https://github.com/dart-lang/sdk/issues/44639
- title: 'Replace with CupertinoPopupSurface'
......
......@@ -1449,7 +1449,6 @@ class Scaffold extends StatefulWidget {
this.bottomNavigationBar,
this.bottomSheet,
this.backgroundColor,
this.resizeToAvoidBottomPadding,
this.resizeToAvoidBottomInset,
this.primary = true,
this.drawerDragStartBehavior = DragStartBehavior.start,
......@@ -1726,18 +1725,6 @@ class Scaffold extends StatefulWidget {
/// * [showModalBottomSheet], which displays a modal bottom sheet.
final Widget? bottomSheet;
/// This flag is deprecated, please use [resizeToAvoidBottomInset]
/// instead.
///
/// Originally the name referred [MediaQueryData.padding]. Now it refers
/// [MediaQueryData.viewInsets], so using [resizeToAvoidBottomInset]
/// should be clearer to readers.
@Deprecated(
'Use resizeToAvoidBottomInset to specify if the body should resize when the keyboard appears. '
'This feature was deprecated after v1.1.9.'
)
final bool? resizeToAvoidBottomPadding;
/// If true the [body] and the scaffold's floating widgets should size
/// themselves to avoid the onscreen keyboard whose height is defined by the
/// ambient [MediaQuery]'s [MediaQueryData.viewInsets] `bottom` property.
......@@ -2730,9 +2717,8 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
late _ScaffoldGeometryNotifier _geometryNotifier;
// Backwards compatibility for deprecated resizeToAvoidBottomPadding property
bool get _resizeToAvoidBottomInset {
return widget.resizeToAvoidBottomInset ?? widget.resizeToAvoidBottomPadding ?? true;
return widget.resizeToAvoidBottomInset ?? true;
}
@override
......
......@@ -385,7 +385,7 @@ void main() {
padding: EdgeInsets.all(50.0),
),
child: Scaffold(
resizeToAvoidBottomPadding: false,
resizeToAvoidBottomInset: false,
body: Builder(
builder: (BuildContext context) {
scaffoldContext = context;
......
......@@ -103,19 +103,6 @@ void main() {
bodyBox = tester.renderObject(find.byKey(bodyKey));
expect(bodyBox.size, equals(const Size(800.0, 544.0)));
// Backwards compatibility: deprecated resizeToAvoidBottomPadding flag
await tester.pumpWidget(boilerplate(MediaQuery(
data: const MediaQueryData(viewInsets: EdgeInsets.only(bottom: 100.0)),
child: Scaffold(
appBar: AppBar(title: const Text('Title')),
body: Container(key: bodyKey),
resizeToAvoidBottomPadding: false,
),
)));
bodyBox = tester.renderObject(find.byKey(bodyKey));
expect(bodyBox.size, equals(const Size(800.0, 544.0)));
});
testWidgets('Scaffold large bottom padding test', (WidgetTester tester) async {
......
......@@ -5,6 +5,11 @@
import 'package:flutter/material.dart';
void main() {
// Changes made in https://github.com/flutter/flutter/pull/26259
const Scaffold scaffold = Scaffold(resizeToAvoidBottomPadding: true);
final bool resize = scaffold.resizeToAvoidBottomPadding;
// Change made in https://github.com/flutter/flutter/pull/15303
showDialog(child: Text('Fix me.'));
......
......@@ -5,6 +5,11 @@
import 'package:flutter/material.dart';
void main() {
// Changes made in https://github.com/flutter/flutter/pull/26259
const Scaffold scaffold = Scaffold(resizeToAvoidBottomInset: true);
final bool resize = scaffold.resizeToAvoidBottomInset;
// Change made in https://github.com/flutter/flutter/pull/15303
showDialog(builder: (context) => Text('Fix me.'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment