Some checks failed
Main Branch CI / Test Flutter beta on ubuntu-latest (push) Has been skipped
Main Branch CI / Test Flutter stable on ubuntu-latest (push) Has been skipped
Main Branch CI / Test Flutter beta on macos-latest (push) Has been cancelled
Main Branch CI / Test Flutter stable on macos-latest (push) Has been cancelled
37 lines
997 B
Dart
37 lines
997 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: (context) {
|
|
return CupertinoPopupSurface(
|
|
child: Container(
|
|
color: CupertinoColors.white,
|
|
width: 200,
|
|
height: 200,
|
|
child: const Center(
|
|
child: Text('This is a popup surface.'),
|
|
),
|
|
),
|
|
);
|
|
},
|
|
);
|
|
},
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|