Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a94af64
gemini ran ci
ericwindmill Jul 31, 2025
c946d98
gemini ran ci
ericwindmill Jul 31, 2025
fa39baa
only run beta CI for a moment
ericwindmill Jul 31, 2025
8b19871
checkin
ericwindmill Aug 1, 2025
78b847c
checkin
ericwindmill Aug 1, 2025
a511846
checkin
ericwindmill Aug 1, 2025
50ecc5a
checkin
ericwindmill Aug 1, 2025
ef2e8e7
checkin
ericwindmill Aug 1, 2025
b023fda
checkin - updated to workspace
ericwindmill Aug 1, 2025
b23c073
checkin
ericwindmill Aug 1, 2025
d64595b
checkin
ericwindmill Aug 1, 2025
1354f6c
checkin
ericwindmill Aug 1, 2025
5a195d0
checkin
ericwindmill Aug 1, 2025
a80fe32
docs: update release workflow
ericwindmill Aug 1, 2025
074aa42
update ci script
ericwindmill Aug 1, 2025
ad8eadf
update ci script
ericwindmill Aug 1, 2025
6f45031
update ci script
ericwindmill Aug 1, 2025
d34c74b
update ci script
ericwindmill Aug 1, 2025
1aa4b09
add pub get to github action
ericwindmill Aug 1, 2025
f63e32b
add flutter pub get to github action
ericwindmill Aug 1, 2025
10b4d06
update
ericwindmill Aug 1, 2025
716d878
add tool as part of monorepo
ericwindmill Aug 1, 2025
87b3799
fix add to app workspace troubles
ericwindmill Aug 1, 2025
204606a
fix dir location in ci_script.dart
ericwindmill Aug 1, 2025
04e6e73
lots of dart formats
ericwindmill Aug 1, 2025
8b8727b
update llm files
ericwindmill Aug 6, 2025
a815bd1
revert actions workflows
ericwindmill Aug 6, 2025
70cf629
Merge branch 'main' into august-release-ai-test
ericwindmill Aug 6, 2025
f733b93
revert actions workflows
ericwindmill Aug 6, 2025
771881f
Merge branch 'august-release-ai-test' of https://github.com/flutter/s…
ericwindmill Aug 6, 2025
0833756
use new script on beta
ericwindmill Aug 6, 2025
c6a8e26
use new script on beta
ericwindmill Aug 6, 2025
3f4a11a
use new script on beta
ericwindmill Aug 6, 2025
98f8996
uupdate ci script for windows
ericwindmill Aug 6, 2025
60ce994
adds redirect for deprecated samples index
ericwindmill Aug 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .gemini/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"mcpServers": {
"dart": {
"command": "dart",
"args": [
"mcp-server"
]
}
}
}
36 changes: 18 additions & 18 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ defaults:
shell: bash

jobs:
# Run the stable test script on the beta channel. Since this branch will soon
# be merged into main as our stable-targeting code, this is the key thing we
# need to test.
stable-tests-on-beta:
# Test all samples on the beta channel. Since the beta channel will soon be
# promoted to stable, this branch is only concerned with the beta.
Beta-CI:
name: Test flutter beta channel
runs-on: ${{ matrix.os }}
if: github.repository == 'flutter/samples'
strategy:
Expand All @@ -34,7 +34,7 @@ jobs:
- uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046
with:
channel: beta
- run: ./tool/flutter_ci_script_stable.sh
- run: flutter pub get && dart tool/ci_script.dart

# Verify the Android add-to-app samples build and pass tests with the beta
# channel.
Expand All @@ -54,16 +54,16 @@ jobs:

