1
0
mirror of https://github.com/flutter/samples.git synced 2026-06-12 17:28:52 +00:00

Dart 3.9 / Flutter 3.35 [first LLM release] (#2714)

I got carried away with Gemini and basically rewrote CI and the release
process for the new LLM reality. This work was largely completed by
Gemini.

- Bump all SDK versions to the current beta (3.9.0-0)
- Run `flutter channel beta`
- Wrote `ci_script.dart` to replace the bash scripts
- Converted repository to pub workspace #2499 
- Added llm.md and release.md
- Added redirect for deprecated Samples Index

## 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:
Eric Windmill
2025-08-14 12:26:24 -07:00
committed by GitHub
parent 0aa5415d5e
commit 2999d738b8
410 changed files with 28166 additions and 27661 deletions

View File

@@ -21,7 +21,10 @@ class ServingInfoChart extends StatelessWidget {
// Creates a [Text] widget to display a veggie's "percentage of your daily
// value of this vitamin" data adjusted for the user's preferred calorie
// target.
Widget _buildVitaminText(int standardPercentage, Future<int> targetCalories) {
Widget _buildVitaminText(
int standardPercentage,
Future<int> targetCalories,
) {
return FutureBuilder<int>(
future: targetCalories,
builder: (context, snapshot) {
@@ -62,7 +65,10 @@ class ServingInfoChart extends StatelessWidget {
Row(
mainAxisSize: MainAxisSize.max,
children: [
Text('Calories', style: Styles.detailsServingLabelText(themeData)),
Text(
'Calories',
style: Styles.detailsServingLabelText(themeData),
),
const Spacer(),
Text(
'${veggie.caloriesPerServing} kCal',
@@ -75,18 +81,30 @@ class ServingInfoChart extends StatelessWidget {
Row(
mainAxisSize: MainAxisSize.max,
children: [
Text('Vitamin A', style: Styles.detailsServingLabelText(themeData)),
Text(
'Vitamin A',
style: Styles.detailsServingLabelText(themeData),
),
const Spacer(),
_buildVitaminText(veggie.vitaminAPercentage, prefs.desiredCalories),
_buildVitaminText(
veggie.vitaminAPercentage,
prefs.desiredCalories,
),
],
),
const SizedBox(height: 24),
Row(
mainAxisSize: MainAxisSize.max,
children: [
Text('Vitamin C', style: Styles.detailsServingLabelText(themeData)),
Text(
'Vitamin C',
style: Styles.detailsServingLabelText(themeData),
),
const Spacer(),
_buildVitaminText(veggie.vitaminCPercentage, prefs.desiredCalories),
_buildVitaminText(
veggie.vitaminCPercentage,
prefs.desiredCalories,
),
],
),
Padding(
@@ -131,7 +149,10 @@ class InfoView extends StatelessWidget {
style: CupertinoTheme.of(context).textTheme.textStyle,
),
const SizedBox(height: 16),
Text('Seasons', style: Styles.detailsServingLabelText(themeData)),
Text(
'Seasons',
style: Styles.detailsServingLabelText(themeData),
),
const SizedBox(height: 12),
Row(
mainAxisSize: MainAxisSize.max,
@@ -143,10 +164,9 @@ class InfoView extends StatelessWidget {
children: [
Icon(
Styles.seasonIconData[season],
color:
veggie.seasons.contains(season)
? Styles.seasonColors[season]
: const Color.fromRGBO(128, 128, 128, 1),
color: veggie.seasons.contains(season)
? Styles.seasonColors[season]
: const Color.fromRGBO(128, 128, 128, 1),
size: 24,
),
const SizedBox(height: 4),

View File

@@ -25,26 +25,32 @@ class FavoritesScreen extends StatelessWidget {
middle: Text('My Garden'),
),
child: Center(
child:
model.favoriteVeggies.isEmpty
? Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(
'You haven\'t added any favorite veggies to your garden yet.',
style: CupertinoTheme.of(context).textTheme.textStyle,
),
)
: ListView(
restorationId: 'list',
children: [
const SizedBox(height: 24),
for (Veggie veggie in model.favoriteVeggies)
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 24),
child: VeggieHeadline(veggie),
),
],
child: model.favoriteVeggies.isEmpty
? Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(
'You haven\'t added any favorite veggies to your garden yet.',
style: CupertinoTheme.of(
context,
).textTheme.textStyle,
),
)
: ListView(
restorationId: 'list',
children: [
const SizedBox(height: 24),
for (Veggie veggie in model.favoriteVeggies)
Padding(
padding: const EdgeInsets.fromLTRB(
16,
0,
16,
24,
),
child: VeggieHeadline(veggie),
),
],
),
),
);
},

View File

@@ -21,7 +21,10 @@ class HomeScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final index = _getSelectedIndex(GoRouter.of(context).location);
final String location = GoRouter.of(
context,
).routerDelegate.currentConfiguration.uri.toString();
final index = _getSelectedIndex(location);
return RestorationScope(
restorationId: restorationId,
child: CupertinoPageScaffold(

View File

@@ -27,7 +27,11 @@ class ListScreen extends StatelessWidget {
future: prefs.preferredCategories,
builder: (context, snapshot) {
final data = snapshot.data ?? <VeggieCategory>{};
return VeggieCard(veggie, inSeason, data.contains(veggie.category));
return VeggieCard(
veggie,
inSeason,
data.contains(veggie.category),
);
},
),
);

View File

@@ -18,7 +18,8 @@ class SearchScreen extends StatefulWidget {
State<SearchScreen> createState() => _SearchScreenState();
}
class _SearchScreenState extends State<SearchScreen> with RestorationMixin {
class _SearchScreenState extends State<SearchScreen>
with RestorationMixin {
final controller = RestorableTextEditingController();
final focusNode = FocusNode();
String? terms;
@@ -87,7 +88,11 @@ class _SearchScreenState extends State<SearchScreen> with RestorationMixin {
);
} else {
return Padding(
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 24),
padding: const EdgeInsets.only(
left: 16,
right: 16,
bottom: 24,
),
child: VeggieHeadline(veggies[i - 1]),
);
}
@@ -106,7 +111,9 @@ class _SearchScreenState extends State<SearchScreen> with RestorationMixin {
builder: (context) {
return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle(
statusBarBrightness: MediaQuery.platformBrightnessOf(context),
statusBarBrightness: MediaQuery.platformBrightnessOf(
context,
),
),
child: SafeArea(
bottom: false,

View File

@@ -58,7 +58,10 @@ class VeggieCategorySettingsScreen extends StatelessWidget {
},
);
} else {
toggle = const CupertinoSwitch(value: false, onChanged: null);
toggle = const CupertinoSwitch(
value: false,
onChanged: null,
);
}
tiles.add(
@@ -129,14 +132,13 @@ class CalorieSettingsScreen extends StatelessWidget {
icon: CupertinoIcons.check_mark,
foregroundColor:
snapshot.hasData && snapshot.data == cals
? CupertinoColors.activeBlue
: Styles.transparentColor,
? CupertinoColors.activeBlue
: Styles.transparentColor,
backgroundColor: Styles.transparentColor,
),
onTap:
snapshot.hasData
? () => model.setDesiredCalories(cals)
: null,
onTap: snapshot.hasData
? () => model.setDesiredCalories(cals)
: null,
),
);
}
@@ -227,29 +229,28 @@ class _SettingsScreenState extends State<SettingsScreen> {
onTap: () {
showCupertinoDialog<void>(
context: context,
builder:
(context) => CupertinoAlertDialog(
title: const Text('Are you sure?'),
content: const Text(
'Are you sure you want to reset the current settings?',
),
actions: [
CupertinoDialogAction(
isDestructiveAction: true,
child: const Text('Yes'),
onPressed: () async {
await prefs.restoreDefaults();
if (!context.mounted) return;
context.pop();
},
),
CupertinoDialogAction(
isDefaultAction: true,
child: const Text('No'),
onPressed: () => context.pop(),
),
],
builder: (context) => CupertinoAlertDialog(
title: const Text('Are you sure?'),
content: const Text(
'Are you sure you want to reset the current settings?',
),
actions: [
CupertinoDialogAction(
isDestructiveAction: true,
child: const Text('Yes'),
onPressed: () async {
await prefs.restoreDefaults();
if (!context.mounted) return;
context.pop();
},
),
CupertinoDialogAction(
isDefaultAction: true,
child: const Text('No'),
onPressed: () => context.pop(),
),
],
),
);
},
);