mirror of
https://github.com/flutter/samples.git
synced 2026-05-31 19:39:15 +00:00
Remove code_sharing and place_tracker, cleanup repo (#2831)
Fixes #2818, #2523, #2528
This commit is contained in:
@@ -37,11 +37,11 @@ class GalleryHome extends StatelessWidget {
|
||||
return switch (index) {
|
||||
0 => const WidgetsPage(),
|
||||
1 => SettingsPage(
|
||||
onThemeChange: onThemeChange,
|
||||
isDarkMode: isDarkMode,
|
||||
onTextSizeChange: onTextSizeChange,
|
||||
textSize: textSize,
|
||||
),
|
||||
onThemeChange: onThemeChange,
|
||||
isDarkMode: isDarkMode,
|
||||
onTextSizeChange: onTextSizeChange,
|
||||
textSize: textSize,
|
||||
),
|
||||
_ => const Center(child: Text('Widgets')),
|
||||
};
|
||||
},
|
||||
|
||||
@@ -37,24 +37,31 @@ class _CupertinoGalleryAppState extends State<CupertinoGalleryApp> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final baseTheme = CupertinoThemeData(
|
||||
brightness:
|
||||
_themeMode == ThemeMode.dark ? Brightness.dark : Brightness.light,
|
||||
brightness: _themeMode == ThemeMode.dark
|
||||
? Brightness.dark
|
||||
: Brightness.light,
|
||||
);
|
||||
final textTheme = baseTheme.textTheme.copyWith(
|
||||
textStyle:
|
||||
baseTheme.textTheme.textStyle.copyWith(fontSize: 14 * _textSize),
|
||||
actionTextStyle: baseTheme.textTheme.actionTextStyle
|
||||
.copyWith(fontSize: 14 * _textSize),
|
||||
tabLabelTextStyle: baseTheme.textTheme.tabLabelTextStyle
|
||||
.copyWith(fontSize: 10 * _textSize),
|
||||
navTitleTextStyle: baseTheme.textTheme.navTitleTextStyle
|
||||
.copyWith(fontSize: 17 * _textSize),
|
||||
textStyle: baseTheme.textTheme.textStyle.copyWith(
|
||||
fontSize: 14 * _textSize,
|
||||
),
|
||||
actionTextStyle: baseTheme.textTheme.actionTextStyle.copyWith(
|
||||
fontSize: 14 * _textSize,
|
||||
),
|
||||
tabLabelTextStyle: baseTheme.textTheme.tabLabelTextStyle.copyWith(
|
||||
fontSize: 10 * _textSize,
|
||||
),
|
||||
navTitleTextStyle: baseTheme.textTheme.navTitleTextStyle.copyWith(
|
||||
fontSize: 17 * _textSize,
|
||||
),
|
||||
navLargeTitleTextStyle: baseTheme.textTheme.navLargeTitleTextStyle
|
||||
.copyWith(fontSize: 34 * _textSize),
|
||||
navActionTextStyle: baseTheme.textTheme.navActionTextStyle
|
||||
.copyWith(fontSize: 17 * _textSize),
|
||||
pickerTextStyle: baseTheme.textTheme.pickerTextStyle
|
||||
.copyWith(fontSize: 21 * _textSize),
|
||||
navActionTextStyle: baseTheme.textTheme.navActionTextStyle.copyWith(
|
||||
fontSize: 17 * _textSize,
|
||||
),
|
||||
pickerTextStyle: baseTheme.textTheme.pickerTextStyle.copyWith(
|
||||
fontSize: 21 * _textSize,
|
||||
),
|
||||
dateTimePickerTextStyle: baseTheme.textTheme.dateTimePickerTextStyle
|
||||
.copyWith(fontSize: 21 * _textSize),
|
||||
);
|
||||
|
||||
@@ -140,4 +140,3 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,7 @@ class ActionSheetPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
middle: Text('Action Sheet'),
|
||||
),
|
||||
navigationBar: const CupertinoNavigationBar(middle: Text('Action Sheet')),
|
||||
child: Center(
|
||||
child: CupertinoButton(
|
||||
child: const Text('Show Action Sheet'),
|
||||
@@ -30,7 +28,7 @@ class ActionSheetPage extends StatelessWidget {
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
)
|
||||
),
|
||||
],
|
||||
cancelButton: CupertinoActionSheetAction(
|
||||
isDefaultAction: true,
|
||||
|
||||
@@ -6,12 +6,8 @@ class ActivityIndicatorPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: Text('Activity Indicator'),
|
||||
),
|
||||
child: Center(
|
||||
child: CupertinoActivityIndicator(),
|
||||
),
|
||||
navigationBar: CupertinoNavigationBar(middle: Text('Activity Indicator')),
|
||||
child: Center(child: CupertinoActivityIndicator()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,9 +13,7 @@ class _CheckboxPageState extends State<CheckboxPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
middle: Text('Checkbox'),
|
||||
),
|
||||
navigationBar: const CupertinoNavigationBar(middle: Text('Checkbox')),
|
||||
child: Center(
|
||||
child: CupertinoCheckbox(
|
||||
value: _value,
|
||||
|
||||
@@ -6,15 +6,11 @@ class DatePickerPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
middle: Text('Date Picker'),
|
||||
),
|
||||
navigationBar: const CupertinoNavigationBar(middle: Text('Date Picker')),
|
||||
child: Center(
|
||||
child: SizedBox(
|
||||
height: 200,
|
||||
child: CupertinoDatePicker(
|
||||
onDateTimeChanged: (DateTime newDate) {},
|
||||
),
|
||||
child: CupertinoDatePicker(onDateTimeChanged: (DateTime newDate) {}),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -6,20 +6,14 @@ class PickerPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
middle: Text('Picker'),
|
||||
),
|
||||
navigationBar: const CupertinoNavigationBar(middle: Text('Picker')),
|
||||
child: Center(
|
||||
child: SizedBox(
|
||||
height: 200,
|
||||
child: CupertinoPicker(
|
||||
itemExtent: 32,
|
||||
onSelectedItemChanged: (int index) {},
|
||||
children: const <Widget>[
|
||||
Text('One'),
|
||||
Text('Two'),
|
||||
Text('Three'),
|
||||
],
|
||||
children: const <Widget>[Text('One'), Text('Two'), Text('Three')],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -6,9 +6,7 @@ class SearchTextFieldPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: Text('Search Text Field'),
|
||||
),
|
||||
navigationBar: CupertinoNavigationBar(middle: Text('Search Text Field')),
|
||||
child: Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
|
||||
@@ -13,9 +13,7 @@ class _SliderPageState extends State<SliderPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
middle: Text('Slider'),
|
||||
),
|
||||
navigationBar: const CupertinoNavigationBar(middle: Text('Slider')),
|
||||
child: Center(
|
||||
child: CupertinoSlider(
|
||||
value: _value,
|
||||
|
||||
@@ -13,9 +13,7 @@ class _SwitchPageState extends State<SwitchPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
middle: Text('Switch'),
|
||||
),
|
||||
navigationBar: const CupertinoNavigationBar(middle: Text('Switch')),
|
||||
child: Center(
|
||||
child: CupertinoSwitch(
|
||||
value: _value,
|
||||
|
||||
@@ -6,15 +6,11 @@ class TextFieldPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: Text('Text Field'),
|
||||
),
|
||||
navigationBar: CupertinoNavigationBar(middle: Text('Text Field')),
|
||||
child: Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
child: CupertinoTextField(
|
||||
placeholder: 'Enter text',
|
||||
),
|
||||
child: CupertinoTextField(placeholder: 'Enter text'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -6,9 +6,7 @@ class TextThemePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
middle: Text('Text Theme'),
|
||||
),
|
||||
navigationBar: const CupertinoNavigationBar(middle: Text('Text Theme')),
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@@ -35,9 +33,9 @@ class TextThemePage extends StatelessWidget {
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
'This is the nav large title text style',
|
||||
style: CupertinoTheme.of(context)
|
||||
.textTheme
|
||||
.navLargeTitleTextStyle,
|
||||
style: CupertinoTheme.of(
|
||||
context,
|
||||
).textTheme.navLargeTitleTextStyle,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
@@ -47,8 +45,9 @@ class TextThemePage extends StatelessWidget {
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
'This is the date time picker text style',
|
||||
style:
|
||||
CupertinoTheme.of(context).textTheme.dateTimePickerTextStyle,
|
||||
style: CupertinoTheme.of(
|
||||
context,
|
||||
).textTheme.dateTimePickerTextStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -6,9 +6,7 @@ class TimePickerPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
middle: Text('Time Picker'),
|
||||
),
|
||||
navigationBar: const CupertinoNavigationBar(middle: Text('Time Picker')),
|
||||
child: Center(
|
||||
child: SizedBox(
|
||||
height: 200,
|
||||
|
||||
@@ -2,6 +2,7 @@ name: cupertino_gallery
|
||||
description: A Flutter project showcasing supported Cupertino components.
|
||||
publish_to: "none"
|
||||
version: 1.0.0+1
|
||||
resolution: workspace
|
||||
|
||||
environment:
|
||||
sdk: ^3.9.0-0
|
||||
|
||||
Reference in New Issue
Block a user