text
stringlengths
6
13.6M
id
stringlengths
13
176
metadata
dict
__index_level_0__
int64
0
1.69k
samples: - name: Kittens screenshots: - url: https://placekitten.com/500/500 alt: a kitten - url: https://placekitten.com/400/400 alt: another kitten source: https://github.com/johnpryan/kittens description: A sample kitten app difficulty: beginner widgets: - Anim...
samples/web/samples_index/test/yaml/single.yaml/0
{ "file_path": "samples/web/samples_index/test/yaml/single.yaml", "repo_id": "samples", "token_count": 235 }
1,269
name: element_embedding_demo description: A small app to be embedded into a HTML element (see web/index.html) publish_to: 'none' version: 1.0.0+1 environment: sdk: ^3.2.0 dependencies: cupertino_icons: ^1.0.2 flutter: sdk: flutter js: ^0.7.0 dev_dependencies: flutter_test: sdk: flutter flutter_li...
samples/web_embedding/element_embedding_demo/pubspec.yaml/0
{ "file_path": "samples/web_embedding/element_embedding_demo/pubspec.yaml", "repo_id": "samples", "token_count": 173 }
1,270
{ "name": "element_embedding_demo", "short_name": "element_embedding", "start_url": ".", "display": "standalone", "background_color": "#0175C2", "theme_color": "#0175C2", "description": "An example of how to embed a Flutter Web app into any HTML Element of a page.", "orientation": "portr...
samples/web_embedding/element_embedding_demo/web/manifest.json/0
{ "file_path": "samples/web_embedding/element_embedding_demo/web/manifest.json", "repo_id": "samples", "token_count": 533 }
1,271
import 'dart:js_interop'; import 'package:web/web.dart'; /// Locates the root of the flutter app (for now, the first element that has /// a flt-renderer tag), and dispatches a JS event named [name] with [data]. void broadcastAppEvent(String name, JSObject data) { final HTMLElement? root = document.querySelector('[fl...
samples/web_embedding/ng-flutter/flutter/lib/src/js_interop/helper.dart/0
{ "file_path": "samples/web_embedding/ng-flutter/flutter/lib/src/js_interop/helper.dart", "repo_id": "samples", "token_count": 183 }
1,272
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>NgFlutter</title> <base href="/"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preco...
samples/web_embedding/ng-flutter/src/index.html/0
{ "file_path": "samples/web_embedding/ng-flutter/src/index.html", "repo_id": "samples", "token_count": 253 }
1,273
# This is a list of some of the Flutter website's contributors. # To see the full list of contributors, see the revision history in # source control with a command like: git shortlog -sne # # Names should be added to the list like so: # # Name/Organization <email address> Google Inc. Faisal Abid <faisal.abid@gmail....
website/AUTHORS/0
{ "file_path": "website/AUTHORS", "repo_id": "website", "token_count": 232 }
1,274
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. // Demonstrates a basic shared element (Hero) animation. import 'package:flutter/material.dart'; class BasicHeroAnimation extends StatelessWidget { co...
website/examples/_animation/basic_hero_animation/lib/main.dart/0
{ "file_path": "website/examples/_animation/basic_hero_animation/lib/main.dart", "repo_id": "website", "token_count": 1045 }
1,275
import 'package:flutter/material.dart'; void drawerStart() { // #docregion DrawerStart Scaffold( appBar: AppBar( title: const Text('AppBar without hamburger button'), ), drawer: null, // Add a Drawer here in the next step. ); // #enddocregion DrawerStart } void drawerEmpty() { // #docregio...
website/examples/cookbook/design/drawer/lib/drawer.dart/0
{ "file_path": "website/examples/cookbook/design/drawer/lib/drawer.dart", "repo_id": "website", "token_count": 936 }
1,276
import 'package:flutter/material.dart'; void main() => runApp(const SnackBarDemo()); class SnackBarDemo extends StatelessWidget { const SnackBarDemo({super.key}); @override Widget build(BuildContext context) { // #docregion Scaffold return MaterialApp( title: 'SnackBar Demo', home: Scaffold...
website/examples/cookbook/design/snackbars/lib/partial.dart/0
{ "file_path": "website/examples/cookbook/design/snackbars/lib/partial.dart", "repo_id": "website", "token_count": 484 }
1,277
import 'package:flutter/material.dart'; // #docregion DownloadButton @immutable class DownloadButton extends StatelessWidget { const DownloadButton({ super.key, }); @override Widget build(BuildContext context) { // TODO: return const SizedBox(); } } // #enddocregion DownloadButton
website/examples/cookbook/effects/download_button/lib/stateful_widget.dart/0
{ "file_path": "website/examples/cookbook/effects/download_button/lib/stateful_widget.dart", "repo_id": "website", "token_count": 98 }
1,278
import 'dart:ui' as ui; import 'package:flutter/material.dart'; @immutable class BubbleBackground extends StatelessWidget { const BubbleBackground({ super.key, required this.colors, this.child, }); final List<Color> colors; final Widget? child; @override Widget build(BuildContext context) { ...
website/examples/cookbook/effects/gradient_bubbles/lib/bubble_background.dart/0
{ "file_path": "website/examples/cookbook/effects/gradient_bubbles/lib/bubble_background.dart", "repo_id": "website", "token_count": 1113 }
1,279
import 'package:flutter/material.dart'; @immutable class LocationListItem extends StatelessWidget { const LocationListItem({ super.key, required this.imageUrl, required this.name, required this.country, }); final String imageUrl; final String name; final String country; @override Widget...
website/examples/cookbook/effects/parallax_scrolling/lib/excerpt3.dart/0
{ "file_path": "website/examples/cookbook/effects/parallax_scrolling/lib/excerpt3.dart", "repo_id": "website", "token_count": 1645 }
1,280
import 'package:flutter/material.dart'; // #docregion CircleListItem class CircleListItem extends StatelessWidget { const CircleListItem({super.key}); @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8), child: Container(...
website/examples/cookbook/effects/shimmer_loading/lib/main.dart/0
{ "file_path": "website/examples/cookbook/effects/shimmer_loading/lib/main.dart", "repo_id": "website", "token_count": 2170 }
1,281
// ignore_for_file: unused_element import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import './excerpt1.dart'; // #docregion TypingIndicatorState class _TypingIndicatorState extends State<TypingIndicator> with TickerProviderStateMixin { late AnimationController _appearanceControl...
website/examples/cookbook/effects/typing_indicator/lib/excerpt2.dart/0
{ "file_path": "website/examples/cookbook/effects/typing_indicator/lib/excerpt2.dart", "repo_id": "website", "token_count": 692 }
1,282
name: retrieve_input description: Sample code for retrieve_input cookbook recipe. environment: sdk: ^3.3.0 dependencies: flutter: sdk: flutter dev_dependencies: example_utils: path: ../../../example_utils flutter: uses-material-design: true
website/examples/cookbook/forms/retrieve_input/pubspec.yaml/0
{ "file_path": "website/examples/cookbook/forms/retrieve_input/pubspec.yaml", "repo_id": "website", "token_count": 93 }
1,283
This is a stripped down version of the multiplayer sample in https://github.com/flutter/games/tree/main/samples/multiplayer.
website/examples/cookbook/games/firestore_multiplayer/README.md/0
{ "file_path": "website/examples/cookbook/games/firestore_multiplayer/README.md", "repo_id": "website", "token_count": 34 }
1,284
import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { const title = 'Gesture Demo'; return const MaterialApp( title: title, home: MyHomePage(title: title),...
website/examples/cookbook/gestures/handling_taps/lib/main.dart/0
{ "file_path": "website/examples/cookbook/gestures/handling_taps/lib/main.dart", "repo_id": "website", "token_count": 558 }
1,285
import 'package:flutter/material.dart'; void main() { runApp( MyApp( // #docregion Items items: List<String>.generate(10000, (i) => 'Item $i'), // #enddocregion Items ), ); } class MyApp extends StatelessWidget { final List<String> items; const MyApp({super.key, required this.items}...
website/examples/cookbook/lists/long_lists/lib/main.dart/0
{ "file_path": "website/examples/cookbook/lists/long_lists/lib/main.dart", "repo_id": "website", "token_count": 436 }
1,286
import 'package:flutter/material.dart'; class Todo { final String title; final String description; const Todo(this.title, this.description); } // #docregion TodosScreen class TodosScreen extends StatelessWidget { // Requiring the list of todos. const TodosScreen({super.key, required this.todos}); final ...
website/examples/cookbook/navigation/passing_data/lib/main_todoscreen.dart/0
{ "file_path": "website/examples/cookbook/navigation/passing_data/lib/main_todoscreen.dart", "repo_id": "website", "token_count": 343 }
1,287
import 'dart:async'; import 'package:http/http.dart' as http; // #docregion deleteAlbum Future<http.Response> deleteAlbum(String id) async { final http.Response response = await http.delete( Uri.parse('https://jsonplaceholder.typicode.com/albums/$id'), headers: <String, String>{ 'Content-Type': 'appli...
website/examples/cookbook/networking/delete_data/lib/main_step1.dart/0
{ "file_path": "website/examples/cookbook/networking/delete_data/lib/main_step1.dart", "repo_id": "website", "token_count": 147 }
1,288
import 'package:flutter/material.dart'; import 'package:web_socket_channel/web_socket_channel.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { const title = 'WebSocket Demo'; return const Material...
website/examples/cookbook/networking/web_sockets/lib/main.dart/0
{ "file_path": "website/examples/cookbook/networking/web_sockets/lib/main.dart", "repo_id": "website", "token_count": 992 }
1,289
name: mocking description: Use the Mockito package to mimic the behavior of services for testing. environment: sdk: ^3.3.0 dependencies: flutter: sdk: flutter flutter_localizations: sdk: flutter http: ^1.2.0 dev_dependencies: example_utils: path: ../../../../example_utils flutter_test: sd...
website/examples/cookbook/testing/unit/mocking/pubspec.yaml/0
{ "file_path": "website/examples/cookbook/testing/unit/mocking/pubspec.yaml", "repo_id": "website", "token_count": 162 }
1,290
// #docregion ScrollWidgetTest // This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read...
website/examples/cookbook/testing/widget/scrolling/test/widget_test.dart/0
{ "file_path": "website/examples/cookbook/testing/widget/scrolling/test/widget_test.dart", "repo_id": "website", "token_count": 378 }
1,291
class User { final String name; final String email; User(this.name, this.email); User.fromJson(Map<String, dynamic> json) : name = json['name'] as String, email = json['email'] as String; Map<String, dynamic> toJson() => { 'name': name, 'email': email, }; }
website/examples/development/data-and-backend/json/lib/manual/user.dart/0
{ "file_path": "website/examples/development/data-and-backend/json/lib/manual/user.dart", "repo_id": "website", "token_count": 126 }
1,292
// #docregion Import import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; // #enddocregion Import class VirtualDisplayWidget extends StatelessWidget { const VirtualDisplayWidget({super.key}); @override // #docregion VirtualDisplayWidget Widget build(BuildContext context) { // Th...
website/examples/development/platform_integration/lib/platform_views/native_view_example_2.dart/0
{ "file_path": "website/examples/development/platform_integration/lib/platform_views/native_view_example_2.dart", "repo_id": "website", "token_count": 244 }
1,293
import 'package:flutter/material.dart'; //---------------------------- ParentWidget ---------------------------- class ParentWidget extends StatefulWidget { const ParentWidget({super.key}); @override State<ParentWidget> createState() => _ParentWidgetState(); } class _ParentWidgetState extends State<ParentWidg...
website/examples/development/ui/interactive/lib/mixed.dart/0
{ "file_path": "website/examples/development/ui/interactive/lib/mixed.dart", "repo_id": "website", "token_count": 928 }
1,294
import 'package:flutter/material.dart'; void main() { runApp(const FadeAppTest()); } class FadeAppTest extends StatelessWidget { const FadeAppTest({super.key}); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Fade Demo', ...
website/examples/get-started/flutter-for/android_devs/lib/animation.dart/0
{ "file_path": "website/examples/get-started/flutter-for/android_devs/lib/animation.dart", "repo_id": "website", "token_count": 649 }
1,295
import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; class MyWidget extends StatelessWidget { const MyWidget({super.key}); @override Widget build(BuildContext context) { return // #docregion AccessString Text(AppLocalizations.of(context)!.hell...
website/examples/get-started/flutter-for/android_devs/lib/localization_examples.dart/0
{ "file_path": "website/examples/get-started/flutter-for/android_devs/lib/localization_examples.dart", "repo_id": "website", "token_count": 132 }
1,296
import 'dart:async' show Future; import 'package:flutter/services.dart' show rootBundle; Future<String> loadAsset() async { return await rootBundle.loadString('my-assets/data.json'); }
website/examples/get-started/flutter-for/ios_devs/lib/asset_bundle.dart/0
{ "file_path": "website/examples/get-started/flutter-for/ios_devs/lib/asset_bundle.dart", "repo_id": "website", "token_count": 62 }
1,297
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; void main() { runApp( const App(), ); } class App extends StatelessWidget { const App({ super.key, }); @override Widget build(BuildContext context) { return const CupertinoApp( home: HomePage(), ); } ...
website/examples/get-started/flutter-for/ios_devs/lib/list.dart/0
{ "file_path": "website/examples/get-started/flutter-for/ios_devs/lib/list.dart", "repo_id": "website", "token_count": 351 }
1,298
import 'package:flutter/material.dart'; // #docregion Strings class Strings { static const String welcomeMessage = 'Welcome To Flutter'; } // #enddocregion Strings class MyWidget extends StatelessWidget { const MyWidget({super.key}); @override Widget build(BuildContext context) { return // #docre...
website/examples/get-started/flutter-for/ios_devs/lib/string_examples.dart/0
{ "file_path": "website/examples/get-started/flutter-for/ios_devs/lib/string_examples.dart", "repo_id": "website", "token_count": 139 }
1,299
// ignore_for_file: unused_import // #docregion Imports import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:my_widgets/my_widgets.dart'; // #enddocregion Imports
website/examples/get-started/flutter-for/react_native_devs/lib/imports.dart/0
{ "file_path": "website/examples/get-started/flutter-for/react_native_devs/lib/imports.dart", "repo_id": "website", "token_count": 87 }
1,300
import 'package:flutter/material.dart'; // #docregion CustomButton class CustomButton extends StatelessWidget { const CustomButton(this.label, {super.key}); final String label; @override Widget build(BuildContext context) { return ElevatedButton( onPressed: () {}, child: Text(label), ); ...
website/examples/get-started/flutter-for/xamarin_devs/lib/custom_button.dart/0
{ "file_path": "website/examples/get-started/flutter-for/xamarin_devs/lib/custom_button.dart", "repo_id": "website", "token_count": 207 }
1,301
import 'package:flutter/material.dart'; class MyWidget extends StatelessWidget { const MyWidget({super.key}); // #docregion Padding @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('Sample App')), body: Center( child: ElevatedButton( ...
website/examples/get-started/flutter-for/xamarin_devs/lib/padding.dart/0
{ "file_path": "website/examples/get-started/flutter-for/xamarin_devs/lib/padding.dart", "repo_id": "website", "token_count": 239 }
1,302
import 'package:integration_test/integration_test_driver.dart'; Future<void> main() => integrationDriver();
website/examples/integration_test/test_driver/integration_test_driver.dart/0
{ "file_path": "website/examples/integration_test/test_driver/integration_test_driver.dart", "repo_id": "website", "token_count": 32 }
1,303
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // A simple example of localizing a Flutter app written with the // Dart intl package (see https://pub.dev/packages/intl). // // Spanish and English (loca...
website/examples/internationalization/intl_example/lib/main.dart/0
{ "file_path": "website/examples/internationalization/intl_example/lib/main.dart", "repo_id": "website", "token_count": 1378 }
1,304
Examples referenced in ["Layouts in Flutter"](https://docs.flutter.dev/ui/layout) that come from the now-archived [Flutter Gallery](https://docs.flutter.dev/gallery). They are mostly the same with a few updates to run standalone, use new language features, and follow modern Dart/Flutter style. These should eventually ...
website/examples/layout/gallery/README.md/0
{ "file_path": "website/examples/layout/gallery/README.md", "repo_id": "website", "token_count": 102 }
1,305
// Copyright 2019 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 'package:animations/animations.dart'; import 'package:flutter/material.dart'; class BottomNavigationDemo extends StatefulWidget { const BottomNaviga...
website/examples/layout/gallery/lib/bottom_navigation_demo.dart/0
{ "file_path": "website/examples/layout/gallery/lib/bottom_navigation_demo.dart", "repo_id": "website", "token_count": 2214 }
1,306
// #docregion PassAppData import 'dart:convert'; import 'dart:developer' as developer; void main() { var myCustomObject = MyCustomObject(); developer.log( 'log me', name: 'my.app.category', error: jsonEncode(myCustomObject), ); } // #enddocregion PassAppData class MyCustomObject {}
website/examples/testing/code_debugging/lib/app_data.dart/0
{ "file_path": "website/examples/testing/code_debugging/lib/app_data.dart", "repo_id": "website", "token_count": 106 }
1,307
import 'package:flutter/material.dart'; class ProblemWidget extends StatelessWidget { const ProblemWidget({super.key}); @override // #docregion Problem Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( title: const Text('Unbounded Width of the...
website/examples/testing/common_errors/lib/unbounded_width.dart/0
{ "file_path": "website/examples/testing/common_errors/lib/unbounded_width.dart", "repo_id": "website", "token_count": 411 }
1,308
import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return const MaterialApp( title: 'Counter App', home: MyHomePage(title: 'Counter App Home Page'), ); ...
website/examples/testing/integration_tests/how_to/lib/main.dart/0
{ "file_path": "website/examples/testing/integration_tests/how_to/lib/main.dart", "repo_id": "website", "token_count": 642 }
1,309
import 'package:bitsdojo_window/bitsdojo_window.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import '../app_model.dart'; import '../global/device_type.dart'; class AppTitleBar extends StatelessWidget { const AppTitleBar({super.key}); @override Widget build(BuildContex...
website/examples/ui/layout/adaptive_app_demos/lib/widgets/app_title_bar.dart/0
{ "file_path": "website/examples/ui/layout/adaptive_app_demos/lib/widgets/app_title_bar.dart", "repo_id": "website", "token_count": 1045 }
1,310
- name: Get started description: Set up your environment and start building. url: /get-started/install - name: Widget catalog description: Dip into the rich set of Flutter widgets available in the SDK. url: /ui/widgets - name: API docs description: Bookmark the API reference docs for the Flutter framework. ...
website/src/_data/docs_cards.yml/0
{ "file_path": "website/src/_data/docs_cards.yml", "repo_id": "website", "token_count": 193 }
1,311
{{site.alert.important}} If you develop apps in China, check out [using Flutter in China][]. {{site.alert.end}} [using Flutter in China]: /community/china
website/src/_includes/docs/china-notice.md/0
{ "file_path": "website/src/_includes/docs/china-notice.md", "repo_id": "website", "token_count": 49 }
1,312
## Manage your Flutter SDK To learn more about managing your Flutter SDK install, consult the following resources. {% assign doctor = site.data.doctor %} {% assign config = site.data.doctor[include.config] %} {% assign target = include.target | remove: 'mobile-' | downcase %} {% assign devos = include.devos %} {% if ...
website/src/_includes/docs/install/next-steps.md/0
{ "file_path": "website/src/_includes/docs/install/next-steps.md", "repo_id": "website", "token_count": 657 }
1,313
{% assign target = include.target %} {% assign os = include.os %} {% include docs/install/admonitions/install-in-order.md %} ## Verify system requirements To install and run Flutter, your {{os}} environment must meet the following hardware and software requirements. ### Hardware requirements Your {{os}} Flutter de...
website/src/_includes/docs/install/reqs/windows/base.md/0
{ "file_path": "website/src/_includes/docs/install/reqs/windows/base.md", "repo_id": "website", "token_count": 1223 }
1,314
## Profile or release runs {{site.alert.important}} Do _not_ test the performance of your app with debug and hot reload enabled. {{site.alert.end}} So far you've been running your app in *debug* mode. Debug mode trades performance for useful developer features such as hot reload and step debugging. It's not unexp...
website/src/_includes/docs/run-profile.md/0
{ "file_path": "website/src/_includes/docs/run-profile.md", "repo_id": "website", "token_count": 216 }
1,315
require_relative 'code_excerpt_processor' module Jekyll module Converters # This converter does some markdown preprocessing before using [Kramdown] to # do the full markdown conversion (to HTML). # # Currently, the only preprocessing that is done is for code-excerpt # instructions. See [code_exc...
website/src/_plugins/markdown_with_code_excerpts.rb/0
{ "file_path": "website/src/_plugins/markdown_with_code_excerpts.rb", "repo_id": "website", "token_count": 554 }
1,316
@use '../base/variables' as *; @use '../vendor/bootstrap'; .site-footer { background-color: $site-color-footer; color: $site-color-white; padding: bootstrap.bs-spacer(5) 0; position: relative; z-index: bootstrap.$zindex-sticky; &__wrapper { align-items: center; display: flex; flex-direction: c...
website/src/_sass/components/_footer.scss/0
{ "file_path": "website/src/_sass/components/_footer.scss", "repo_id": "website", "token_count": 455 }
1,317
--- layout: toc title: Add Flutter to Android description: Content covering adding Flutter to existing Android apps. ---
website/src/add-to-app/android/index.md/0
{ "file_path": "website/src/add-to-app/android/index.md", "repo_id": "website", "token_count": 30 }
1,318
<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M0 0h24v24H0z" fill="none"/> <path d="M23 12l-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-...
website/src/assets/images/docs/ic_new_releases_black_24px.svg/0
{ "file_path": "website/src/assets/images/docs/ic_new_releases_black_24px.svg", "repo_id": "website", "token_count": 223 }
1,319
--- title: "Implicit animations" description: > Learn how to use Flutter's implicitly animated widgets through interactive examples and exercises. toc: true diff2html: true js: - defer: true url: https://old-dartpad-3ce3f.web.app/inject_embed.dart.js - defer: true url: /assets/js/codelabs/animations_exa...
website/src/codelabs/implicit-animations.md/0
{ "file_path": "website/src/codelabs/implicit-animations.md", "repo_id": "website", "token_count": 5363 }
1,320
--- title: Display a snackbar description: How to implement a snackbar to display messages. js: - defer: true url: https://old-dartpad-3ce3f.web.app/inject_embed.dart.js --- <?code-excerpt path-base="cookbook/design/snackbars/"?> It can be useful to briefly inform your users when certain actions take place. For...
website/src/cookbook/design/snackbars.md/0
{ "file_path": "website/src/cookbook/design/snackbars.md", "repo_id": "website", "token_count": 1661 }
1,321
--- title: Retrieve the value of a text field description: How to retrieve text from a text field. js: - defer: true url: https://old-dartpad-3ce3f.web.app/inject_embed.dart.js --- <?code-excerpt path-base="cookbook/forms/retrieve_input"?> In this recipe, learn how to retrieve the text a user has entered into a...
website/src/cookbook/forms/retrieve-input.md/0
{ "file_path": "website/src/cookbook/forms/retrieve-input.md", "repo_id": "website", "token_count": 1845 }
1,322
--- title: Cookbook description: > The Flutter cookbook provides recipes for many commonly performed tasks. show_breadcrumbs: false --- This cookbook contains recipes that demonstrate how to solve common problems while writing Flutter apps. Each recipe is self-contained and can be used as a reference to help you bu...
website/src/cookbook/index.md/0
{ "file_path": "website/src/cookbook/index.md", "repo_id": "website", "token_count": 1649 }
1,323
--- title: Send data to a new screen description: How to pass data to a new route. js: - defer: true url: https://old-dartpad-3ce3f.web.app/inject_embed.dart.js --- <?code-excerpt path-base="cookbook/navigation/passing_data"?> Often, you not only want to navigate to a new screen, but also pass data to the scree...
website/src/cookbook/navigation/passing-data.md/0
{ "file_path": "website/src/cookbook/navigation/passing-data.md", "repo_id": "website", "token_count": 4644 }
1,324
--- title: Add ads to your mobile Flutter app or game short-title: Show ads description: How to use the google_mobile_ads package to show ads in Flutter. --- <?code-excerpt path-base="cookbook/plugins/google_mobile_ads"?> {% comment %} This partly duplicates the AdMob documentation here: https://developers.google...
website/src/cookbook/plugins/google-mobile-ads.md/0
{ "file_path": "website/src/cookbook/plugins/google-mobile-ads.md", "repo_id": "website", "token_count": 4659 }
1,325
--- title: Who is Dash? description: Learn more about the Flutter and Dart mascot, Dash. --- This is Dash: ![Dash by herself](/assets/images/dash/Dash.png){:width="50%"}<br> Dash is the mascot for the Dart language and the Flutter framework. {{site.alert.note}} You can now make your **own** digital Dash using [...
website/src/dash/index.md/0
{ "file_path": "website/src/dash/index.md", "repo_id": "website", "token_count": 1922 }
1,326
--- title: Create flavors of a Flutter app short-title: Flavors description: > How to create build flavors specific to different release types or development environments. --- ## What are flavors Have you ever wondered how to set up different environments in your Flutter app? Flavors (known as _build configuratio...
website/src/deployment/flavors.md/0
{ "file_path": "website/src/deployment/flavors.md", "repo_id": "website", "token_count": 3140 }
1,327
--- title: Introduction to declarative UI short-title: Declarative UI description: Explains the difference between a declarative and imperative programming style. --- <?code-excerpt path-base="get-started/flutter-for/declarative"?> _This introduction describes the conceptual difference between the declarative style u...
website/src/get-started/flutter-for/declarative.md/0
{ "file_path": "website/src/get-started/flutter-for/declarative.md", "repo_id": "website", "token_count": 683 }
1,328
## Android setup {{site.alert.note}} Flutter relies on a full installation of Android Studio to supply its Android platform dependencies. However, you can write your Flutter apps in a number of editors; a later step discusses that. {{site.alert.end}} ### Install Android Studio {% include_relative _help-link.md...
website/src/get-started/install/_deprecated/_android-setup.md/0
{ "file_path": "website/src/get-started/install/_deprecated/_android-setup.md", "repo_id": "website", "token_count": 1251 }
1,329
--- title: Choose your development platform to get started short-title: Install description: Install Flutter and get started. Downloads available for Windows, macOS, Linux, and ChromeOS operating systems. os-list: [Windows, macOS, Linux, ChromeOS] --- <div class="card-deck mb-8"> {% for os in page.os-list %} <a clas...
website/src/get-started/install/index.md/0
{ "file_path": "website/src/get-started/install/index.md", "repo_id": "website", "token_count": 348 }
1,330
--- title: Uninstall Flutter description: How to remove the Flutter SDK. toc: true os-list: [Windows, macOS, Linux, ChromeOS] --- To remove all of Flutter from your {{os}} development machine, delete the directories that store Flutter and its configuration files. ## Uninstall the Flutter SDK Select your development ...
website/src/get-started/uninstall/index.md/0
{ "file_path": "website/src/get-started/uninstall/index.md", "repo_id": "website", "token_count": 1624 }
1,331
--- title: Concurrency and isolates description: Multithreading in Flutter using Dart isolates. --- <?code-excerpt path-base="development/concurrency/isolates/"?> All Dart code runs in [isolates]({{site.dart-site}}/language/concurrency), which are similar to threads, but differ in that isolates have their own isolate...
website/src/perf/isolates.md/0
{ "file_path": "website/src/perf/isolates.md", "repo_id": "website", "token_count": 3831 }
1,332
--- title: Add Android devtools for Flutter from Web on Windows start description: Configure your Windows system to develop Flutter mobile apps for Android. short-title: Starting from Web on Windows --- To add Android as a Flutter app target for Windows, follow this procedure. ## Install Android Studio 1. Allocate a...
website/src/platform-integration/android/install-android/install-android-from-web-on-windows.md/0
{ "file_path": "website/src/platform-integration/android/install-android/install-android-from-web-on-windows.md", "repo_id": "website", "token_count": 254 }
1,333
--- title: iOS debugging description: iOS-specific debugging techniques for Flutter apps --- Due to security around [local network permissions in iOS 14 or later][], you must accept a permission dialog box to enable Flutter debugging functionalities such as hot-reload and DevTools. ![Screenshot of "allow network conn...
website/src/platform-integration/ios/ios-debugging.md/0
{ "file_path": "website/src/platform-integration/ios/ios-debugging.md", "repo_id": "website", "token_count": 164 }
1,334
--- title: Automatic platform adaptations description: Learn more about Flutter's platform adaptiveness. --- {{site.alert.note}} As of the Flutter 3.16 release, Material 3 replaces Material 2 as the default theme on all Flutter apps that use Material. {{site.alert.end}} ## Adaptation philosophy In general, two...
website/src/platform-integration/platform-adaptations.md/0
{ "file_path": "website/src/platform-integration/platform-adaptations.md", "repo_id": "website", "token_count": 12300 }
1,335
--- title: Support for WebAssembly (Wasm) description: >- Current status of Flutter's experimental support for WebAssembly (Wasm). short-title: Wasm last-update: March 13, 2024 --- **_Last updated {{page.last-update}}_** The Flutter and Dart teams are excited to add [WebAssembly](https://webassembly.org/) as a comp...
website/src/platform-integration/web/wasm.md/0
{ "file_path": "website/src/platform-integration/web/wasm.md", "repo_id": "website", "token_count": 2825 }
1,336
--- title: Archive of What's new description: >- A list of previous what's new updates on docs.flutter.dev and related documentation sites. --- This page contains of archived announcements of what's new on the Flutter website and blog. For information on the latest releases, check out the [current what's new][] pa...
website/src/release/archive-whats-new.md/0
{ "file_path": "website/src/release/archive-whats-new.md", "repo_id": "website", "token_count": 20725 }
1,337
--- title: Android ActivityControlSurface attachToActivity signature change description: > attachToActivity activity parameter changed to ExclusiveAppComponent instead of Activity. --- ## Summary {{site.alert.note}} If you use standard Android embedding Java classes like [`FlutterActivity`][] or [`FlutterFrag...
website/src/release/breaking-changes/android-activity-control-surface-attach.md/0
{ "file_path": "website/src/release/breaking-changes/android-activity-control-surface-attach.md", "repo_id": "website", "token_count": 1284 }
1,338
--- title: Deprecate textScaleFactor in favor of TextScaler description: >- The new class, TextScaler, replaces the textScaleFactor scalar in preparation for Android 14 nonlinear text scaling support. --- ## Summary In preparation for adopting the [Android 14 nonlinear font scaling][] feature, all occurrences of...
website/src/release/breaking-changes/deprecate-textscalefactor.md/0
{ "file_path": "website/src/release/breaking-changes/deprecate-textscalefactor.md", "repo_id": "website", "token_count": 4121 }
1,339
--- title: More Strict Assertions in the Navigator and the Hero Controller Scope description: > Added additional assertions to guarantee that one hero controller scope can only subscribe to one navigator at a time. --- ## Summary The framework throws an assertion error when it detects there are multiple navigator...
website/src/release/breaking-changes/hero-controller-scope.md/0
{ "file_path": "website/src/release/breaking-changes/hero-controller-scope.md", "repo_id": "website", "token_count": 1716 }
1,340
--- title: Transition of platform channel test interfaces to flutter_test package description: > The setMockMessageHandler method related APIs have moved from package:flutter to package:flutter_test --- ## Summary The following methods have been replaced by APIs in the `flutter_test` package: * `BinaryMessenge...
website/src/release/breaking-changes/mock-platform-channels.md/0
{ "file_path": "website/src/release/breaking-changes/mock-platform-channels.md", "repo_id": "website", "token_count": 1896 }
1,341
--- title: Raw images on Web uses correct origin and colors description: > Raw images directly decoded by calling the Web engine functions now uses the correct pixel format and starts from the top left corner. --- ## Summary How raw images are rendered on Web has been corrected and is now consistent with that on ...
website/src/release/breaking-changes/raw-images-on-web-uses-correct-origin-and-colors.md/0
{ "file_path": "website/src/release/breaking-changes/raw-images-on-web-uses-correct-origin-and-colors.md", "repo_id": "website", "token_count": 2048 }
1,342
--- title: Adding 'linux' and 'windows' to TargetPlatform enum description: > Two new values were added to the TargetPlatform enum that could require additional cases in switch statements that switch on a TargetPlatform. --- ## Summary Two new values were added to the [`TargetPlatform`][] enum that could require ...
website/src/release/breaking-changes/target-platform-linux-windows.md/0
{ "file_path": "website/src/release/breaking-changes/target-platform-linux-windows.md", "repo_id": "website", "token_count": 1331 }
1,343
--- title: Migrate a Windows project to the idiomatic run loop description: How to update a Windows project to use the idiomatic run loop --- Flutter 2.5 replaced Windows apps' run loop with an idiomatic Windows message pump to reduce CPU usage. Projects created before Flutter version 2.5 need to be migrated to get t...
website/src/release/breaking-changes/windows-run-loop.md/0
{ "file_path": "website/src/release/breaking-changes/windows-run-loop.md", "repo_id": "website", "token_count": 376 }
1,344
--- title: Flutter 1.20.0 release notes short-title: 1.20.0 release notes description: Release notes for Flutter 1.20.0. --- ## Merged pull requests by label ### Merged PRs by labels for `flutter/flutter` #### tool - 435 pull request(s) [50581](https://github.com/flutter/flutter/pull/50581) Implements --machine f...
website/src/release/release-notes/release-notes-1.20.0.md/0
{ "file_path": "website/src/release/release-notes/release-notes-1.20.0.md", "repo_id": "website", "token_count": 244668 }
1,345
```nocode flutter: FocusManager#9d096 flutter: │ primaryFocus: FocusScopeNode#926dc(_ModalScopeState<dynamic> flutter: │ Focus Scope [PRIMARY FOCUS]) flutter: │ primaryFocusCreator: FocusScope ← PrimaryScrollController ← flutter: │ _ActionsScope ← Actions ← Builder ← PageStorage ← Offstage ← flutter: │ _Moda...
website/src/testing/trees/focus-tree.md/0
{ "file_path": "website/src/testing/trees/focus-tree.md", "repo_id": "website", "token_count": 1766 }
1,346
--- title: Install and run DevTools from Android Studio description: Learn how to install and use DevTools from Android Studio. --- ## Install the Flutter plugin Install the Flutter plugin if you don't already have it installed. This can be done using the normal **Plugins** page in the IntelliJ and Android Studio set...
website/src/tools/devtools/android-studio.md/0
{ "file_path": "website/src/tools/devtools/android-studio.md", "repo_id": "website", "token_count": 471 }
1,347
# DevTools 2.12.2 release notes The 2.12.2 release of the Dart and Flutter DevTools includes the following changes among other general improvements. To learn more about DevTools, check out the [DevTools overview](https://docs.flutter.dev/tools/devtools/overview). ## General updates * Recover from missing trace event...
website/src/tools/devtools/release-notes/release-notes-2.12.2-src.md/0
{ "file_path": "website/src/tools/devtools/release-notes/release-notes-2.12.2-src.md", "repo_id": "website", "token_count": 169 }
1,348
# DevTools 2.20.0 release notes The 2.20.0 release of the Dart and Flutter DevTools includes the following changes among other general improvements. To learn more about DevTools, check out the [DevTools overview](https://docs.flutter.dev/tools/devtools/overview). ## CPU profiler updates * Add support for grouping sa...
website/src/tools/devtools/release-notes/release-notes-2.20.0-src.md/0
{ "file_path": "website/src/tools/devtools/release-notes/release-notes-2.20.0-src.md", "repo_id": "website", "token_count": 724 }
1,349
# DevTools 2.28.1 release notes The 2.28.1 release of the Dart and Flutter DevTools includes the following changes among other general improvements. To learn more about DevTools, check out the [DevTools overview](https://docs.flutter.dev/tools/devtools/overview). ## General updates * Added support for DevTools exten...
website/src/tools/devtools/release-notes/release-notes-2.28.1-src.md/0
{ "file_path": "website/src/tools/devtools/release-notes/release-notes-2.28.1-src.md", "repo_id": "website", "token_count": 647 }
1,350
# DevTools 2.32.0 release notes The 2.32.0 release of the Dart and Flutter DevTools includes the following changes among other general improvements. To learn more about DevTools, check out the [DevTools overview](https://docs.flutter.dev/tools/devtools/overview). ## General updates * Improved overall usability by ma...
website/src/tools/devtools/release-notes/release-notes-2.32.0-src.md/0
{ "file_path": "website/src/tools/devtools/release-notes/release-notes-2.32.0-src.md", "repo_id": "website", "token_count": 877 }
1,351
--- title: Hot reload description: Speed up development using Flutter's hot reload feature. --- <?code-excerpt path-base="development/tools"?> Flutter's hot reload feature helps you quickly and easily experiment, build UIs, add features, and fix bugs. Hot reload works by injecting updated source code files into the r...
website/src/tools/hot-reload.md/0
{ "file_path": "website/src/tools/hot-reload.md", "repo_id": "website", "token_count": 3650 }
1,352
--- layout: toc title: Assets & media description: Content covering incorporating assets and media in Flutter apps. ---
website/src/ui/assets/index.md/0
{ "file_path": "website/src/ui/assets/index.md", "repo_id": "website", "token_count": 29 }
1,353
--- layout: toc title: Lists & grids description: Content covering adding lists and grids of items to Flutter apps. sitemap: false ---
website/src/ui/layout/lists/index.md/0
{ "file_path": "website/src/ui/layout/lists/index.md", "repo_id": "website", "token_count": 37 }
1,354
--- title: Widget catalog description: A catalog of some of Flutter's rich set of widgets. short-title: Widgets --- Create beautiful apps faster with Flutter's collection of visual, structural, platform, and interactive widgets. In addition to browsing widgets by category, you can also see all the widgets in the [widg...
website/src/ui/widgets/index.md/0
{ "file_path": "website/src/ui/widgets/index.md", "repo_id": "website", "token_count": 1254 }
1,355
// Copyright 2024 The Flutter Authors. 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:io'; import 'package:args/command_runner.dart'; import 'package:path/path.dart' as path; final class CheckLinkReferencesCommand extends Comm...
website/tool/flutter_site/lib/src/commands/check_link_references.dart/0
{ "file_path": "website/tool/flutter_site/lib/src/commands/check_link_references.dart", "repo_id": "website", "token_count": 1427 }
1,356
// Copyright 2022 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:googleapis/youtube/v3.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/...
codelabs/adaptive_app/step_04/lib/src/playlist_details.dart/0
{ "file_path": "codelabs/adaptive_app/step_04/lib/src/playlist_details.dart", "repo_id": "codelabs", "token_count": 1948 }
0
#include "../../Flutter/Flutter-Debug.xcconfig" #include "Warnings.xcconfig"
codelabs/adaptive_app/step_04/macos/Runner/Configs/Debug.xcconfig/0
{ "file_path": "codelabs/adaptive_app/step_04/macos/Runner/Configs/Debug.xcconfig", "repo_id": "codelabs", "token_count": 32 }
1
import 'package:adaptive_app/main.dart'; import 'package:adaptive_app/src/app_state.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:googleapis/youtube/v3.dart'; import 'package:http/src/client.dart'; import 'package:provider/provider.dart'; class FakeAuth...
codelabs/adaptive_app/step_07/test/widget_test.dart/0
{ "file_path": "codelabs/adaptive_app/step_07/test/widget_test.dart", "repo_id": "codelabs", "token_count": 333 }
2
#include "Generated.xcconfig"
codelabs/animated-responsive-layout/step_04/ios/Flutter/Debug.xcconfig/0
{ "file_path": "codelabs/animated-responsive-layout/step_04/ios/Flutter/Debug.xcconfig", "repo_id": "codelabs", "token_count": 12 }
3
// Copyright 2022 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'models.dart'; final User user_0 = User( name: const Name(first: 'Me', last: ''), avatarUrl: 'assets/avatar_1.png', lastActive: DateTim...
codelabs/animated-responsive-layout/step_06/lib/models/data.dart/0
{ "file_path": "codelabs/animated-responsive-layout/step_06/lib/models/data.dart", "repo_id": "codelabs", "token_count": 1197 }
4
# MyArtist A music player app where fans can keep up to date with their favorite artists. ## Getting started This is a companion Flutter app to go along with the [Take your Flutter app from boring to beautiful](#) codelab. This codelab guides you step-by-step through modifying MyArtist's design to look beautiful acr...
codelabs/boring_to_beautiful/README.md/0
{ "file_path": "codelabs/boring_to_beautiful/README.md", "repo_id": "codelabs", "token_count": 1097 }
5
// Copyright 2022 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; import '../../../shared/classes/classes.dart'; import '../../../...
codelabs/boring_to_beautiful/final/lib/src/features/artists/view/artist_events.dart/0
{ "file_path": "codelabs/boring_to_beautiful/final/lib/src/features/artists/view/artist_events.dart", "repo_id": "codelabs", "token_count": 1907 }
6
// Copyright 2022 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import '../../../shared/classes/classes.dart'; import '../../../s...
codelabs/boring_to_beautiful/final/lib/src/features/playlists/view/playlist_songs.dart/0
{ "file_path": "codelabs/boring_to_beautiful/final/lib/src/features/playlists/view/playlist_songs.dart", "repo_id": "codelabs", "token_count": 1218 }
7
// Copyright 2022 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. part of 'playback_bloc.dart'; @Freezed() class PlaybackState with _$PlaybackState { const factory PlaybackState({ /// Legal values are between 0 and...
codelabs/boring_to_beautiful/final/lib/src/shared/playback/bloc/playback_state.dart/0
{ "file_path": "codelabs/boring_to_beautiful/final/lib/src/shared/playback/bloc/playback_state.dart", "repo_id": "codelabs", "token_count": 285 }
8
// Copyright 2022 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; class HoverToggle extends StatefulWidget { const HoverToggle({ super.key, required this.child, requi...
codelabs/boring_to_beautiful/final/lib/src/shared/views/hover_toggle.dart/0
{ "file_path": "codelabs/boring_to_beautiful/final/lib/src/shared/views/hover_toggle.dart", "repo_id": "codelabs", "token_count": 562 }
9
name: myartist description: A new Flutter project. publish_to: "none" version: 1.0.0 environment: sdk: ^3.2.0 dependencies: adaptive_breakpoints: ^0.1.7 adaptive_components: ^0.0.10 adaptive_navigation: ^0.0.10 animations: ^2.0.11 collection: ^1.18.0 cupertino_icons: ^1.0.6 desktop_window: ^0.4.0 dy...
codelabs/boring_to_beautiful/final/pubspec.yaml/0
{ "file_path": "codelabs/boring_to_beautiful/final/pubspec.yaml", "repo_id": "codelabs", "token_count": 399 }
10
// Copyright 2022 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import '../../../shared/classes/classes.dart'; import '../../../shared/...
codelabs/boring_to_beautiful/step_01/lib/src/features/home/view/home_artists.dart/0
{ "file_path": "codelabs/boring_to_beautiful/step_01/lib/src/features/home/view/home_artists.dart", "repo_id": "codelabs", "token_count": 707 }
11