1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +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

@@ -22,7 +22,8 @@ const double windowWidth = 480;
const double windowHeight = 854;
void setupWindow() {
if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
if (!kIsWeb &&
(Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
WidgetsFlutterBinding.ensureInitialized();
setWindowTitle('Infinite List');
setWindowMinSize(const Size(windowWidth, windowHeight));
@@ -68,26 +69,25 @@ class MyHomePage extends StatelessWidget {
// listening to the catalog's `itemCount`, because that's all we need
// at this level.
selector: (context, catalog) => catalog.itemCount,
builder:
(context, itemCount, child) => ListView.builder(
// When `itemCount` is null, `ListView` assumes an infinite list.
// Once we provide a value, it will stop the scrolling beyond
// the last element.
itemCount: itemCount,
padding: const EdgeInsets.symmetric(vertical: 18),
itemBuilder: (context, index) {
// Every item of the `ListView` is individually listening
// to the catalog.
var catalog = Provider.of<Catalog>(context);
builder: (context, itemCount, child) => ListView.builder(
// When `itemCount` is null, `ListView` assumes an infinite list.
// Once we provide a value, it will stop the scrolling beyond
// the last element.
itemCount: itemCount,
padding: const EdgeInsets.symmetric(vertical: 18),
itemBuilder: (context, index) {
// Every item of the `ListView` is individually listening
// to the catalog.
var catalog = Provider.of<Catalog>(context);
// Catalog provides a single synchronous method for getting the
// current data.
return switch (catalog.getByIndex(index)) {
Item(isLoading: true) => const LoadingItemTile(),
var item => ItemTile(item: item),
};
},
),
// Catalog provides a single synchronous method for getting the
// current data.
return switch (catalog.getByIndex(index)) {
Item(isLoading: true) => const LoadingItemTile(),
var item => ItemTile(item: item),
};
},
),
),
);
}

View File

@@ -21,7 +21,11 @@ Future<ItemPage> fetchPage(int startingIndex) async {
// If the [startingIndex] is beyond the bounds of the catalog, an
// empty page will be returned.
if (startingIndex > catalogLength) {
return ItemPage(items: [], startingIndex: startingIndex, hasNext: false);
return ItemPage(
items: [],
startingIndex: startingIndex,
hasNext: false,
);
}
// The page of items is generated here.

View File

@@ -22,7 +22,10 @@ class ItemTile extends StatelessWidget {
aspectRatio: 1,
child: Container(color: item.color),
),
title: Text(item.name, style: Theme.of(context).textTheme.titleLarge),
title: Text(
item.name,
style: Theme.of(context).textTheme.titleLarge,
),
trailing: Text('\$ ${(item.price / 100).toStringAsFixed(2)}'),
),
);