1
0
mirror of https://github.com/flutter/samples.git synced 2026-06-05 13:59:35 +00:00
dependabot[bot] 8df115f2a7 Bump @angular/platform-browser-dynamic from 21.2.16 to 22.0.0 in /web_embedding/ng-flutter (#2849)
Bumps [@angular/platform-browser-dynamic](https://github.com/angular/angular/tree/HEAD/packages/platform-browser-dynamic) from 21.2.16 to 22.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/angular/angular/releases">@​angular/platform-browser-dynamic's releases</a>.</em></p>
<blockquote>
<h2>VSCode Extension: 22.0.0</h2>
<h3>Breaking Changes</h3>
<p>The extension now bundles TypeScript version 6.0, which itself includes breaking
changes, including <a href="https://www.typescriptlang.org/docs/handbook/release-notes/typescript-6-0.html#simple-default-changes">new defaults</a> such as <code>strict</code> being <code>true</code>. You will need to explicitly set
<code>&quot;strict&quot;: false</code> in your <code>tsconfig.json</code>. Alternatively, the extension supports configuring the <code>tsdk</code> in the <a href="https://code.visualstudio.com/docs/typescript/typescript-transpiling#_using-the-workspace-version-of-typescript">same way</a> as the built in TS/JS extension.</p>
<h3>Fixes and features</h3>
<ul>
<li>fix(language-service): Add support for <code>@Input</code> with transforms (<a href="dc9c72da9b">dc9c72da9b</a>)</li>
<li>feat(language-service): add Document Symbols support for Angular templates (<a href="cfd0f9950c">cfd0f9950c</a>)</li>
<li>feat(language-service): add angular template inlay hints support (<a href="5a6d88626b">5a6d88626b</a>)</li>
<li>feat(language-service): Add support for idle timeout in defer blocks (<a href="c6f98c723c">c6f98c723c</a>)</li>
</ul>
<h2>22.0.0</h2>
<h3>compiler</h3>
<table>
<thead>
<tr>
<th>Commit</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="47fcbc4704"><img src="https://img.shields.io/badge/47fcbc4704-feat-blue" alt="feat - 47fcbc4704" /></a></td>
<td>allow safe navigation to correctly narrow down nullables</td>
</tr>
<tr>
<td><a href="2896c93cc1"><img src="https://img.shields.io/badge/2896c93cc1-feat-blue" alt="feat - 2896c93cc1" /></a></td>
<td>Angular expressions with optional chaining returns <code>undefined</code></td>
</tr>
<tr>
<td><a href="e850643b1b"><img src="https://img.shields.io/badge/e850643b1b-feat-blue" alt="feat - e850643b1b" /></a></td>
<td>Support comments in html element.</td>
</tr>
<tr>
<td><a href="96be4f429b"><img src="https://img.shields.io/badge/96be4f429b-fix-green" alt="fix - 96be4f429b" /></a></td>
<td>abstract emitter producing incorrect code for dynamic imports</td>
</tr>
<tr>
<td><a href="488d962bc7"><img src="https://img.shields.io/badge/488d962bc7-fix-green" alt="fix - 488d962bc7" /></a></td>
<td>Don't bind inputs/outputs for <code>data-</code> attributes</td>
</tr>
<tr>
<td><a href="2c5aabb9da"><img src="https://img.shields.io/badge/2c5aabb9da-fix-green" alt="fix - 2c5aabb9da" /></a></td>
<td>don't escape dollar sign in literal expression</td>
</tr>
<tr>
<td><a href="c7aef8ec5d"><img src="https://img.shields.io/badge/c7aef8ec5d-fix-green" alt="fix - c7aef8ec5d" /></a></td>
<td>enforce parentheses containing arguments for :host-context</td>
</tr>
<tr>
<td><a href="b225a5d902"><img src="https://img.shields.io/badge/b225a5d902-fix-green" alt="fix - b225a5d902" /></a></td>
<td>invalid type checking code if field name needs to be quoted</td>
</tr>
<tr>
<td><a href="ab9154ab75"><img src="https://img.shields.io/badge/ab9154ab75-fix-green" alt="fix - ab9154ab75" /></a></td>
<td>normalize tag names with custom namespaces in DomElementSchemaRegistry (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser-dynamic/issues/68868">#68868</a>)</td>
</tr>
<tr>
<td><a href="8a1533c9ad"><img src="https://img.shields.io/badge/8a1533c9ad-fix-green" alt="fix - 8a1533c9ad" /></a></td>
<td>preserve leading commas in animation definitions</td>
</tr>
<tr>
<td><a href="194f723f66"><img src="https://img.shields.io/badge/194f723f66-fix-green" alt="fix - 194f723f66" /></a></td>
<td>remove dedicated support for legacy shadow DOM selectors</td>
</tr>
<tr>
<td><a href="4c25a42e98"><img src="https://img.shields.io/badge/4c25a42e98-fix-green" alt="fix - 4c25a42e98" /></a></td>
<td>remove deprecated shadow CSS encapsulation polyfills</td>
</tr>
<tr>
<td><a href="6ff620a033"><img src="https://img.shields.io/badge/6ff620a033-fix-green" alt="fix - 6ff620a033" /></a></td>
<td>sanitize dynamic href and xlink:href bindings on SVG a elements (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser-dynamic/issues/68868">#68868</a>)</td>
</tr>
<tr>
<td><a href="7dc1017e51"><img src="https://img.shields.io/badge/7dc1017e51-fix-green" alt="fix - 7dc1017e51" /></a></td>
<td>simplify handling of colon host with a selector list</td>
</tr>
<tr>
<td><a href="d99ab0e040"><img src="https://img.shields.io/badge/d99ab0e040-fix-green" alt="fix - d99ab0e040" /></a></td>
<td>stop generating unused field</td>
</tr>
<tr>
<td><a href="03db2aefaa"><img src="https://img.shields.io/badge/03db2aefaa-fix-green" alt="fix - 03db2aefaa" /></a></td>
<td>throw on duplicate input/outputs</td>
</tr>
<tr>
<td><a href="786ef8261f"><img src="https://img.shields.io/badge/786ef8261f-fix-green" alt="fix - 786ef8261f" /></a></td>
<td>throw on invalid in expressions</td>
</tr>
<tr>
<td><a href="ccb7d427e4"><img src="https://img.shields.io/badge/ccb7d427e4-fix-green" alt="fix - ccb7d427e4" /></a></td>
<td>type check invalid for loops</td>
</tr>
</tbody>
</table>
<h3>compiler-cli</h3>
<table>
<thead>
<tr>
<th>Commit</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="b8d3f36ed9"><img src="https://img.shields.io/badge/b8d3f36ed9-feat-blue" alt="feat - b8d3f36ed9" /></a></td>
<td>add support for Node.js 26.0.0</td>
</tr>
<tr>
<td><a href="7f9450219f"><img src="https://img.shields.io/badge/7f9450219f-feat-blue" alt="feat - 7f9450219f" /></a></td>
<td>Adds warning for prefetch without main defer trigger</td>
</tr>
<tr>
<td><a href="2eae497a04"><img src="https://img.shields.io/badge/2eae497a04-feat-blue" alt="feat - 2eae497a04" /></a></td>
<td>support external TCBs with copied content in specific mode</td>
</tr>
<tr>
<td><a href="e5f96c2d88"><img src="https://img.shields.io/badge/e5f96c2d88-fix-green" alt="fix - e5f96c2d88" /></a></td>
<td>animation events not type checked properly when bound through HostListener decorator</td>
</tr>
<tr>
<td><a href="9218140348"><img src="https://img.shields.io/badge/9218140348-fix-green" alt="fix - 9218140348" /></a></td>
<td>resolve TCB mapping failure for safe property reads with as any</td>
</tr>
<tr>
<td><a href="7a0d6b8df2"><img src="https://img.shields.io/badge/7a0d6b8df2-fix-green" alt="fix - 7a0d6b8df2" /></a></td>
<td>transform dropping exclamationToken from properties</td>
</tr>
<tr>
<td><a href="ca67828ee2"><img src="https://img.shields.io/badge/ca67828ee2-refactor-yellow" alt="refactor - ca67828ee2" /></a></td>
<td>introduce NG8023 compile-time diagnostic for duplicate selectors</td>
</tr>
</tbody>
</table>
<h3>core</h3>
<table>
<thead>
<tr>
<th>Commit</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="17d3ea44e2"><img src="https://img.shields.io/badge/17d3ea44e2-feat-blue" alt="feat - 17d3ea44e2" /></a></td>
<td>add <code>IdleRequestOptions</code> support to <code>IdleService</code></td>
</tr>
<tr>
<td><a href="3b0ae5fef0"><img src="https://img.shields.io/badge/3b0ae5fef0-feat-blue" alt="feat - 3b0ae5fef0" /></a></td>
<td>add <code>provideWebMcpTools</code></td>
</tr>
</tbody>
</table>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/angular/angular/blob/main/CHANGELOG.md">@​angular/platform-browser-dynamic's changelog</a>.</em></p>
<blockquote>
<h1>22.0.0 (2026-06-03)</h1>
<p><a href="https://goo.gle/angular-v22-blog">Blog post &quot;Announcing Angular v22&quot;</a>.</p>
<h2>Breaking Changes</h2>
<h3>compiler</h3>
<ul>
<li>This change will trigger the <code>nullishCoalescingNotNullable</code> and <code>optionalChainNotNullable</code> diagnostics on exisiting projects.
You might want to disable those 2 diagnotiscs in your <code>tsconfig</code> temporarily.</li>
<li>data prefixed attribute no-longer bind inputs nor outputs.</li>
<li>The compiler will throw when there a when inputs, outputs or model are binding to the same input/outputs.</li>
<li><code>in</code> variables will throw in template expressions.</li>
</ul>
<h3>compiler-cli</h3>
<ul>
<li>Elements with multiple matching selectors will now throw at compile time.</li>
</ul>
<h3>core</h3>
<ul>
<li>The second arguement of appRef.bootstrap does not accept <code>any</code> anymore. Make sure the element you pass is not nullable.</li>
<li>
<ul>
<li>TypeScript versions older than 6.0 are no longer supported.</li>
</ul>
</li>
<li>Leave animations are no longer limited to the element being removed.</li>
<li>Component with undefined <code>changeDetection</code> property are now <code>OnPush</code> by default. Specify <code>changeDetection: ChangeDetectionStrategy.Eager</code> to keep the previous behavior.</li>
<li>change AnimationCallbackEvent.animationComplete signature</li>
<li><code>ChangeDetectorRef.checkNoChanges</code> was removed. In tests use <code>fixture.detectChanges()</code> instead.</li>
<li><code>createNgModuleRef</code> was removed, use <code>createNgModule</code> instead</li>
<li><code>ComponentFactoryResolver</code> and <code>ComponentFactory</code> are no longer available. Pass the component class directly to APIs that previously required a factory, such as <code>ViewContainerRef.createComponent</code> or use the standalone <code>createComponentFunction</code>.</li>
<li><code>ComponentFactoryResolver</code> and <code>ComponentFactory</code> are no longer available. Pass the component class directly to APIs that previously required a factory, such as <code>ViewContainerRef.createComponent</code> or use the standalone <code>createComponent</code> function.</li>
</ul>
<h3>forms</h3>
<ul>
<li><code>min</code> and <code>max</code> validation rules no longer support
string values. Bound values must be numbers or null.</li>
</ul>
<h3>http</h3>
<ul>
<li>Use the <code>HttpXhrBackend</code> with <code>provideHttpClient(withXhr)</code> if you want to keep supporting upload progress reports.</li>
</ul>
<h3>platform-browser</h3>
<ul>
<li>This removes styles when they appear to no longer be used by an associated <code>host</code>. However other DOM on the page may still be affected by those styles if not leveraging <code>ViewEncapsulation.Emulated</code> or if those styles are used by elements outside of Angular, potentially causing other DOM to appear unstyled.</li>
<li>Hammer.js integration has been removed. Use your own implementation.</li>
</ul>
<h3>router</h3>
<ul>
<li>
<p>The return type for <code>TitleStrategy.getResolvedTitleForRoute</code>
was previously 'any' while the actual return type could only be either <code>string</code>
or <code>undefined</code>. The return type now reflects the possible values correctly.
Code that reads the value may need to be adjusted.</p>
<p>(cherry picked from commit ad37f52c1212164c51ffcc533067af05c2c33c89)</p>
</li>
<li>
<p>The <code>currentSnapshot</code> parameter in <code>CanMatchFn</code> and the <code>canMatch</code> method of the <code>CanMatch</code> interface is now required. While this was already the behavior of the Router at runtime, existing class implementations of <code>CanMatch</code> must now include the third argument to satisfy the interface.</p>
</li>
<li>
<p>paramsInheritanceStrategy now defaults to 'always'</p>
<p>The default value of paramsInheritanceStrategy has been changed from 'emptyOnly' to 'always'. This means that route parameters are inherited from all parent routes by default. To restore the previous behavior, set paramsInheritanceStrategy to 'emptyOnly' in your router configuration.</p>
</li>
<li>
<p><code>provideRoutes()</code> has been removed. Use <code>provideRouter()</code> or <code>ROUTES</code> as multi token if necessary.</p>
</li>
</ul>
<h3>upgrade</h3>
<ul>
<li>Deprecated <code>getAngularLib</code>/<code>setAngularLib</code> have been removed use <code>getAngularJSGlobal</code>/<code>setAngularJSGlobal</code> instead.</li>
</ul>
<h2>Deprecations</h2>
<h3>http</h3>
<ul>
<li><code>withFetch</code> is now deprecated, it can be safely removed.</li>
<li>The <code>reportProgress</code> option is deprecated please use <code>reportUploadProgress</code> &amp;  <code>reportDownloadProgress</code> instead.</li>
</ul>
<h3>compiler</h3>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="a97d5ec22d"><code>a97d5ec</code></a> build: update minimum supported Node.js versions</li>
<li><a href="b8d3f36ed9"><code>b8d3f36</code></a> feat(compiler-cli): add support for Node.js 26.0.0</li>
<li><a href="4ad3a1fe37"><code>4ad3a1f</code></a> refactor(core): Don't throw when there are not async metadata</li>
<li><a href="7f3f3d7da1"><code>7f3f3d7</code></a> ci: remove remainings of saucelabs tests</li>
<li><a href="d550bf713a"><code>d550bf7</code></a> build: update minimum supported Node.js versions</li>
<li>See full diff in <a href="https://github.com/angular/angular/commits/v22.0.0/packages/platform-browser-dynamic">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@angular/platform-browser-dynamic&package-manager=npm_and_yarn&previous-version=21.2.16&new-version=22.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>
2026-06-04 06:44:01 +00:00
2026-02-09 15:37:25 -08:00
2025-11-12 11:46:47 -08:00
2025-11-12 11:46:47 -08:00
2026-04-14 16:49:05 -07:00
2022-05-10 15:08:43 +02:00
2018-06-08 14:36:44 -07:00
2026-04-23 09:42:27 -07:00
2026-04-23 09:42:27 -07:00

Flutter samples

Build Status

A collection of open source samples that illustrate best practices for Flutter.

Contributing

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.

Googler's, you can freely add samples to the flutter/demos repository.

Index

Quickstarts

  • asset_transformation - Demonstrates how to transform images' color scales and formats.
  • background_isolate_channels - Demonstrates how to use long-lived isolates.
  • cupertino_gallery - A gallery of Cupertino widgets, demonstrating iOS-style UI components in Flutter.
  • date_planner - An in-progress exploration of an iOS-style Date Planner app, similar to the SwiftUI Tutorial app.
  • desktop_photo_search - Demonstrates desktop features in both Material and FluentUI design systems.
  • dynamic_theme - A developer sample demonstrating how to call on-device Flutter APIs based on output from the Gemini API.
  • form_app - A sample demonstrating different types of forms and best practices.
  • google_maps - Demonstrates the Google Maps for Flutter plugin.
  • navigation_and_routing - A sample that shows how to use go_router API to handle common navigation scenarios.
  • pedometer - A demo of a plugin that leverages FFIgen & JNIgen to call platform APIs directly from Dart code.
  • platform_design - This sample project shows a Flutter app that maximizes application code reuse while adhering to different design patterns on Android and iOS.
  • simple_sdf - A simple Flutter fragment shaders sample project showing how to draw Signed Distance Functions with the FragmentShader API.
  • simple_shader - A simple Flutter fragment shaders sample project.
  • testing_app - A sample app that shows different types of testing in Flutter.
  • web_embedding - This directory contains examples of how to embed Flutter in web apps (without iframes).
    • element_embedding_demo - Modifies the index.html of a flutter app so it is launched in a custom hostElement. This is the most basic embedding example.
    • ng-flutter - A simple Angular app (and component) that replicates the above example, but in an Angular style.

Native platform samples

  • add-to-app - Collection of samples that demonstrate embedding Flutter a view into a native app.
    • fullscreen — Embeds a full screen instance of Flutter into an existing iOS or Android app.
    • prebuilt_module — Embeds a full screen instance of Flutter as a prebuilt library that can be loaded into an existing iOS or Android app.
    • plugin — Embeds a full screen Flutter instance that is using plugins into an existing iOS or Android app.
    • books — Mimics a real world use-case of embedding Flutter into an existing Android app and demonstrates using Pigeon to communicate between Flutter and the host application.
    • multiple_flutters — Shows the usage of the Flutter Engine Group APIs to embed multiple instances of Flutter into an existing app with low memory cost.
    • android_view — Shows how to integrate a Flutter add-to-app module at a view level for Android.
  • android_splash_screen
  • ios_app_clip
  • platform_channels - A sample app which demonstrates how to use MethodChannel, EventChannel, BasicMessageChannel and MessageCodec in Flutter.
  • platform_view_swift - A Flutter sample app that combines a native iOS UIViewController with a full-screen Flutter view.

Demo galleries

Demo apps

Flutter sample code

Samples are correct and concise code that developers can quickly understand and easily reuse with minimal side effects. Samples teach developers how to be successful using Flutter and Dart. They are maintained on an ongoing basis to reflect changing APIs and best practices.

Types of samples

There are two types of sample code in this repository:

  • Quickstarts provide a starting point to extend. They answer the question, "What is the minimal amount of code needed to implement this feature?"
  • Demo apps are meant to be built and ran. They demo the product, not how to write code.

A majority of samples in this repository are quickstarts.

Usage

Every sample in this repo is fully runnable. To run an example, use flutter run inside that example's directory. See the getting started guide to install the flutter tool.

Important

If you want to run an add-to-app sample, there are additional requirements. We suggest reading the add-to-app documentation.

Interested in contributing?

See the contributor's guide!

Questions or issues?

If you have a general question about one of these samples or how to adapt its techniques for one of your own apps, try one of these resources:

If you run into a bug in one of the samples, please file an issue in the flutter/samples issue tracker.

Description
No description provided
Readme 1 GiB
Languages
Dart 71%
C++ 11.4%
CMake 8.7%
Kotlin 2.2%
Swift 1.9%
Other 4.8%