Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sync] 2023/12/02 #1390

Merged
merged 57 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
1f4dea3
Bump examples/codelabs from `92d0967` to `8b19a31` (#9819)
dependabot[bot] Nov 16, 2023
dd82a3d
Update android-predictive-back.md (#9820)
Thorinos Nov 16, 2023
9b557b8
Remove the staging container and move it to the shared repository (#9…
drewroengoogle Nov 16, 2023
d2ce1a1
Replace Firebase links (#9824)
AlexV525 Nov 17, 2023
fb2e3a6
Bump github/codeql-action from 2.22.6 to 2.22.7 (#9828)
dependabot[bot] Nov 17, 2023
41720f7
Change order of debugging tools to show recommended first. (#9830)
polina-c Nov 18, 2023
e1aa31f
Add macOS network client entitlement (#9825)
domesticmouse Nov 19, 2023
7183ed6
Update networking cookbook recipes to use pattern matching (#9829)
domesticmouse Nov 20, 2023
c030feb
Bump examples/codelabs from `8b19a31` to `14376e6` (#9835)
dependabot[bot] Nov 20, 2023
1188531
Bump pigeon from 13.1.2 to 14.0.0 in /examples/development/platform_i…
dependabot[bot] Nov 20, 2023
e6edbed
Add `/go/pub-workspace` redirect for the pub workspaces design docume…
sigurdm Nov 20, 2023
706c0aa
Adding `/go/games-revenue` link for games revenue (#9771)
sfshaza2 Nov 20, 2023
f884a5c
Bump ruby from `adc7f93` to `7d4af98` (#9838)
dependabot[bot] Nov 21, 2023
0134c49
Update Wasm status for Firefox 120 stable WasmGC support (#9840)
parlough Nov 21, 2023
aff9c66
Remove duplicated words on deployment page (#9839)
Elio-Muculo Nov 21, 2023
98b7476
Adding info about drag and drop (#9703)
sfshaza2 Nov 21, 2023
713c1f1
Add links to game templates (#9841)
sfshaza2 Nov 22, 2023
cc50f77
Adding warning to books page (#9843)
sfshaza2 Nov 22, 2023
d6301dd
Bump examples/codelabs from `14376e6` to `9e8cbb3` (#9847)
dependabot[bot] Nov 22, 2023
d682bb6
Bump ruby from `7d4af98` to `e9926bc` (#9846)
dependabot[bot] Nov 22, 2023
a133bb3
Fix list on Firestore multiplayer recipe (#9845)
filiph Nov 22, 2023
9c3a67e
Adding a link to restoring state info for mobile (#9842)
sfshaza2 Nov 22, 2023
7bb3794
[go-link] Register `/go/web-multiview-js-api` link (#9849)
ditman Nov 23, 2023
2cf1a00
Bump ruby from `e9926bc` to `02a091c` (#9850)
dependabot[bot] Nov 23, 2023
edf9099
Bump github/codeql-action from 2.22.7 to 2.22.8 (#9855)
dependabot[bot] Nov 24, 2023
3d8bbcd
Bump examples/codelabs from `9e8cbb3` to `89ba0ff` (#9854)
dependabot[bot] Nov 24, 2023
80eddad
Changing the url for the games preso (#9859)
sfshaza2 Nov 27, 2023
dca289a
Fixes typo and link on MaxLengthEnforcement BC page (#9860)
atsansone Nov 27, 2023
c4ef122
Fix link to FontStyle enum (#9861)
atsansone Nov 27, 2023
073bde5
Adding a link to more info on Android Drawables (#9844)
sfshaza2 Nov 28, 2023
2684c48
Embedding another adaptive vs responsive video (#9863)
sfshaza2 Nov 28, 2023
af611ef
Replace PopInterface with PopEntry (#9862)
atsansone Nov 28, 2023
d5f8215
Bump examples/codelabs from `89ba0ff` to `3e5d107` (#9865)
dependabot[bot] Nov 28, 2023
a9a4242
Update wasm.md with webkit info (#9866)
mit-mit Nov 28, 2023
ff32009
Update `examples/codelabs` (#9867)
domesticmouse Nov 28, 2023
087e59d
Add Q3 DevIntel report go-link (#9871)
ericwindmill Nov 29, 2023
4af90a3
Reference sheet for post-3.16 deprecation clean up (#9870)
Piinks Nov 29, 2023
cfa7036
Add `/go/semantics-roles` link to Semantic Roles design doc (#9874)
chunhtai Nov 29, 2023
775b776
Update telemetry flags to consolidated analytics ones (#9875)
parlough Nov 30, 2023
93ff662
Bump examples/codelabs from `86f579b` to `5077b21` (#9877)
dependabot[bot] Nov 30, 2023
aa91bcc
Remove layout basics codelab (#9876)
parlough Nov 30, 2023
23001d7
Bump googleapis from 11.4.0 to 12.0.0 in /examples/googleapis (#9878)
dependabot[bot] Nov 30, 2023
0ff35b1
Adding Inspector settings docs (#9853)
CoderDake Nov 30, 2023
d4a2e8a
Remove games cookbook index redirect (#9880)
parlough Nov 30, 2023
a14537a
Remove last usage of testing from embedded DartPads (#9879)
parlough Nov 30, 2023
ed0d1a2
Update firebase.json (#9886)
htoor3 Nov 30, 2023
a1f8b64
Create `/go/leak-tracker-high-level-design` design doc redirect (#9887)
polina-c Dec 1, 2023
a60403d
Adding a missing step to DevTools console docs (#9885)
sfshaza2 Dec 1, 2023
78af3ba
Adding info about SuperDash game (#9881)
sfshaza2 Dec 1, 2023
33633d1
Add DevTools release notes for 2.28.2, 2.28.3, 2.29.0, 2.30.0 (#9883)
kenzieschmoll Dec 1, 2023
af3b280
Bump examples/codelabs from `5077b21` to `4e2eb0c` (#9888)
dependabot[bot] Dec 1, 2023
14f4e30
Update editor.md (#9884)
asedilloglatt Dec 1, 2023
ebece31
Add a new page on "Concurrency and isolates" (#9777)
ericwindmill Dec 1, 2023
ce8a94c
Sync: 2023/12/02
AmosHuKe Dec 2, 2023
44efa66
Sync: 2023/12/02
AmosHuKe Dec 2, 2023
d6c5e80
Update: cookbook -> docs/cookbook
AmosHuKe Dec 2, 2023
38f7cc3
Update: inspector.md
AmosHuKe Dec 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.2.2-slim-bookworm@sha256:adc7f93df5b83c8627b3fadcc974ce452ef9999603f65f637e32b8acec096ae1 AS base
FROM ruby:3.2.2-slim-bookworm@sha256:02a091c83d1aa1070c0f6fefcbd2aff58ddd3430e2d5661c6ef2142b1383349b AS base

SHELL ["/usr/bin/bash", "-c"]

Expand Down
2 changes: 1 addition & 1 deletion examples/codelabs
Submodule codelabs updated 292 files
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,18 @@ class Album {
});

factory Album.fromJson(Map<String, dynamic> json) {
return Album(
userId: json['userId'] as int,
id: json['id'] as int,
title: json['title'] as String,
);
return switch (json) {
{
'userId': int userId,
'id': int id,
'title': String title,
} =>
Album(
userId: userId,
id: id,
title: title,
),
_ => throw const FormatException('Failed to load album.'),
};
}
}
15 changes: 11 additions & 4 deletions examples/cookbook/networking/delete_data/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,17 @@ class Album {
const Album({required this.id, required this.title});

factory Album.fromJson(Map<String, dynamic> json) {
return Album(
id: json['id'] as int,
title: json['title'] as String,
);
return switch (json) {
{
'id': int id,
'title': String title,
} =>
Album(
id: id,
title: title,
),
_ => throw const FormatException('Failed to load album.'),
};
}
}

Expand Down
18 changes: 13 additions & 5 deletions examples/cookbook/networking/fetch_data/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,19 @@ class Album {
});

factory Album.fromJson(Map<String, dynamic> json) {
return Album(
userId: json['userId'] as int,
id: json['id'] as int,
title: json['title'] as String,
);
return switch (json) {
{
'userId': int userId,
'id': int id,
'title': String title,
} =>
Album(
userId: userId,
id: id,
title: title,
),
_ => throw const FormatException('Failed to load album.'),
};
}
}
// #enddocregion Album
Expand Down
15 changes: 11 additions & 4 deletions examples/cookbook/networking/send_data/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,17 @@ class Album {
const Album({required this.id, required this.title});

factory Album.fromJson(Map<String, dynamic> json) {
return Album(
id: json['id'] as int,
title: json['title'] as String,
);
return switch (json) {
{
'id': int id,
'title': String title,
} =>
Album(
id: id,
title: title,
),
_ => throw const FormatException('Failed to load album.'),
};
}
}
// #enddocregion Album
Expand Down
15 changes: 11 additions & 4 deletions examples/cookbook/networking/update_data/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,17 @@ class Album {
const Album({required this.id, required this.title});

factory Album.fromJson(Map<String, dynamic> json) {
return Album(
id: json['id'] as int,
title: json['title'] as String,
);
return switch (json) {
{
'id': int id,
'title': String title,
} =>
Album(
id: id,
title: title,
),
_ => throw const FormatException('Failed to load album.'),
};
}
}
// #enddocregion Album
Expand Down
15 changes: 11 additions & 4 deletions examples/cookbook/networking/update_data/lib/main_step5.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,17 @@ class Album {
const Album({required this.id, required this.title});

factory Album.fromJson(Map<String, dynamic> json) {
return Album(
id: json['id'] as int,
title: json['title'] as String,
);
return switch (json) {
{
'id': int id,
'title': String title,
} =>
Album(
id: id,
title: title,
),
_ => throw const FormatException('Failed to load album.'),
};
}
}

Expand Down
10 changes: 10 additions & 0 deletions examples/development/concurrency/isolates/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Take our settings from the example_utils analysis_options.yaml file.
# If necessary for a particular example, this file can also include
# overrides for individual lints.

include: package:example_utils/analysis.yaml

linter:
rules:
avoid_print: false
prefer_const_constructors: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'dart:isolate';

import 'package:flutter/services.dart';
import 'package:shared_preferences/shared_preferences.dart';

void main() {
// Identify the root isolate to pass to the background isolate.
RootIsolateToken rootIsolateToken = RootIsolateToken.instance!;
Isolate.spawn(_isolateMain, rootIsolateToken);
}

Future<void> _isolateMain(RootIsolateToken rootIsolateToken) async {
// Register the background isolate with the root isolate.
BackgroundIsolateBinaryMessenger.ensureInitialized(rootIsolateToken);

// You can now use the shared_preferences plugin.
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();

print(sharedPreferences.getBool('isDebug'));
}
71 changes: 71 additions & 0 deletions examples/development/concurrency/isolates/lib/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:convert';
import 'dart:isolate';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
const MyApp({super.key});

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Isolates demo',
home: Scaffold(
appBar: AppBar(
title: const Text('Isolates demo'),
),
body: Center(
child: ElevatedButton(
onPressed: () {
getPhotos();
},
child: Text('Fetch photos'),
),
),
),
);
}
}

// #docregion isolate-run
// Produces a list of 211,640 photo objects.
// (The JSON file is ~20MB.)
Future<List<Photo>> getPhotos() async {
final String jsonString = await rootBundle.loadString('assets/photos.json');
final List<Photo> photos = await Isolate.run<List<Photo>>(() {
final List<Object?> photoData = jsonDecode(jsonString) as List<Object?>;
return photoData.cast<Map<String, Object?>>().map(Photo.fromJson).toList();
});
return photos;
}
// #enddocregion isolate-run

class Photo {
final int albumId;
final int id;
final String title;
final String thumbnailUrl;

Photo({
required this.albumId,
required this.id,
required this.title,
required this.thumbnailUrl,
});

factory Photo.fromJson(Map<String, dynamic> data) {
return Photo(
albumId: data['albumId'] as int,
id: data['id'] as int,
title: data['title'] as String,
thumbnailUrl: data['thumbnailUrl'] as String,
);
}
}
17 changes: 17 additions & 0 deletions examples/development/concurrency/isolates/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: isolates
description: Sample isolate code

version: 1.0.0+1

environment:
sdk: ^3.1.0

dependencies:
flutter:
sdk: flutter
shared_preferences: any

dev_dependencies:
example_utils:
path: ../../../example_utils

2 changes: 1 addition & 1 deletion examples/development/platform_integration/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ environment:
dependencies:
flutter:
sdk: flutter
pigeon: ^13.0.0
pigeon: ^14.0.0

cupertino_icons: ^1.0.6

Expand Down
1 change: 1 addition & 0 deletions examples/example_utils/lib/analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ linter:
- package_api_docs
- prefer_relative_imports
- prefer_single_quotes
- only_throw_errors
- sort_unnamed_constructors_first
- test_types_in_equals
- throw_in_finally
Expand Down
6 changes: 0 additions & 6 deletions examples/get-started/codelab_web/lib/starter.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* {$ begin main.dart $} */
import 'package:flutter/material.dart';

void main() => runApp(const SignUpApp());
Expand Down Expand Up @@ -99,8 +98,3 @@ class _SignUpFormState extends State<SignUpForm> {
);
}
}
/* {$ end main.dart $} */
/* {$ begin test.dart $} */
// Avoid warning on "double _formProgress = 0;"
//_ignore_for_file: prefer_final_fields
/* {$ end test.dart $} */
2 changes: 1 addition & 1 deletion examples/googleapis/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
flutter:
sdk: flutter
google_sign_in: ^6.1.5
googleapis: ^11.4.0
googleapis: ^12.0.0
http: ^1.1.0

dev_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion examples/testing/errors/lib/excerpts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MyApp extends StatelessWidget {
}
ErrorWidget.builder = (errorDetails) => error;
if (widget != null) return widget;
throw ('widget is null');
throw StateError('widget is null');
},
);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/testing/errors/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class MyApp extends StatelessWidget {
}
ErrorWidget.builder = (errorDetails) => error;
if (widget != null) return widget;
throw ('widget is null');
throw StateError('widget is null');
},
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sdk.dir=/Users/brettmorgan/Library/Android/sdk
flutter.sdk=/Users/brettmorgan/flutter
41 changes: 41 additions & 0 deletions examples/testing/integration_tests/how_to/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// Generated file. Do not edit.
//

// clang-format off

#ifndef GeneratedPluginRegistrant_h
#define GeneratedPluginRegistrant_h

#import <Flutter/Flutter.h>

NS_ASSUME_NONNULL_BEGIN

@interface GeneratedPluginRegistrant : NSObject
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;
@end

NS_ASSUME_NONNULL_END
#endif /* GeneratedPluginRegistrant_h */
Loading