mirror of
https://github.com/flutter/samples.git
synced 2025-11-13 00:08:24 +00:00
initial gallery
This commit is contained in:
35
cupertino_gallery/lib/gallery_home.dart
Normal file
35
cupertino_gallery/lib/gallery_home.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'widgets_page.dart';
|
||||
|
||||
class GalleryHome extends StatelessWidget {
|
||||
const GalleryHome({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoTabScaffold(
|
||||
tabBar: CupertinoTabBar(
|
||||
items: const <BottomNavigationBarItem>[
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(CupertinoIcons.list_bullet),
|
||||
label: 'Widgets',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(CupertinoIcons.settings),
|
||||
label: 'Settings',
|
||||
),
|
||||
],
|
||||
),
|
||||
tabBuilder: (BuildContext context, int index) {
|
||||
return CupertinoTabView(
|
||||
builder: (BuildContext context) {
|
||||
return switch (index) {
|
||||
0 => const WidgetsPage(),
|
||||
1 => const Center(child: Text('Settings')),
|
||||
_ => const Center(child: Text('Widgets')),
|
||||
};
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user