1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-10 14:58:34 +00:00
Files
samples/cupertino_gallery/lib/widgets/popup_surface_page.dart
Eric Windmill d6138c9ab8 initial gallery
2025-08-06 11:50:45 -04:00

37 lines
1010 B
Dart

import 'package:flutter/cupertino.dart';
class PopupSurfacePage extends StatelessWidget {
const PopupSurfacePage({super.key});
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: Text('Popup Surface'),
),
child: Center(
child: CupertinoButton(
child: const Text('Show Popup Surface'),
onPressed: () {
showCupertinoModalPopup<void>(
context: context,
builder: (BuildContext context) {
return CupertinoPopupSurface(
child: Container(
color: CupertinoColors.white,
width: 200,
height: 200,
child: const Center(
child: Text('This is a popup surface.'),
),
),
);
},
);
},
),
),
);
}
}