mirror of
https://github.com/flutter/samples.git
synced 2026-07-09 10:31:48 +00:00
Cupertino gallery app (#2715)
Resolves #2519 Part of the larger effort to bring the samples/repo into a stable and maintainable condition that _also_ remains useful. See: #2409 ## Pre-launch Checklist - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I read the [Contributors Guide]. - [x] I have added sample code updates to the [changelog]. - [x] I updated/added relevant documentation (doc comments with `///`).
This commit is contained in:
75
cupertino_gallery/lib/widgets_page.dart
Normal file
75
cupertino_gallery/lib/widgets_page.dart
Normal file
@@ -0,0 +1,75 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'widget_detail_page.dart';
|
||||
|
||||
class WidgetsPage extends StatelessWidget {
|
||||
const WidgetsPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
child: CustomScrollView(
|
||||
slivers: <Widget>[
|
||||
CupertinoSliverNavigationBar(largeTitle: Text('Cupertino Gallery')),
|
||||
SliverFillRemaining(
|
||||
child: ListView(
|
||||
children: [
|
||||
CustomCupertinoListTile(title: 'Action Sheet'),
|
||||
CustomCupertinoListTile(title: 'Activity Indicator'),
|
||||
CustomCupertinoListTile(title: 'Alert Dialog'),
|
||||
CustomCupertinoListTile(title: 'Button'),
|
||||
CustomCupertinoListTile(title: 'Checkbox'),
|
||||
CustomCupertinoListTile(title: 'Context Menu'),
|
||||
CustomCupertinoListTile(title: 'Date Picker'),
|
||||
CustomCupertinoListTile(title: 'List Tile'),
|
||||
CustomCupertinoListTile(title: 'Picker'),
|
||||
CustomCupertinoListTile(title: 'Popup Surface'),
|
||||
CustomCupertinoListTile(title: 'Radio'),
|
||||
CustomCupertinoListTile(title: 'Scrollbar'),
|
||||
CustomCupertinoListTile(title: 'Search Text Field'),
|
||||
CustomCupertinoListTile(title: 'Segmented Control'),
|
||||
CustomCupertinoListTile(title: 'Sheet'),
|
||||
CustomCupertinoListTile(title: 'Slider'),
|
||||
CustomCupertinoListTile(title: 'Sliding Segmented Control'),
|
||||
CustomCupertinoListTile(title: 'Switch'),
|
||||
CustomCupertinoListTile(title: 'Text Field'),
|
||||
CustomCupertinoListTile(title: 'Text Theme'),
|
||||
CustomCupertinoListTile(title: 'Time Picker'),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CustomCupertinoListTile extends StatelessWidget {
|
||||
const CustomCupertinoListTile({super.key, required this.title});
|
||||
|
||||
final String title;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
CupertinoPageRoute<void>(
|
||||
builder: (BuildContext context) {
|
||||
return WidgetDetailPage(title: title);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(bottom: BorderSide(color: CupertinoColors.separator)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[Text(title), const Icon(CupertinoIcons.forward)],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user