mirror of
https://github.com/flutter/samples.git
synced 2026-07-17 22:42:53 +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:
@@ -13,7 +13,10 @@ class MyCart extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Cart', style: Theme.of(context).textTheme.displayLarge),
|
||||
title: Text(
|
||||
'Cart',
|
||||
style: Theme.of(context).textTheme.displayLarge,
|
||||
),
|
||||
backgroundColor: Colors.white,
|
||||
),
|
||||
body: Container(
|
||||
@@ -46,17 +49,16 @@ class _CartList extends StatelessWidget {
|
||||
|
||||
return ListView.builder(
|
||||
itemCount: cart.items.length,
|
||||
itemBuilder:
|
||||
(context, index) => ListTile(
|
||||
leading: const Icon(Icons.done),
|
||||
trailing: IconButton(
|
||||
icon: const Icon(Icons.remove_circle_outline),
|
||||
onPressed: () {
|
||||
cart.remove(cart.items[index]);
|
||||
},
|
||||
),
|
||||
title: Text(cart.items[index].name, style: itemNameStyle),
|
||||
),
|
||||
itemBuilder: (context, index) => ListTile(
|
||||
leading: const Icon(Icons.done),
|
||||
trailing: IconButton(
|
||||
icon: const Icon(Icons.remove_circle_outline),
|
||||
onPressed: () {
|
||||
cart.remove(cart.items[index]);
|
||||
},
|
||||
),
|
||||
title: Text(cart.items[index].name, style: itemNameStyle),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -81,15 +83,16 @@ class _CartTotal extends StatelessWidget {
|
||||
// The important thing is that it will not rebuild
|
||||
// the rest of the widgets in this build method.
|
||||
Consumer<CartModel>(
|
||||
builder:
|
||||
(context, cart, child) =>
|
||||
Text('\$${cart.totalPrice}', style: hugeStyle),
|
||||
builder: (context, cart, child) =>
|
||||
Text('\$${cart.totalPrice}', style: hugeStyle),
|
||||
),
|
||||
const SizedBox(width: 24),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Buying not supported yet.')),
|
||||
const SnackBar(
|
||||
content: Text('Buying not supported yet.'),
|
||||
),
|
||||
);
|
||||
},
|
||||
style: TextButton.styleFrom(foregroundColor: Colors.white),
|
||||
|
||||
Reference in New Issue
Block a user