Remove unused generic type from BottomSheet (#137791)
Fixes https://github.com/flutter/flutter/issues/137424. The generic type argument was unused.
This commit is contained in:
parent
6f5ca8542c
commit
8a0f9118ea
@ -1579,7 +1579,7 @@ class BottomSheetSection extends StatefulWidget {
|
||||
|
||||
class _BottomSheetSectionState extends State<BottomSheetSection> {
|
||||
bool isNonModalBottomSheetOpen = false;
|
||||
PersistentBottomSheetController<void>? _nonModalBottomSheetController;
|
||||
PersistentBottomSheetController? _nonModalBottomSheetController;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -1663,7 +1663,7 @@ class _BottomSheetSectionState extends State<BottomSheetSection> {
|
||||
});
|
||||
}
|
||||
|
||||
_nonModalBottomSheetController = showBottomSheet<void>(
|
||||
_nonModalBottomSheetController = showBottomSheet(
|
||||
elevation: 8.0,
|
||||
context: context,
|
||||
constraints: const BoxConstraints(maxWidth: 640),
|
||||
|
@ -265,7 +265,7 @@ class StockHomeState extends State<StockHome> {
|
||||
Navigator.pushNamed(context, '/stock', arguments: stock.symbol);
|
||||
},
|
||||
onShow: (Stock stock) {
|
||||
_scaffoldKey.currentState!.showBottomSheet<void>((BuildContext context) => StockSymbolBottomSheet(stock: stock));
|
||||
_scaffoldKey.currentState!.showBottomSheet((BuildContext context) => StockSymbolBottomSheet(stock: stock));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ class ListDemo extends StatefulWidget {
|
||||
class _ListDemoState extends State<ListDemo> {
|
||||
static final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
PersistentBottomSheetController<void>? _bottomSheet;
|
||||
PersistentBottomSheetController? _bottomSheet;
|
||||
_MaterialListType? _itemType = _MaterialListType.threeLine;
|
||||
bool? _dense = false;
|
||||
bool? _showAvatars = true;
|
||||
@ -51,7 +51,7 @@ class _ListDemoState extends State<ListDemo> {
|
||||
}
|
||||
|
||||
void _showConfigurationSheet() {
|
||||
final PersistentBottomSheetController<void> bottomSheet = scaffoldKey.currentState!.showBottomSheet<void>((BuildContext bottomSheetContext) {
|
||||
final PersistentBottomSheetController bottomSheet = scaffoldKey.currentState!.showBottomSheet((BuildContext bottomSheetContext) {
|
||||
return Container(
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(top: BorderSide(color: Colors.black26)),
|
||||
|
@ -30,7 +30,7 @@ class _PersistentBottomSheetDemoState extends State<PersistentBottomSheetDemo> {
|
||||
setState(() { // disable the button
|
||||
_showBottomSheetCallback = null;
|
||||
});
|
||||
_scaffoldKey.currentState!.showBottomSheet<void>((BuildContext context) {
|
||||
_scaffoldKey.currentState!.showBottomSheet((BuildContext context) {
|
||||
final ThemeData themeData = Theme.of(context);
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
|
@ -37,7 +37,7 @@ class _ListItem {
|
||||
class _ListDemoState extends State<ReorderableListDemo> {
|
||||
static final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
PersistentBottomSheetController<void>? _bottomSheet;
|
||||
PersistentBottomSheetController? _bottomSheet;
|
||||
_ReorderableListType? _itemType = _ReorderableListType.threeLine;
|
||||
bool? _reverse = false;
|
||||
bool _reverseSort = false;
|
||||
@ -71,7 +71,7 @@ class _ListDemoState extends State<ReorderableListDemo> {
|
||||
|
||||
void _showConfigurationSheet() {
|
||||
setState(() {
|
||||
_bottomSheet = scaffoldKey.currentState!.showBottomSheet<void>((BuildContext bottomSheetContext) {
|
||||
_bottomSheet = scaffoldKey.currentState!.showBottomSheet((BuildContext bottomSheetContext) {
|
||||
return DecoratedBox(
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(top: BorderSide(color: Colors.black26)),
|
||||
|
@ -71,7 +71,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStat
|
||||
}
|
||||
|
||||
void _showExplanatoryText() {
|
||||
_scaffoldKey.currentState!.showBottomSheet<void>((BuildContext context) {
|
||||
_scaffoldKey.currentState!.showBottomSheet((BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(top: BorderSide(color: Theme.of(context).dividerColor))
|
||||
|
@ -220,7 +220,7 @@ class RootPage extends StatelessWidget {
|
||||
return ElevatedButton(
|
||||
style: buttonStyle,
|
||||
onPressed: () {
|
||||
showBottomSheet<void>(
|
||||
showBottomSheet(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return Container(
|
||||
|
@ -36,7 +36,7 @@ class MyScaffoldBody extends StatelessWidget {
|
||||
child: ElevatedButton(
|
||||
child: const Text('SHOW BOTTOM SHEET'),
|
||||
onPressed: () {
|
||||
Scaffold.of(context).showBottomSheet<void>(
|
||||
Scaffold.of(context).showBottomSheet(
|
||||
(BuildContext context) {
|
||||
return Container(
|
||||
alignment: Alignment.center,
|
||||
|
@ -34,7 +34,7 @@ class OfExample extends StatelessWidget {
|
||||
child: ElevatedButton(
|
||||
child: const Text('SHOW BOTTOM SHEET'),
|
||||
onPressed: () {
|
||||
Scaffold.of(context).showBottomSheet<void>(
|
||||
Scaffold.of(context).showBottomSheet(
|
||||
(BuildContext context) {
|
||||
return Container(
|
||||
alignment: Alignment.center,
|
||||
|
@ -31,7 +31,7 @@ class ShowBottomSheetExample extends StatelessWidget {
|
||||
child: ElevatedButton(
|
||||
child: const Text('showBottomSheet'),
|
||||
onPressed: () {
|
||||
Scaffold.of(context).showBottomSheet<void>(
|
||||
Scaffold.of(context).showBottomSheet(
|
||||
(BuildContext context) {
|
||||
return Container(
|
||||
height: 200,
|
||||
|
@ -1324,7 +1324,7 @@ Future<T?> showModalBottomSheet<T>({
|
||||
/// * [Scaffold.of], for information about how to obtain the [BuildContext].
|
||||
/// * The Material 2 spec at <https://m2.material.io/components/sheets-bottom>.
|
||||
/// * The Material 3 spec at <https://m3.material.io/components/bottom-sheets/overview>.
|
||||
PersistentBottomSheetController<T> showBottomSheet<T>({
|
||||
PersistentBottomSheetController showBottomSheet({
|
||||
required BuildContext context,
|
||||
required WidgetBuilder builder,
|
||||
Color? backgroundColor,
|
||||
@ -1337,7 +1337,7 @@ PersistentBottomSheetController<T> showBottomSheet<T>({
|
||||
}) {
|
||||
assert(debugCheckHasScaffold(context));
|
||||
|
||||
return Scaffold.of(context).showBottomSheet<T>(
|
||||
return Scaffold.of(context).showBottomSheet(
|
||||
builder,
|
||||
backgroundColor: backgroundColor,
|
||||
elevation: elevation,
|
||||
|
@ -2121,7 +2121,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
|
||||
/// appropriate [IconButton], and handles the edge-swipe gesture, to show the
|
||||
/// drawer.
|
||||
///
|
||||
/// To close the drawer, use either [ScaffoldState.closeEndDrawer] or
|
||||
/// To close the drawer, use either [ScaffoldState.closeDrawer] or
|
||||
/// [Navigator.pop].
|
||||
///
|
||||
/// See [Scaffold.of] for information about how to obtain the [ScaffoldState].
|
||||
@ -2196,7 +2196,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
|
||||
// Important if the app/user takes an action that could repeatedly show a
|
||||
// bottom sheet.
|
||||
final List<_StandardBottomSheet> _dismissedBottomSheets = <_StandardBottomSheet>[];
|
||||
PersistentBottomSheetController<dynamic>? _currentBottomSheet;
|
||||
PersistentBottomSheetController? _currentBottomSheet;
|
||||
final GlobalKey _currentBottomSheetKey = GlobalKey();
|
||||
LocalHistoryEntry? _persistentSheetHistoryEntry;
|
||||
|
||||
@ -2234,7 +2234,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
|
||||
assert(_dismissedBottomSheets.isEmpty);
|
||||
}
|
||||
|
||||
_currentBottomSheet = _buildBottomSheet<void>(
|
||||
_currentBottomSheet = _buildBottomSheet(
|
||||
(BuildContext context) {
|
||||
return NotificationListener<DraggableScrollableNotification>(
|
||||
onNotification: persistentBottomSheetExtentChanged,
|
||||
@ -2290,7 +2290,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
|
||||
_currentBottomSheetKey.currentState!.setState(() {});
|
||||
}
|
||||
|
||||
PersistentBottomSheetController<T> _buildBottomSheet<T>(
|
||||
PersistentBottomSheetController _buildBottomSheet(
|
||||
WidgetBuilder builder, {
|
||||
required bool isPersistent,
|
||||
required AnimationController animationController,
|
||||
@ -2313,7 +2313,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
|
||||
return true;
|
||||
}());
|
||||
|
||||
final Completer<T> completer = Completer<T>();
|
||||
final Completer<void> completer = Completer<void>();
|
||||
final GlobalKey<_StandardBottomSheetState> bottomSheetKey = GlobalKey<_StandardBottomSheetState>();
|
||||
late _StandardBottomSheet bottomSheet;
|
||||
|
||||
@ -2351,10 +2351,6 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
|
||||
if (animationController.status != AnimationStatus.dismissed) {
|
||||
_dismissedBottomSheets.add(bottomSheet);
|
||||
}
|
||||
// TODO(srawlins): Ensure that this Completer has a nullable type (or more
|
||||
// likely, `void`).
|
||||
// https://github.com/flutter/flutter/issues/137294).
|
||||
// ignore: null_argument_to_non_null_type
|
||||
completer.complete();
|
||||
}
|
||||
|
||||
@ -2412,7 +2408,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
|
||||
ModalRoute.of(context)!.addLocalHistoryEntry(entry!);
|
||||
}
|
||||
|
||||
return PersistentBottomSheetController<T>._(
|
||||
return PersistentBottomSheetController._(
|
||||
bottomSheet,
|
||||
completer,
|
||||
entry != null
|
||||
@ -2471,7 +2467,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
|
||||
/// * [Scaffold.of], for information about how to obtain the [ScaffoldState].
|
||||
/// * The Material 2 spec at <https://m2.material.io/components/sheets-bottom>.
|
||||
/// * The Material 3 spec at <https://m3.material.io/components/bottom-sheets/overview>.
|
||||
PersistentBottomSheetController<T> showBottomSheet<T>(
|
||||
PersistentBottomSheetController showBottomSheet(
|
||||
WidgetBuilder builder, {
|
||||
Color? backgroundColor,
|
||||
double? elevation,
|
||||
@ -2496,7 +2492,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
|
||||
_closeCurrentBottomSheet();
|
||||
final AnimationController controller = (transitionAnimationController ?? BottomSheet.createAnimationController(this))..forward();
|
||||
setState(() {
|
||||
_currentBottomSheet = _buildBottomSheet<T>(
|
||||
_currentBottomSheet = _buildBottomSheet(
|
||||
builder,
|
||||
isPersistent: false,
|
||||
animationController: controller,
|
||||
@ -2509,7 +2505,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
|
||||
shouldDisposeAnimationController: transitionAnimationController == null,
|
||||
);
|
||||
});
|
||||
return _currentBottomSheet! as PersistentBottomSheetController<T>;
|
||||
return _currentBottomSheet!;
|
||||
}
|
||||
|
||||
// Floating Action Button API
|
||||
@ -3274,7 +3270,7 @@ class _StandardBottomSheetState extends State<_StandardBottomSheet> {
|
||||
/// This controller is used to display both standard and persistent bottom
|
||||
/// sheets. A bottom sheet is only persistent if it is set as the
|
||||
/// [Scaffold.bottomSheet].
|
||||
class PersistentBottomSheetController<T> extends ScaffoldFeatureController<_StandardBottomSheet, T> {
|
||||
class PersistentBottomSheetController extends ScaffoldFeatureController<_StandardBottomSheet, void> {
|
||||
const PersistentBottomSheetController._(
|
||||
super.widget,
|
||||
super.completer,
|
||||
|
@ -2178,7 +2178,7 @@ typedef ConditionalElementVisitor = bool Function(Element element);
|
||||
/// return TextButton(
|
||||
/// child: const Text('BUTTON'),
|
||||
/// onPressed: () {
|
||||
/// Scaffold.of(context).showBottomSheet<void>(
|
||||
/// Scaffold.of(context).showBottomSheet(
|
||||
/// (BuildContext context) {
|
||||
/// return Container(
|
||||
/// alignment: Alignment.center,
|
||||
|
@ -106,7 +106,7 @@ void main() {
|
||||
expect(showBottomSheetThenCalled, isFalse);
|
||||
expect(find.text('BottomSheet'), findsNothing);
|
||||
|
||||
scaffoldKey.currentState!.showBottomSheet<void>((BuildContext context) {
|
||||
scaffoldKey.currentState!.showBottomSheet((BuildContext context) {
|
||||
return const SizedBox(
|
||||
height: 200.0,
|
||||
child: Text('BottomSheet'),
|
||||
@ -141,7 +141,7 @@ void main() {
|
||||
expect(showBottomSheetThenCalled, isFalse);
|
||||
expect(find.text('BottomSheet'), findsNothing);
|
||||
|
||||
scaffoldKey.currentState!.showBottomSheet<void>((BuildContext context) {
|
||||
scaffoldKey.currentState!.showBottomSheet((BuildContext context) {
|
||||
return const SizedBox(
|
||||
height: 200.0,
|
||||
child: Text('BottomSheet'),
|
||||
@ -178,7 +178,7 @@ void main() {
|
||||
expect(showBottomSheetThenCalled, isFalse);
|
||||
expect(find.text('BottomSheet'), findsNothing);
|
||||
|
||||
scaffoldKey.currentState!.showBottomSheet<void>((BuildContext context) {
|
||||
scaffoldKey.currentState!.showBottomSheet((BuildContext context) {
|
||||
return const SizedBox(
|
||||
height: 200.0,
|
||||
child: Text('BottomSheet'),
|
||||
@ -216,7 +216,7 @@ void main() {
|
||||
expect(buildCount, 0);
|
||||
expect(find.text('BottomSheet'), findsNothing);
|
||||
|
||||
scaffoldKey.currentState!.showBottomSheet<void>((BuildContext context) {
|
||||
scaffoldKey.currentState!.showBottomSheet((BuildContext context) {
|
||||
buildCount++;
|
||||
return const SizedBox(
|
||||
height: 200.0,
|
||||
@ -618,7 +618,7 @@ void main() {
|
||||
expect(showBottomSheetThenCalled, isFalse);
|
||||
expect(find.text('BottomSheet'), findsNothing);
|
||||
|
||||
scaffoldKey.currentState!.showBottomSheet<void>((BuildContext context) {
|
||||
scaffoldKey.currentState!.showBottomSheet((BuildContext context) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.all(40.0),
|
||||
child: const Text('BottomSheet'),
|
||||
@ -672,7 +672,7 @@ void main() {
|
||||
),
|
||||
));
|
||||
|
||||
scaffoldKey.currentState!.showBottomSheet<void>((BuildContext context) {
|
||||
scaffoldKey.currentState!.showBottomSheet((BuildContext context) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.all(40.0),
|
||||
child: const Text('BottomSheet'),
|
||||
@ -1482,7 +1482,7 @@ void main() {
|
||||
return GestureDetector(
|
||||
key: tapTarget,
|
||||
onTap: () {
|
||||
showBottomSheet<void>(
|
||||
showBottomSheet(
|
||||
context: context,
|
||||
// The default duration and reverseDuration is 1 second
|
||||
transitionAnimationController: controller,
|
||||
@ -1539,7 +1539,7 @@ void main() {
|
||||
),
|
||||
));
|
||||
|
||||
scaffoldKey.currentState!.showBottomSheet<void>((_) {
|
||||
scaffoldKey.currentState!.showBottomSheet((_) {
|
||||
return Builder(
|
||||
builder: (BuildContext context) {
|
||||
return Container(height: 200.0);
|
||||
@ -1553,7 +1553,7 @@ void main() {
|
||||
// The first sheet's animation is still running.
|
||||
|
||||
// Trigger the second sheet will remove the first sheet from tree.
|
||||
scaffoldKey.currentState!.showBottomSheet<void>((_) {
|
||||
scaffoldKey.currentState!.showBottomSheet((_) {
|
||||
return Builder(
|
||||
builder: (BuildContext context) {
|
||||
return Container(height: 200.0);
|
||||
@ -1575,7 +1575,7 @@ void main() {
|
||||
// Regression test for https://github.com/flutter/flutter/issues/99627
|
||||
testWidgetsWithLeakTracking('The old route entry should be removed when a new sheet popup', (WidgetTester tester) async {
|
||||
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey();
|
||||
PersistentBottomSheetController<void>? sheetController;
|
||||
PersistentBottomSheetController? sheetController;
|
||||
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Scaffold(
|
||||
@ -1587,7 +1587,7 @@ void main() {
|
||||
final ModalRoute<dynamic> route = ModalRoute.of(scaffoldKey.currentContext!)!;
|
||||
expect(route.canPop, false);
|
||||
|
||||
scaffoldKey.currentState!.showBottomSheet<void>((_) {
|
||||
scaffoldKey.currentState!.showBottomSheet((_) {
|
||||
return Builder(
|
||||
builder: (BuildContext context) {
|
||||
return Container(height: 200.0);
|
||||
@ -1600,7 +1600,7 @@ void main() {
|
||||
expect(route.canPop, true);
|
||||
|
||||
// Trigger the second sheet will remove the first sheet from tree.
|
||||
sheetController = scaffoldKey.currentState!.showBottomSheet<void>((_) {
|
||||
sheetController = scaffoldKey.currentState!.showBottomSheet((_) {
|
||||
return Builder(
|
||||
builder: (BuildContext context) {
|
||||
return Container(height: 200.0);
|
||||
@ -1632,7 +1632,7 @@ void main() {
|
||||
return GestureDetector(
|
||||
key: tapTarget,
|
||||
onTap: () {
|
||||
showBottomSheet<void>(
|
||||
showBottomSheet(
|
||||
context: context,
|
||||
transitionAnimationController: controller,
|
||||
builder: (BuildContext context) {
|
||||
@ -1675,7 +1675,7 @@ void main() {
|
||||
|
||||
testWidgetsWithLeakTracking('Calling PersistentBottomSheetController.close does not crash when it is not the current bottom sheet', (WidgetTester tester) async {
|
||||
// Regression test for https://github.com/flutter/flutter/issues/93717
|
||||
PersistentBottomSheetController<void>? sheetController1;
|
||||
PersistentBottomSheetController? sheetController1;
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Scaffold(
|
||||
body: Builder(builder: (BuildContext context) {
|
||||
@ -1685,7 +1685,7 @@ void main() {
|
||||
ElevatedButton(
|
||||
child: const Text('show 1'),
|
||||
onPressed: () {
|
||||
sheetController1 = Scaffold.of(context).showBottomSheet<void>(
|
||||
sheetController1 = Scaffold.of(context).showBottomSheet(
|
||||
(BuildContext context) => const Text('BottomSheet 1'),
|
||||
);
|
||||
},
|
||||
@ -1693,7 +1693,7 @@ void main() {
|
||||
ElevatedButton(
|
||||
child: const Text('show 2'),
|
||||
onPressed: () {
|
||||
Scaffold.of(context).showBottomSheet<void>(
|
||||
Scaffold.of(context).showBottomSheet(
|
||||
(BuildContext context) => const Text('BottomSheet 2'),
|
||||
);
|
||||
},
|
||||
@ -1914,7 +1914,7 @@ void main() {
|
||||
child: ElevatedButton(
|
||||
child: const Text('Press me'),
|
||||
onPressed: () {
|
||||
Scaffold.of(context).showBottomSheet<void>(
|
||||
Scaffold.of(context).showBottomSheet(
|
||||
(BuildContext context) => const Text('BottomSheet'),
|
||||
);
|
||||
},
|
||||
@ -2033,7 +2033,7 @@ void main() {
|
||||
child: ElevatedButton(
|
||||
child: const Text('Press me'),
|
||||
onPressed: () {
|
||||
Scaffold.of(context).showBottomSheet<void>(
|
||||
Scaffold.of(context).showBottomSheet(
|
||||
(BuildContext context) => const Text('BottomSheet'),
|
||||
);
|
||||
},
|
||||
@ -2102,7 +2102,7 @@ void main() {
|
||||
child: ElevatedButton(
|
||||
child: const Text('Press me'),
|
||||
onPressed: () {
|
||||
Scaffold.of(context).showBottomSheet<void>(
|
||||
Scaffold.of(context).showBottomSheet(
|
||||
(BuildContext context) => const Text('BottomSheet'),
|
||||
constraints: const BoxConstraints(maxWidth: sheetMaxWidth),
|
||||
);
|
||||
|
@ -397,7 +397,7 @@ Widget bottomSheetWithElevations(BottomSheetThemeData bottomSheetTheme, {bool us
|
||||
RawMaterialButton(
|
||||
child: const Text('Show Persistent'),
|
||||
onPressed: () {
|
||||
showBottomSheet<void>(
|
||||
showBottomSheet(
|
||||
context: context,
|
||||
builder: (BuildContext _) {
|
||||
return const Text(
|
||||
|
@ -97,7 +97,7 @@ void main() {
|
||||
),
|
||||
home: Builder(
|
||||
builder: (BuildContext context) {
|
||||
showBottomSheet<void>(
|
||||
showBottomSheet(
|
||||
context: context,
|
||||
builder: (BuildContext context) => Container(),
|
||||
);
|
||||
|
@ -107,7 +107,7 @@ void main() {
|
||||
),
|
||||
));
|
||||
|
||||
final PersistentBottomSheetController<void> bottomSheet = scaffoldKey.currentState!.showBottomSheet<void>((_) {
|
||||
final PersistentBottomSheetController bottomSheet = scaffoldKey.currentState!.showBottomSheet((_) {
|
||||
return Builder(
|
||||
builder: (BuildContext context) {
|
||||
buildCount += 1;
|
||||
@ -164,7 +164,7 @@ void main() {
|
||||
),
|
||||
));
|
||||
|
||||
scaffoldKey.currentState!.showBottomSheet<void>((BuildContext context) {
|
||||
scaffoldKey.currentState!.showBottomSheet((BuildContext context) {
|
||||
return ListView(
|
||||
shrinkWrap: true,
|
||||
primary: false,
|
||||
@ -196,7 +196,7 @@ void main() {
|
||||
),
|
||||
));
|
||||
|
||||
scaffoldKey.currentState!.showBottomSheet<void>((BuildContext context) {
|
||||
scaffoldKey.currentState!.showBottomSheet((BuildContext context) {
|
||||
return DraggableScrollableSheet(
|
||||
expand: false,
|
||||
shouldCloseOnMinExtent: false,
|
||||
@ -234,7 +234,7 @@ void main() {
|
||||
),
|
||||
));
|
||||
|
||||
scaffoldKey.currentState!.showBottomSheet<void>((BuildContext context) {
|
||||
scaffoldKey.currentState!.showBottomSheet((BuildContext context) {
|
||||
return ListView(
|
||||
shrinkWrap: true,
|
||||
primary: false,
|
||||
@ -269,7 +269,7 @@ void main() {
|
||||
),
|
||||
));
|
||||
|
||||
scaffoldKey.currentState!.showBottomSheet<void>(
|
||||
scaffoldKey.currentState!.showBottomSheet(
|
||||
(BuildContext context) {
|
||||
return DraggableScrollableSheet(
|
||||
expand: false,
|
||||
@ -423,7 +423,7 @@ void main() {
|
||||
),
|
||||
));
|
||||
|
||||
scaffoldKey.currentState!.showBottomSheet<void>(
|
||||
scaffoldKey.currentState!.showBottomSheet(
|
||||
(BuildContext context) {
|
||||
return DraggableScrollableSheet(
|
||||
expand: false,
|
||||
@ -472,7 +472,7 @@ void main() {
|
||||
));
|
||||
|
||||
int buildCount = 0;
|
||||
showBottomSheet<void>(
|
||||
showBottomSheet(
|
||||
context: key.currentContext!,
|
||||
builder: (BuildContext context) {
|
||||
return Builder(
|
||||
@ -510,7 +510,7 @@ void main() {
|
||||
|
||||
await tester.pump();
|
||||
|
||||
showBottomSheet<void>(
|
||||
showBottomSheet(
|
||||
context: scaffoldContext,
|
||||
builder: (BuildContext context) {
|
||||
bottomSheetContext = context;
|
||||
@ -627,7 +627,7 @@ void main() {
|
||||
),
|
||||
));
|
||||
|
||||
scaffoldKey.currentState!.showBottomSheet<void>((BuildContext context) {
|
||||
scaffoldKey.currentState!.showBottomSheet((BuildContext context) {
|
||||
return ListView(
|
||||
shrinkWrap: true,
|
||||
primary: false,
|
||||
@ -657,7 +657,7 @@ void main() {
|
||||
),
|
||||
));
|
||||
|
||||
final PersistentBottomSheetController<void> bottomSheet = scaffoldKey.currentState!.showBottomSheet<void>((_) {
|
||||
final PersistentBottomSheetController bottomSheet = scaffoldKey.currentState!.showBottomSheet((_) {
|
||||
return Builder(
|
||||
builder: (BuildContext context) {
|
||||
return Container(height: 200.0);
|
||||
|
@ -596,7 +596,7 @@ void main() {
|
||||
builder: (BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Scaffold.of(context).showBottomSheet<void>((BuildContext context) {
|
||||
Scaffold.of(context).showBottomSheet((BuildContext context) {
|
||||
return Container(
|
||||
key: sheetKey,
|
||||
color: Colors.blue[500],
|
||||
@ -2173,7 +2173,7 @@ void main() {
|
||||
);
|
||||
late FlutterError error;
|
||||
try {
|
||||
key.currentState!.showBottomSheet<void>((BuildContext context) {
|
||||
key.currentState!.showBottomSheet((BuildContext context) {
|
||||
final ThemeData themeData = Theme.of(context);
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
@ -2234,7 +2234,7 @@ void main() {
|
||||
),
|
||||
),
|
||||
);
|
||||
key.currentState!.showBottomSheet<void>((_) => Container());
|
||||
key.currentState!.showBottomSheet((_) => Container());
|
||||
await tester.tap(find.byKey(buttonKey));
|
||||
await tester.pump();
|
||||
expect(errors, isNotEmpty);
|
||||
@ -2266,7 +2266,7 @@ void main() {
|
||||
MaterialApp(
|
||||
home: Builder(
|
||||
builder: (BuildContext context) {
|
||||
Scaffold.of(context).showBottomSheet<void>((BuildContext context) {
|
||||
Scaffold.of(context).showBottomSheet((BuildContext context) {
|
||||
return Container();
|
||||
});
|
||||
return Container();
|
||||
@ -2766,7 +2766,7 @@ void main() {
|
||||
final DraggableScrollableController draggableController = DraggableScrollableController();
|
||||
addTearDown(draggableController.dispose);
|
||||
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey();
|
||||
PersistentBottomSheetController<void>? sheetController;
|
||||
PersistentBottomSheetController? sheetController;
|
||||
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Scaffold(
|
||||
@ -2775,7 +2775,7 @@ void main() {
|
||||
),
|
||||
));
|
||||
|
||||
sheetController = scaffoldKey.currentState!.showBottomSheet<void>((_) {
|
||||
sheetController = scaffoldKey.currentState!.showBottomSheet((_) {
|
||||
return DraggableScrollableSheet(
|
||||
expand: false,
|
||||
controller: draggableController,
|
||||
@ -2811,7 +2811,7 @@ void main() {
|
||||
|
||||
testWidgetsWithLeakTracking("Closing bottom sheet & removing FAB at the same time doesn't throw assertion", (WidgetTester tester) async {
|
||||
final Key bottomSheetKey = UniqueKey();
|
||||
PersistentBottomSheetController<void>? controller;
|
||||
PersistentBottomSheetController? controller;
|
||||
bool show = true;
|
||||
|
||||
await tester.pumpWidget(StatefulBuilder(
|
||||
|
@ -28,7 +28,7 @@ class PersistentBottomSheetTestState extends State<PersistentBottomSheetTest> {
|
||||
bool setStateCalled = false;
|
||||
|
||||
void showBottomSheet() {
|
||||
_scaffoldKey.currentState!.showBottomSheet<void>((BuildContext context) {
|
||||
_scaffoldKey.currentState!.showBottomSheet((BuildContext context) {
|
||||
return const Text('bottomSheet');
|
||||
})
|
||||
.closed.whenComplete(() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user