# Verify the iOS add-to-app samples build and pass tests with the beta
# channel.
ios-build:
runs-on: macos-latest
if: github.repository == 'flutter/samples'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00
with:
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046
with:
channel: beta
- run: ./tool/ios_ci_script.sh
# ios-build:
# runs-on: macos-latest
# if: github.repository == 'flutter/samples'
# steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
# - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00
# with:
# distribution: 'zulu'
# java-version: '17'
# - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046
# with:
# channel: beta
# - run: ./tool/ios_ci_script.sh
30 changes: 15 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
flutter_version: [stable, beta, master]
flutter_version: [stable, beta]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand All @@ -35,7 +35,7 @@ jobs:
- uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046
with:
channel: ${{ matrix.flutter_version }}
- run: ./tool/flutter_ci_script_${{ matrix.flutter_version }}.sh
- run: flutter pub get && dart tool/ci_script.dart

# android-build:
# runs-on: ubuntu-latest
Expand All @@ -51,16 +51,16 @@ jobs:
# channel: stable
# - run: ./tool/android_ci_script.sh

ios-build:
runs-on: macos-latest
if: github.repository == 'flutter/samples'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00
with:
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046
with:
channel: stable
- run: ./tool/ios_ci_script.sh
# ios-build:
# runs-on: macos-latest
# if: github.repository == 'flutter/samples'
# steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
# - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00
# with:
# distribution: 'zulu'
# java-version: '17'
# - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046
# with:
# channel: stable
# - run: ./tool/ios_ci_script.sh
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
.pub-cache/
.pub/
/build/
**/build/

# Android related
**/gradle-wrapper.jar
Expand Down Expand Up @@ -81,3 +82,6 @@ yarn.lock
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

.claude/
logs/
32 changes: 0 additions & 32 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A collection of open source samples that illustrate best practices for

## Contributing

We're very appreciative of fixes and necessary improvements to the existing samples. **But in most cases, we're not currently adding new samples to this repository** while we rethink sample code in the post-LLM world.
We appreciate fixes and necessary improvements to existing samples. **But in most cases, we're not currently adding new samples to this repository** while we rethink sample code in the new LLM world.

