mirror of https://github.com/flutter/samples.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
985 B
37 lines
985 B
import 'package:flutter/cupertino.dart';
|
|
import 'settings_page.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 SettingsPage(),
|
|
_ => const Center(child: Text('Widgets')),
|
|
};
|
|
},
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|