Please read the [contributor's guide] if you have contributions.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ class Cell extends StatefulWidget {

class _CellState extends State<Cell> with WidgetsBindingObserver {
static const double gravity = 9.81;
static final AccelerometerEvent defaultPosition = AccelerometerEvent(0, 0, 0);
static final AccelerometerEvent defaultPosition = AccelerometerEvent(
0,
0,
0,
DateTime.now(),
);

int cellNumber = 0;
Random? _random;
Expand Down Expand Up @@ -82,7 +87,10 @@ class _CellState extends State<Cell> with WidgetsBindingObserver {
builder: (context) {
return Card(
// Mimic the platform Material look.
margin: const EdgeInsets.symmetric(horizontal: 36, vertical: 24),
margin: const EdgeInsets.symmetric(
horizontal: 36,
vertical: 24,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
),
Expand Down Expand Up @@ -112,22 +120,22 @@ class _CellState extends State<Cell> with WidgetsBindingObserver {
child: StreamBuilder<AccelerometerEvent>(
// Don't continuously rebuild for nothing when the
// cell isn't visible.
stream:
appLifecycleState == AppLifecycleState.resumed
? accelerometerEventStream()
: Stream.value(defaultPosition),
stream: appLifecycleState == AppLifecycleState.resumed
? accelerometerEventStream()
: Stream.value(defaultPosition),
initialData: defaultPosition,
builder: (context, snapshot) {
return Transform(
// Figure out the phone's orientation relative
// to gravity's direction. Ignore the z vector.
transform: Matrix4.rotationX(
snapshot.data!.y / gravity * pi / 2,
)..multiply(
Matrix4.rotationY(
snapshot.data!.x / gravity * pi / 2,
),
),
transform:
Matrix4.rotationX(
snapshot.data!.y / gravity * pi / 2,
)..multiply(
Matrix4.rotationY(
snapshot.data!.x / gravity * pi / 2,
),
),
alignment: Alignment.center,
child: const FlutterLogo(size: 72),
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: flutter_module_using_plugin
name: flutter_module_using_plugin_android_view
description: An example Flutter module that uses a plugin.

version: 1.0.0+1
resolution: workspace

environment:
sdk: ^3.7.0-0
sdk: ^3.9.0-0

dependencies:
flutter:
sdk: flutter
provider: ^6.0.2
url_launcher: ^6.0.20
sensors_plus: ^5.0.1
provider: ^6.1.5
url_launcher: ^6.3.2
sensors_plus: ^6.1.1

dev_dependencies:
analysis_defaults:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// tree, read text, and verify that the values of widget properties are correct.

import 'package:flutter/material.dart';
import 'package:flutter_module_using_plugin/main.dart';
import 'package:flutter_module_using_plugin_android_view/main.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:provider/provider.dart';

Expand Down
36 changes: 17 additions & 19 deletions add_to_app/books/flutter_module_books/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,28 +125,26 @@ class _BookDetailState extends State<BookDetail> {
IconButton(
icon: const Icon(Icons.check),
// Pressing save sends the updated book to the platform.
onPressed:
book != null
? () {
hostApi.finishEditingBook(book!);
clear();
}
: null,
onPressed: book != null
? () {
hostApi.finishEditingBook(book!);
clear();
}
: null,
),
],
),
body:
book == null
// Draw a spinner until the platform gives us the book to show details
// for.
? const Center(child: CircularProgressIndicator())
: BookForm(
book: book!,
focusNode: textFocusNode,
authorTextController: authorTextController,
subtitleTextController: subtitleTextController,
titleTextController: titleTextController,
),
body: book == null
// Draw a spinner until the platform gives us the book to show details
// for.
? const Center(child: CircularProgressIndicator())
: BookForm(
book: book!,
focusNode: textFocusNode,
authorTextController: authorTextController,
subtitleTextController: subtitleTextController,
titleTextController: titleTextController,
),
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions add_to_app/books/flutter_module_books/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: flutter_module_books
description: A Flutter module using the Pigeon package to demonstrate
integrating Flutter in a realistic scenario where the existing platform app
already has business logic and middleware constraints.

version: 1.0.0+1
resolution: workspace

environment:
sdk: ^3.7.0-0
sdk: ^3.9.0-0

dependencies:
flutter:
Expand Down
8 changes: 6 additions & 2 deletions add_to_app/books/flutter_module_books/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ void main() {
expect(mockHostApi.cancelCalls, 1);
});

testWidgets('Pressing done calls the finish editing API', (tester) async {
testWidgets('Pressing done calls the finish editing API', (
tester,
) async {
MockHostBookApi mockHostApi = MockHostBookApi();

await tester.pumpWidget(
MaterialApp(home: BookDetail(book: Book(), hostApi: mockHostApi)),
MaterialApp(
home: BookDetail(book: Book(), hostApi: mockHostApi),
),
);

await tester.tap(find.byIcon(Icons.check));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: flutter_module
name: flutter_module_fullscreen
description: An example Flutter module.

version: 1.0.0+1
resolution: workspace

environment:
sdk: ^3.7.0-0
sdk: ^3.9.0-0

dependencies:
flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// found in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:flutter_module/main.dart';
import 'package:flutter_module_fullscreen/main.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:provider/provider.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// found in the LICENSE file.

import 'package:flutter_driver/driver_extension.dart';
import 'package:flutter_module/main.dart' as app;
import 'package:flutter_module_fullscreen/main.dart' as app;

// This alternate entrypoint is used for espresso testing. See
// https://pub.dev/packages/espresso for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ class _MyHomePageState extends State<MyHomePage> {
'$_counter',
style: Theme.of(context).textTheme.headlineMedium,
),
TextButton(onPressed: _incrementCounter, child: const Text('Add')),
TextButton(
onPressed: _incrementCounter,
child: const Text('Add'),
),
TextButton(
onPressed: () {
_channel.invokeMethod<void>("next", _counter);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: multiple_flutters_module
description: A module that is embedded in the multiple_flutters_ios and multiple_flutters_android sample code.

version: 1.0.0+1
resolution: workspace

environment:
sdk: ^3.7.0-0
sdk: ^3.9.0-0

dependencies:
flutter:
Expand Down
Loading
Loading