text stringlengths 6 13.6M | id stringlengths 13 176 | metadata dict | __index_level_0__ int64 0 1.69k |
|---|---|---|---|
// Copyright 2023 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:flutter/material.dart';
class TextStyles {
const TextStyles({Key? key});
static TextStyle bodyStyle() {
return const TextStyle(
... | samples/experimental/varfont_shader_puzzle/lib/styles.dart/0 | {
"file_path": "samples/experimental/varfont_shader_puzzle/lib/styles.dart",
"repo_id": "samples",
"token_count": 532
} | 1,225 |
#include "../../Flutter/Flutter-Release.xcconfig"
#include "Warnings.xcconfig"
| samples/experimental/varfont_shader_puzzle/macos/Runner/Configs/Release.xcconfig/0 | {
"file_path": "samples/experimental/varfont_shader_puzzle/macos/Runner/Configs/Release.xcconfig",
"repo_id": "samples",
"token_count": 32
} | 1,226 |
// Copyright 2020, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'auth.dart';
class MockAuthService implements Auth {
@override
Future<bool> get isSignedIn as... | samples/experimental/web_dashboard/lib/src/auth/mock.dart/0 | {
"file_path": "samples/experimental/web_dashboard/lib/src/auth/mock.dart",
"repo_id": "samples",
"token_count": 167
} | 1,227 |
// Copyright 2020, the Flutter project authors. Please see the AUTHORS file
// for details. 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:io';
import 'package:grinder/grinder.dart';
import 'package:path/path... | samples/experimental/web_dashboard/tool/grind.dart/0 | {
"file_path": "samples/experimental/web_dashboard/tool/grind.dart",
"repo_id": "samples",
"token_count": 1022
} | 1,228 |
# Run with tooling from https://github.com/flutter/codelabs/tree/main/tooling/codelab_rebuild
name: Form App rebuild script
steps:
- name: Remove runners
rmdirs:
- android
- ios
- macos
- linux
- windows
- web
- name: Flutter recreate
flutter: create --platforms android,... | samples/form_app/codelab_rebuild.yaml/0 | {
"file_path": "samples/form_app/codelab_rebuild.yaml",
"repo_id": "samples",
"token_count": 492
} | 1,229 |
// Copyright 2022, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
const gameLevels = [
GameLevel(
number: 1,
difficulty: 5,
// TODO: When ready, change these... | samples/game_template/lib/src/level_selection/levels.dart/0 | {
"file_path": "samples/game_template/lib/src/level_selection/levels.dart",
"repo_id": "samples",
"token_count": 481
} | 1,230 |
// Copyright 2022, the Flutter project authors. Please see the AUTHORS file
// for details. 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';
/// A widget that makes it easy to create a screen with a square... | samples/game_template/lib/src/style/responsive_screen.dart/0 | {
"file_path": "samples/game_template/lib/src/style/responsive_screen.dart",
"repo_id": "samples",
"token_count": 2159
} | 1,231 |
// Copyright 2020 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.
import 'dart:io' show Platform;
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart';
import 'package:provider/pr... | samples/infinite_list/lib/main.dart/0 | {
"file_path": "samples/infinite_list/lib/main.dart",
"repo_id": "samples",
"token_count": 1098
} | 1,232 |
package dev.flutter.isolate_example
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
| samples/isolate_example/android/app/src/main/kotlin/dev/flutter/isolate_example/MainActivity.kt/0 | {
"file_path": "samples/isolate_example/android/app/src/main/kotlin/dev/flutter/isolate_example/MainActivity.kt",
"repo_id": "samples",
"token_count": 40
} | 1,233 |
#import "GeneratedPluginRegistrant.h"
| samples/navigation_and_routing/ios/Runner/Runner-Bridging-Header.h/0 | {
"file_path": "samples/navigation_and_routing/ios/Runner/Runner-Bridging-Header.h",
"repo_id": "samples",
"token_count": 13
} | 1,234 |
// Copyright 2021, the Flutter project authors. Please see the AUTHORS file
// for details. 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 '../data.dart';
class AuthorList extends StatelessWidget... | samples/navigation_and_routing/lib/src/widgets/author_list.dart/0 | {
"file_path": "samples/navigation_and_routing/lib/src/widgets/author_list.dart",
"repo_id": "samples",
"token_count": 339
} | 1,235 |
# Run with tooling from https://github.com/flutter/codelabs/tree/main/tooling/codelab_rebuild
name: Place Tracker rebuild script
steps:
- name: Remove runner
rmdirs:
- android
- ios
- web
- name: Rebuild Runner
flutter: create --org dev.flutter --platform android,ios,web .
- name: Updat... | samples/place_tracker/codelab_rebuild.yaml/0 | {
"file_path": "samples/place_tracker/codelab_rebuild.yaml",
"repo_id": "samples",
"token_count": 2078
} | 1,236 |
name: place_tracker
description: A new Flutter project.
version: 1.0.0+1
environment:
sdk: ^3.2.0
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
google_maps_flutter: ^2.2.0
provider: ^6.0.2
uuid: ^4.0.0
go_router: ">=10.0.0 <14.0.0"
collection: ^1.16.0
dev_dependencies:
analysis_... | samples/place_tracker/pubspec.yaml/0 | {
"file_path": "samples/place_tracker/pubspec.yaml",
"repo_id": "samples",
"token_count": 210
} | 1,237 |
// Copyright 2020 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 CoreMotion
class AccelerometerStreamHandler: NSObject, FlutterStreamHandler {
var motionManager: CMMotionManager;
override init() {
... | samples/platform_channels/ios/Runner/AccelerometerStreamHandler.swift/0 | {
"file_path": "samples/platform_channels/ios/Runner/AccelerometerStreamHandler.swift",
"repo_id": "samples",
"token_count": 530
} | 1,238 |
// Copyright 2020 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:flutter/services.dart';
/// This class includes the implementation for [EventChannel] to listen to value
/// changes from the Accelerometer s... | samples/platform_channels/lib/src/accelerometer_event_channel.dart/0 | {
"file_path": "samples/platform_channels/lib/src/accelerometer_event_channel.dart",
"repo_id": "samples",
"token_count": 376
} | 1,239 |
// Copyright 2020 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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'news_tab.dart';
import 'profile_tab.dart';
import 'settings_tab.dart... | samples/platform_design/lib/main.dart/0 | {
"file_path": "samples/platform_design/lib/main.dart",
"repo_id": "samples",
"token_count": 2648
} | 1,240 |
include: package:analysis_defaults/flutter.yaml
| samples/provider_counter/analysis_options.yaml/0 | {
"file_path": "samples/provider_counter/analysis_options.yaml",
"repo_id": "samples",
"token_count": 15
} | 1,241 |
# provider_shopper
A Flutter sample app that shows a state management approach using the [Provider][] package.
This is the app discussed in the [Simple app state management][simple] section of
[flutter.dev][].
[Provider]: https://pub.dev/packages/provider
[simple]: https://flutter.dev/docs/development/data-and-backen... | samples/provider_shopper/README.md/0 | {
"file_path": "samples/provider_shopper/README.md",
"repo_id": "samples",
"token_count": 549
} | 1,242 |
// Copyright 2020 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:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:provider/provider.dart';
import 'package:provider_sho... | samples/provider_shopper/test/login_widget_test.dart/0 | {
"file_path": "samples/provider_shopper/test/login_widget_test.dart",
"repo_id": "samples",
"token_count": 424
} | 1,243 |
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
| samples/simplistic_calculator/android/gradle.properties/0 | {
"file_path": "samples/simplistic_calculator/android/gradle.properties",
"repo_id": "samples",
"token_count": 31
} | 1,244 |
include: package:analysis_defaults/flutter.yaml
| samples/simplistic_editor/analysis_options.yaml/0 | {
"file_path": "samples/simplistic_editor/analysis_options.yaml",
"repo_id": "samples",
"token_count": 15
} | 1,245 |
import 'package:flutter/material.dart';
import 'app_state.dart';
import 'app_state_manager.dart';
import 'basic_text_field.dart';
import 'formatting_toolbar.dart';
import 'replacements.dart';
import 'text_editing_delta_history_view.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {... | samples/simplistic_editor/lib/main.dart/0 | {
"file_path": "samples/simplistic_editor/lib/main.dart",
"repo_id": "samples",
"token_count": 1524
} | 1,246 |
#include "../../Flutter/Flutter-Debug.xcconfig"
#include "Warnings.xcconfig"
| samples/simplistic_editor/macos/Runner/Configs/Debug.xcconfig/0 | {
"file_path": "samples/simplistic_editor/macos/Runner/Configs/Debug.xcconfig",
"repo_id": "samples",
"token_count": 32
} | 1,247 |
// Copyright 2018 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:flutter/foundation.dart';
import 'package:veggieseasons/data/local_veggie_provider.dart';
import 'package:veggieseasons/data/veggie.dart';
cl... | samples/veggieseasons/lib/data/app_state.dart/0 | {
"file_path": "samples/veggieseasons/lib/data/app_state.dart",
"repo_id": "samples",
"token_count": 932
} | 1,248 |
import 'package:flutter/cupertino.dart';
import 'package:provider/provider.dart';
import 'package:veggieseasons/data/app_state.dart';
import 'package:veggieseasons/data/veggie.dart';
import 'package:veggieseasons/styles.dart';
/// Presents a series of trivia questions about a particular widget, and tracks
/// the user... | samples/veggieseasons/lib/widgets/trivia.dart/0 | {
"file_path": "samples/veggieseasons/lib/widgets/trivia.dart",
"repo_id": "samples",
"token_count": 2848
} | 1,249 |
name: veggieseasons
description: An iOS app that shows the fruits and veggies currently in season.
publish_to: none
version: 1.2.0
environment:
sdk: ^3.2.0
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
font_awesome_flutter: ^10.1.0
intl: ^0.19.0
provider: ^6.0.1
shared_preferences: ^... | samples/veggieseasons/pubspec.yaml/0 | {
"file_path": "samples/veggieseasons/pubspec.yaml",
"repo_id": "samples",
"token_count": 951
} | 1,250 |
include: package:lints/recommended.yaml
| samples/web/_tool/analysis_options.yaml/0 | {
"file_path": "samples/web/_tool/analysis_options.yaml",
"repo_id": "samples",
"token_count": 13
} | 1,251 |
// Copyright 2020 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:io';
import 'package:grinder/grinder.dart';
import 'package:image/image.dart' as image;
import 'package:path/path.dart' as path;
import 'package:... | samples/web/samples_index/tool/grind.dart/0 | {
"file_path": "samples/web/samples_index/tool/grind.dart",
"repo_id": "samples",
"token_count": 1045
} | 1,252 |
@font-face {
font-family: "DM Sans";
src: url(../fonts/DMSans-Regular.ttf);
font-weight: normal;
}
@font-face {
font-family: "DM Sans";
src: url(../fonts/DMSans-Bold.ttf);
font-weight: 700;
}
/** Reset */
* {
box-sizing: border-box;
font-family: "DM Sans", sans-serif;
}
html, body {
margin: 0;
pad... | samples/web_embedding/element_embedding_demo/web/css/style.css/0 | {
"file_path": "samples/web_embedding/element_embedding_demo/web/css/style.css",
"repo_id": "samples",
"token_count": 2185
} | 1,253 |
name: ng_companion
description: A flutter app with a counter that can be manipulated from JS.
publish_to: 'none'
version: 1.0.0
environment:
sdk: ^3.3.0
flutter: ">=3.19.0"
dependencies:
flutter:
sdk: flutter
web: ^0.5.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^3.0.0
flutter:... | samples/web_embedding/ng-flutter/flutter/pubspec.yaml/0 | {
"file_path": "samples/web_embedding/ng-flutter/flutter/pubspec.yaml",
"repo_id": "samples",
"token_count": 161
} | 1,254 |
import { bootstrapApplication } from '@angular/platform-browser';
import { provideRouter, Routes } from '@angular/router';
import { AppComponent } from './app/app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { importProvidersFrom } from '@angular/core';
const appRo... | samples/web_embedding/ng-flutter/src/main.ts/0 | {
"file_path": "samples/web_embedding/ng-flutter/src/main.ts",
"repo_id": "samples",
"token_count": 143
} | 1,255 |
# Default Codeowners
* @atsansone @parlough @sfshaza2 @domesticmouse @MaryaBelanger
# Covers staging and deploying with Cloud Build
/cloud_build/ @parlough @khanhnwin @sfshaza2 @atsansone
# Covers all web content
/src/ @sfshaza2 @atsansone @parlough @domesticmouse @MaryaBelanger
# Covers Jekyll plugins
/src/_... | website/CODEOWNERS/0 | {
"file_path": "website/CODEOWNERS",
"repo_id": "website",
"token_count": 326
} | 1,256 |
name: basic_hero_transition
publish_to: none
description: >-
Shows how to create a simple or Hero animation using the Hero class directly.
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
dev_dependencies:
example_utils:
path: ../../example_utils
flutter_test:
sdk: flutter
flutter:... | website/examples/_animation/basic_hero_animation/pubspec.yaml/0 | {
"file_path": "website/examples/_animation/basic_hero_animation/pubspec.yaml",
"repo_id": "website",
"token_count": 144
} | 1,257 |
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
const appTitle = 'Opacity Demo';
return const MaterialApp(
title: appTitle,
home: MyHomePage(title: ap... | website/examples/cookbook/animation/opacity_animation/lib/main.dart/0 | {
"file_path": "website/examples/cookbook/animation/opacity_animation/lib/main.dart",
"repo_id": "website",
"token_count": 846
} | 1,258 |
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
static const appTitle = 'Drawer Demo';
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: appTitle,
home: MyHomePage(titl... | website/examples/cookbook/design/drawer/lib/main.dart/0 | {
"file_path": "website/examples/cookbook/design/drawer/lib/main.dart",
"repo_id": "website",
"token_count": 1344
} | 1,259 |
name: snackbars
description: Sample code for snackbars 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/design/snackbars/pubspec.yaml/0 | {
"file_path": "website/examples/cookbook/design/snackbars/pubspec.yaml",
"repo_id": "website",
"token_count": 91
} | 1,260 |
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_painter.dart/0 | {
"file_path": "website/examples/cookbook/effects/gradient_bubbles/lib/bubble_painter.dart",
"repo_id": "website",
"token_count": 718
} | 1,261 |
import 'package:flutter/material.dart';
void main() {
runApp(
const MaterialApp(
home: ExampleUiLoadingAnimation(),
debugShowCheckedModeBanner: false,
),
);
}
const _shimmerGradient = LinearGradient(
colors: [
Color(0xFFEBEBF4),
Color(0xFFF4F4F4),
Color(0xFFEBEBF4),
],
stops:... | website/examples/cookbook/effects/shimmer_loading/lib/original_example.dart/0 | {
"file_path": "website/examples/cookbook/effects/shimmer_loading/lib/original_example.dart",
"repo_id": "website",
"token_count": 3899
} | 1,262 |
// ignore_for_file: unused_element, unused_field
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import './excerpt1.dart';
// #docregion Bubbles
class _TypingIndicatorState extends State<TypingIndicator>
with TickerProviderStateMixin {
late AnimationController _appearanceContro... | website/examples/cookbook/effects/typing_indicator/lib/excerpt3.dart/0 | {
"file_path": "website/examples/cookbook/effects/typing_indicator/lib/excerpt3.dart",
"repo_id": "website",
"token_count": 2391
} | 1,263 |
name: handling_taps
description: Example on handling_taps 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/gestures/handling_taps/pubspec.yaml/0 | {
"file_path": "website/examples/cookbook/gestures/handling_taps/pubspec.yaml",
"repo_id": "website",
"token_count": 94
} | 1,264 |
import 'package:flutter/material.dart';
void main() {
runApp(
// #docregion MaterialApp
MaterialApp(
title: 'Named Routes Demo',
// Start the app with the "/" named route. In this case, the app starts
// on the FirstScreen widget.
initialRoute: '/',
routes: {
// When nav... | website/examples/cookbook/navigation/named_routes/lib/main.dart/0 | {
"file_path": "website/examples/cookbook/navigation/named_routes/lib/main.dart",
"repo_id": "website",
"token_count": 785
} | 1,265 |
name: passing_data
description: Passing data
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
dev_dependencies:
example_utils:
path: ../../../example_utils
flutter:
uses-material-design: true
| website/examples/cookbook/navigation/passing_data/pubspec.yaml/0 | {
"file_path": "website/examples/cookbook/navigation/passing_data/pubspec.yaml",
"repo_id": "website",
"token_count": 85
} | 1,266 |
name: web_sockets
description: Web Sockets
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
web_socket_channel: ^2.4.3
dev_dependencies:
example_utils:
path: ../../../example_utils
flutter:
uses-material-design: true
| website/examples/cookbook/networking/web_sockets/pubspec.yaml/0 | {
"file_path": "website/examples/cookbook/networking/web_sockets/pubspec.yaml",
"repo_id": "website",
"token_count": 101
} | 1,267 |
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:google_mobile_ads/google_mobile_ads.dart';
// #docregion main
void main() async {
WidgetsFlutterBinding.ensureInitialized();
unawaited(MobileAds.instance.initialize());
runApp(MyApp());
}
// #enddocregion main
class MyApp extends Sta... | website/examples/cookbook/plugins/google_mobile_ads/lib/main.dart/0 | {
"file_path": "website/examples/cookbook/plugins/google_mobile_ads/lib/main.dart",
"repo_id": "website",
"token_count": 150
} | 1,268 |
import 'package:flutter_test/flutter_test.dart';
// #docregion mockClient
import 'package:http/http.dart' as http;
import 'package:mocking/main.dart';
import 'package:mockito/annotations.dart';
// #enddocregion mockClient
import 'package:mockito/mockito.dart';
import 'fetch_album_test.mocks.dart';
// #docregion mockCl... | website/examples/cookbook/testing/unit/mocking/test/fetch_album_test.dart/0 | {
"file_path": "website/examples/cookbook/testing/unit/mocking/test/fetch_album_test.dart",
"repo_id": "website",
"token_count": 559
} | 1,269 |
import 'package:json_annotation/json_annotation.dart';
part 'address.g.dart';
@JsonSerializable()
class Address {
String street;
String city;
Address(this.street, this.city);
factory Address.fromJson(Map<String, dynamic> json) =>
_$AddressFromJson(json);
Map<String, dynamic> toJson() => _$AddressToJs... | website/examples/development/data-and-backend/json/lib/nested/address.dart/0 | {
"file_path": "website/examples/development/data-and-backend/json/lib/nested/address.dart",
"repo_id": "website",
"token_count": 119
} | 1,270 |
// ignore_for_file: unused_local_variable
// #docregion import
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
// #enddocregion import
import 'package:flutter/widgets.dart';
class IOSCompositionWidget extends StatelessWidget {
const IOSCompositionWidget({super.key});
@override
... | website/examples/development/platform_integration/lib/platform_views/native_view_example_3.dart/0 | {
"file_path": "website/examples/development/platform_integration/lib/platform_views/native_view_example_3.dart",
"repo_id": "website",
"token_count": 497
} | 1,271 |
import 'package:flutter/material.dart';
// ParentWidget manages the state for TapboxB.
//------------------------ ParentWidget --------------------------------
class ParentWidget extends StatefulWidget {
const ParentWidget({super.key});
@override
State<ParentWidget> createState() => _ParentWidgetState();
}
c... | website/examples/development/ui/interactive/lib/parent_managed.dart/0 | {
"file_path": "website/examples/development/ui/interactive/lib/parent_managed.dart",
"repo_id": "website",
"token_count": 560
} | 1,272 |
{
"@@locale": "en",
"hello":"Hello {userName}",
"@hello":{
"description":"A message with a single parameter",
"placeholders":{
"userName":{
"type":"String",
"example":"Bob"
}
}
}
}
| website/examples/get-started/flutter-for/android_devs/lib/arb_examples.arb/0 | {
"file_path": "website/examples/get-started/flutter-for/android_devs/lib/arb_examples.arb",
"repo_id": "website",
"token_count": 130
} | 1,273 |
import 'dart:developer' as developer;
import 'package:http/http.dart' as http;
Future<void> loadData() async {
var dataURL = Uri.parse('https://jsonplaceholder.typicode.com/posts');
http.Response response = await http.get(dataURL);
developer.log(response.body);
}
| website/examples/get-started/flutter-for/android_devs/lib/network.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/android_devs/lib/network.dart",
"repo_id": "website",
"token_count": 89
} | 1,274 |
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
void main() {
runApp(const SampleApp());
}
class SampleApp extends StatelessWidget {
const SampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
title:... | website/examples/get-started/flutter-for/ios_devs/lib/async.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/ios_devs/lib/async.dart",
"repo_id": "website",
"token_count": 567
} | 1,275 |
import 'dart:developer' as developer;
import 'package:flutter/material.dart';
void main() {
runApp(const SampleApp());
}
class SampleApp extends StatelessWidget {
const SampleApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return const Ma... | website/examples/get-started/flutter-for/ios_devs/lib/list_item_tapped.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/ios_devs/lib/list_item_tapped.dart",
"repo_id": "website",
"token_count": 494
} | 1,276 |
import 'package:flutter/cupertino.dart';
void main() {
runApp(
const App(),
);
}
class App extends StatelessWidget {
const App({
super.key,
});
@override
Widget build(BuildContext context) {
return const CupertinoApp(
theme: CupertinoThemeData(
brightness: Brightness.dark,
... | website/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart",
"repo_id": "website",
"token_count": 663
} | 1,277 |
import 'package:flutter/material.dart';
class ColumnExample extends StatelessWidget {
const ColumnExample({super.key});
// #docregion Column
@override
Widget build(BuildContext context) {
return Center(
child: Column(
children: <Widget>[
Container(
color: Colors.red,
... | website/examples/get-started/flutter-for/react_native_devs/lib/layouts.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/react_native_devs/lib/layouts.dart",
"repo_id": "website",
"token_count": 586
} | 1,278 |
import 'package:flutter/material.dart';
// #docregion MyApp
class MyApp extends StatelessWidget {
/// This widget is the root of your application.
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Flutter Demo',
home: MyHomePage(title: '... | website/examples/get-started/flutter-for/xamarin_devs/lib/page.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/xamarin_devs/lib/page.dart",
"repo_id": "website",
"token_count": 724
} | 1,279 |
arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
| website/examples/internationalization/gen_l10n_example/l10n.yaml/0 | {
"file_path": "website/examples/internationalization/gen_l10n_example/l10n.yaml",
"repo_id": "website",
"token_count": 37
} | 1,280 |
name: intl_example
description: Example of a Flutter app using the intl library services.
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: any # Use the pinned version from flutter_localizations
dev_dependencies:
example_utils:
path: ../../e... | website/examples/internationalization/intl_example/pubspec.yaml/0 | {
"file_path": "website/examples/internationalization/intl_example/pubspec.yaml",
"repo_id": "website",
"token_count": 159
} | 1,281 |
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart' show debugPaintSizeEnabled;
void main() {
debugPaintSizeEnabled = false; // Set to true for visual layout
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
static const showCard = true; // S... | website/examples/layout/card_and_stack/lib/main.dart/0 | {
"file_path": "website/examples/layout/card_and_stack/lib/main.dart",
"repo_id": "website",
"token_count": 1254
} | 1,282 |
// Copyright 2020 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:flutter/material.dart';
enum CardType {
standard,
tappable,
selectable,
}
class TravelDestination {
const TravelDestination({
re... | website/examples/layout/gallery/lib/cards_demo.dart/0 | {
"file_path": "website/examples/layout/gallery/lib/cards_demo.dart",
"repo_id": "website",
"token_count": 6342
} | 1,283 |
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
const String appTitle = 'Flutter layout demo';
return MaterialApp(
title: appTitle,
home: Scaffold(
... | website/examples/layout/lakes/step2/lib/main.dart/0 | {
"file_path": "website/examples/layout/lakes/step2/lib/main.dart",
"repo_id": "website",
"token_count": 1085
} | 1,284 |
import 'package:flutter/material.dart';
// #docregion debugPaintSizeEnabled
//add import to rendering library
import 'package:flutter/rendering.dart';
void main() {
debugPaintSizeEnabled = true;
runApp(const MyApp());
}
// #enddocregion debugPaintSizeEnabled
class MyApp extends StatelessWidget {
const MyApp({s... | website/examples/testing/code_debugging/lib/debug_flags.dart/0 | {
"file_path": "website/examples/testing/code_debugging/lib/debug_flags.dart",
"repo_id": "website",
"token_count": 134
} | 1,285 |
name: common_errors
description: Excerpts for common Flutter errors.
publish_to: none
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
dev_dependencies:
example_utils:
path: ../../example_utils
integration_test:
sdk: flutter
flutter_test:
sdk: flutter
flutter:
uses-material-... | website/examples/testing/common_errors/pubspec.yaml/0 | {
"file_path": "website/examples/testing/common_errors/pubspec.yaml",
"repo_id": "website",
"token_count": 129
} | 1,286 |
name: how_to
description: An example of setting up an integration test.
publish_to: none
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
dev_dependencies:
example_utils:
path: ../../../example_utils
integration_test:
sdk: flutter
flutter_test:
sdk: flutter
flutter:
uses-mat... | website/examples/testing/integration_tests/how_to/pubspec.yaml/0 | {
"file_path": "website/examples/testing/integration_tests/how_to/pubspec.yaml",
"repo_id": "website",
"token_count": 130
} | 1,287 |
import 'dart:async' show Future;
import 'package:flutter/material.dart';
// #docregion RootBundle
import 'package:flutter/services.dart' show rootBundle;
Future<String> loadAsset() async {
return await rootBundle.loadString('assets/config.json');
}
// #enddocregion RootBundle
class MyHomePage extends StatefulWidge... | website/examples/ui/assets_and_images/lib/main.dart/0 | {
"file_path": "website/examples/ui/assets_and_images/lib/main.dart",
"repo_id": "website",
"token_count": 386
} | 1,288 |
import 'package:flutter/material.dart';
import '../global/device_type.dart';
class StyledTextButton extends StatelessWidget {
const StyledTextButton({
super.key,
required this.onPressed,
required this.child,
});
final VoidCallback onPressed;
final Widget child;
@override
Widget build(BuildCo... | website/examples/ui/layout/adaptive_app_demos/lib/widgets/buttons.dart/0 | {
"file_path": "website/examples/ui/layout/adaptive_app_demos/lib/widgets/buttons.dart",
"repo_id": "website",
"token_count": 643
} | 1,289 |
import 'package:flutter/material.dart';
// #docregion Toggle
import 'package:flutter/rendering.dart';
void highlightRepaints() {
debugRepaintRainbowEnabled = true;
}
// #enddocregion Toggle
// #docregion EverythingRepaints
class EverythingRepaintsPage extends StatelessWidget {
const EverythingRepaintsPage({super... | website/examples/visual_debugging/lib/highlight_repaints.dart/0 | {
"file_path": "website/examples/visual_debugging/lib/highlight_repaints.dart",
"repo_id": "website",
"token_count": 352
} | 1,290 |
ChromeOSWeb:
degree: 1
windows: 'X'
linux: 'X'
android-toolchain: 'N'
chrome: 'Y'
xcode: 'X'
visual-studio: 'X'
android-studio: 'N'
errors: 3
add-android: 'Y'
add-chrome: 'N'
add-simulator: 'X'
add-xcode: 'X'
add-linux-tools: 'X'
add-visual-studio: 'X'
ChromeOSAndroid:
degree: 1
window... | website/src/_data/doctor.yml/0 | {
"file_path": "website/src/_data/doctor.yml",
"repo_id": "website",
"token_count": 4199
} | 1,291 |
{% assign path_base = page.url %}
{% assign recipes = site.pages
| where_exp: "recipe", "recipe.url contains path_base"
| where_exp: "recipe", "recipe.url != path_base"
| sort: 'title' %}
{% for recipe in recipes -%}
- [{{ recipe.title }}]({{ recipe.url }})
{% endfor -%}
| website/src/_includes/docs/cookbook-group-index.md/0 | {
"file_path": "website/src/_includes/docs/cookbook-group-index.md",
"repo_id": "website",
"token_count": 121
} | 1,292 |
{% assign devos = include.devos %}
1. Allocate a minimum of 1 GB of storage for Google Chrome.
Consider allocating 2 GB of storage for an optimal configuration.
1. Download and install the {{devos}} version of [Google Chrome][]
to debug JavaScript code for web apps.
{% if devos == 'Linux' %}{% include docs/ins... | website/src/_includes/docs/install/reqs/add-web.md/0 | {
"file_path": "website/src/_includes/docs/install/reqs/add-web.md",
"repo_id": "website",
"token_count": 133
} | 1,293 |
1. Press <kbd>Windows</kbd> + <kbd>Pause</kbd>.
If your keyboard lacks a <kbd>Pause</kbd> key,
try <kbd>Windows</kbd> + <kbd>Fn</kbd> + <kbd>B</kbd>.
The **System > About** dialog displays.
1. Click **Advanced System Settings**
<span aria-label="and then">></span> **Advanced**
<span aria-label="and th... | website/src/_includes/docs/install/reqs/windows/open-envvars.md/0 | {
"file_path": "website/src/_includes/docs/install/reqs/windows/open-envvars.md",
"repo_id": "website",
"token_count": 153
} | 1,294 |
{% comment %}
Generates a list of testing recipes for the given type. The type
corresponds to the name of the directory under cookbook/testing/*.
Usage: {% include docs/testing_toc.md type='unit' %}
{% endcomment -%}
{% assign dir = 'cookbook/testing/' | append: include.type -%}
{% assign recipes = site.pages |... | website/src/_includes/docs/testing-toc.md/0 | {
"file_path": "website/src/_includes/docs/testing-toc.md",
"repo_id": "website",
"token_count": 217
} | 1,295 |
---
layout: base
---
{% assign sidebar-col = 'col-12 col-md-3 col-xl-2' -%}
{% if page.toc -%}
{% assign main-col = 'col-12 col-md-9 offset-md-3 col-xl-8 offset-xl-2 col-xxl-8 offset-xxl-2' -%}
{% comment %}Side toc is col-xl-2{% endcomment -%}
{% else -%}
{% assign main-col = 'col-12 col-md-9 offset-md-3 col-xl... | website/src/_layouts/default.html/0 | {
"file_path": "website/src/_layouts/default.html",
"repo_id": "website",
"token_count": 841
} | 1,296 |
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
require 'liquid/tag/parser' # https://github.com/envygeeks/liquid-tag-parser
require_relative 'dart_site_u... | website/src/_plugins/prettify.rb/0 | {
"file_path": "website/src/_plugins/prettify.rb",
"repo_id": "website",
"token_count": 729
} | 1,297 |
@use '../base/variables' as *;
@use '../vendor/bootstrap';
.site-header {
background-color: $site-color-white;
box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
font-family: $site-font-family-alt;
position: sticky;
top: 0;
z-index: bootstrap.$zindex-fixed;
.navbar {
font-size: bootstrap.$font-size-lg;
mi... | website/src/_sass/components/_header.scss/0 | {
"file_path": "website/src/_sass/components/_header.scss",
"repo_id": "website",
"token_count": 2867
} | 1,298 |
---
title: Manage plugins and dependencies in add-to-app
short-title: Plugin setup
description: >
Learn how to use plugins and share your
plugin's library dependencies with your existing app.
---
This guide describes how to set up your project to consume
plugins and how to manage your Gradle library dependencies
... | website/src/add-to-app/android/plugin-setup.md/0 | {
"file_path": "website/src/add-to-app/android/plugin-setup.md",
"repo_id": "website",
"token_count": 1437
} | 1,299 |
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="560px" height="156.66px" viewBox="0 0 560 156.66" e... | website/src/assets/images/branding/flutter/logo+text/horizontal/default.svg/0 | {
"file_path": "website/src/assets/images/branding/flutter/logo+text/horizontal/default.svg",
"repo_id": "website",
"token_count": 3888
} | 1,300 |
---
title: Codelabs
description: >-
Codelabs to help you quickly get started programming Flutter.
---
The Flutter codelabs provide a guided,
hands-on coding experience. Some codelabs
run in DartPad—no downloads required!
## Good for beginners
If you're new to Flutter, we recommend starting with
one of the fo... | website/src/codelabs/index.md/0 | {
"file_path": "website/src/codelabs/index.md",
"repo_id": "website",
"token_count": 4204
} | 1,301 |
---
title: Work with tabs
description: How to implement tabs in a layout.
js:
- defer: true
url: https://old-dartpad-3ce3f.web.app/inject_embed.dart.js
---
<?code-excerpt path-base="cookbook/design/tabs/"?>
Working with tabs is a common pattern in apps that follow the
Material Design guidelines.
Flutter include... | website/src/cookbook/design/tabs.md/0 | {
"file_path": "website/src/cookbook/design/tabs.md",
"repo_id": "website",
"token_count": 1593
} | 1,302 |
---
title: Handle changes to a text field
description: How to detect changes to a text field.
js:
- defer: true
url: https://old-dartpad-3ce3f.web.app/inject_embed.dart.js
---
<?code-excerpt path-base="cookbook/forms/text_field_changes/"?>
In some cases, it's useful to run a callback function every time the tex... | website/src/cookbook/forms/text-field-changes.md/0 | {
"file_path": "website/src/cookbook/forms/text-field-changes.md",
"repo_id": "website",
"token_count": 2291
} | 1,303 |
---
title: Use lists
description: How to implement a list.
js:
- defer: true
url: https://old-dartpad-3ce3f.web.app/inject_embed.dart.js
---
<?code-excerpt path-base="cookbook/lists/basic_list"?>
Displaying lists of data is a fundamental pattern for mobile apps.
Flutter includes the [`ListView`][]
widget to mak... | website/src/cookbook/lists/basic-list.md/0 | {
"file_path": "website/src/cookbook/lists/basic-list.md",
"repo_id": "website",
"token_count": 934
} | 1,304 |
---
title: Return data from a screen
description: How to return data from a new screen.
js:
- defer: true
url: https://old-dartpad-3ce3f.web.app/inject_embed.dart.js
---
<?code-excerpt path-base="cookbook/navigation/returning_data/"?>
In some cases, you might want to return data from a new screen.
For example, ... | website/src/cookbook/navigation/returning-data.md/0 | {
"file_path": "website/src/cookbook/navigation/returning-data.md",
"repo_id": "website",
"token_count": 3389
} | 1,305 |
---
title: Plugins
description: A catalog of recipes showcasing using plugins in your Flutter app.
---
{% include docs/cookbook-group-index.md %}
| website/src/cookbook/plugins/index.md/0 | {
"file_path": "website/src/cookbook/plugins/index.md",
"repo_id": "website",
"token_count": 42
} | 1,306 |
---
title: Firebase
description: How to use Firebase and Firestore with Flutter.
---
## Introduction
Firebase is a Backend-as-a-Service (BaaS) app development platform
that provides hosted backend services such as a realtime database,
cloud storage, authentication, crash reporting, machine learning,
remote configurat... | website/src/data-and-backend/firebase.md/0 | {
"file_path": "website/src/data-and-backend/firebase.md",
"repo_id": "website",
"token_count": 588
} | 1,307 |
---
layout: toc
title: Deployment
description: Content covering deployment of Flutter apps.
---
| website/src/deployment/index.md/0 | {
"file_path": "website/src/deployment/index.md",
"repo_id": "website",
"token_count": 25
} | 1,308 |
---
title: Flutter for React Native developers
description: Learn how to apply React Native developer knowledge when building Flutter apps.
---
<?code-excerpt path-base="get-started/flutter-for/react_native_devs"?>
This document is for React Native (RN) developers looking to apply their
existing RN knowledge to build... | website/src/get-started/flutter-for/react-native-devs.md/0 | {
"file_path": "website/src/get-started/flutter-for/react-native-devs.md",
"repo_id": "website",
"token_count": 41396
} | 1,309 |
## Android setup (without Android Studio)
### Install Java
```terminal
$ sudo apt update
$ sudo apt install default-jre
$ sudo apt install default-jdk
```
### Install the Android SDKs
Download the [Android SDK tools][] and
select the "Command Line Tools only" option.
Drag and drop the downloaded zip into your Linu... | website/src/get-started/install/_deprecated/_chromeos-android-sdk-setup.md/0 | {
"file_path": "website/src/get-started/install/_deprecated/_chromeos-android-sdk-setup.md",
"repo_id": "website",
"token_count": 501
} | 1,310 |
---
title: Start building Flutter Android apps on Linux
description: Configure your system to develop Flutter mobile apps on Linux and Android.
short-title: Make Android apps
target: Android
config: LinuxAndroid
devos: Linux
next:
title: Create a test app
path: /get-started/test-drive
---
{% include docs/install/r... | website/src/get-started/install/linux/android.md/0 | {
"file_path": "website/src/get-started/install/linux/android.md",
"repo_id": "website",
"token_count": 304
} | 1,311 |
---
title: Flutter documentation
short-title: Docs
description: Get started with Flutter. Widgets, examples, updates, and API docs to help you write your first Flutter app.
---
{% for card in site.data.docs_cards -%}
{% capture index0Modulo3 -%}{{ forloop.index0 | modulo:3 }}{% endcapture -%}
{% capture indexModul... | website/src/index.md/0 | {
"file_path": "website/src/index.md",
"repo_id": "website",
"token_count": 1704
} | 1,312 |
---
title: Performance metrics
description: Flutter metrics, and which tools and APIs are used to get them
---
* Startup time to the first frame
* Check the time when
[WidgetsBinding.instance.firstFrameRasterized][firstFrameRasterized]
is true.
* See the
[perf dashboard](https://flutter-flutter-perf.s... | website/src/perf/metrics.md/0 | {
"file_path": "website/src/perf/metrics.md",
"repo_id": "website",
"token_count": 1535
} | 1,313 |
---
title: Adding a launch screen to your iOS app
short-title: Launch screen
description: Learn how to add a launch screen to your iOS app.
toc: false
---
{% comment %}
Consider introducing an image here similar to the android splash-screen one:
https://github.com/flutter/website/issues/8357
{% endcomment -%}
[Launch... | website/src/platform-integration/ios/launch-screen.md/0 | {
"file_path": "website/src/platform-integration/ios/launch-screen.md",
"repo_id": "website",
"token_count": 406
} | 1,314 |
---
title: Writing custom platform-specific code
short-title: Platform-specific code
description: Learn how to write custom platform-specific code in your app.
---
<?code-excerpt path-base="development/platform_integration"?>
This guide describes how to write custom platform-specific code.
Some platform-specific func... | website/src/platform-integration/platform-channels.md/0 | {
"file_path": "website/src/platform-integration/platform-channels.md",
"repo_id": "website",
"token_count": 17760
} | 1,315 |
---
title: Displaying images on the web
short-title: Web images
description: Learn how to load and display images on the web.
---
The web supports the standard [`Image`][1] widget to display images.
However, because web browsers are built to run untrusted code safely,
there are certain limitations in what you can do w... | website/src/platform-integration/web/web-images.md/0 | {
"file_path": "website/src/platform-integration/web/web-images.md",
"repo_id": "website",
"token_count": 2151
} | 1,316 |
---
title: Flutter SDK archive
short-title: Archive
description: "All current Flutter SDK releases: stable, beta, and master."
toc: false
---
<style>
.scrollable-table {
overflow-y: scroll;
max-height: 20rem;
}
</style>
The {{site.sdk.channel | capitalize }} channel contains the
most stable Flutter builds.
To lea... | website/src/release/archive.md/0 | {
"file_path": "website/src/release/archive.md",
"repo_id": "website",
"token_count": 826
} | 1,317 |
---
title: Android Java Gradle migration guide
description: >
How to migrate your Android app if you experience
a run or build error from Gradle.
---
## Summary
If you've recently upgraded Android Studio to the Flamingo
release and have either run or built an existing Android app,
you might have run into an error... | website/src/release/breaking-changes/android-java-gradle-migration-guide.md/0 | {
"file_path": "website/src/release/breaking-changes/android-java-gradle-migration-guide.md",
"repo_id": "website",
"token_count": 1266
} | 1,318 |
---
title: Migration guide for describeEnum and EnumProperty
description: Learn about the removal of describeEnum and how to migrate.
---
## Summary
The global method `describeEnum` has been deprecated. Previous uses
of `describeEnum(Enum.something)` should use
`Enum.something.name` instead.
The class `EnumProperty`... | website/src/release/breaking-changes/describe-enum.md/0 | {
"file_path": "website/src/release/breaking-changes/describe-enum.md",
"repo_id": "website",
"token_count": 866
} | 1,319 |
---
title: Migration guide for ignoringSemantics in IgnorePointer and related classes
description: Removal of ignoringSemantics in IgnorePointer and related classes.
---
## Summary
The `IgnoringPointer` widget allows you to designate an area of the UI
where you don't want to accept pointer events, for example, when
y... | website/src/release/breaking-changes/ignoringsemantics-migration.md/0 | {
"file_path": "website/src/release/breaking-changes/ignoringsemantics-migration.md",
"repo_id": "website",
"token_count": 1317
} | 1,320 |
---
title: Semantics Order of the Overlay Entries in Modal Routes
description: >
The scope of the modal route has a higher semantics
traverse order than its modal barrier.
---
## Summary
We changed the semantics traverse order of the overlay entries in modal routes.
Accessibility talk back or voice over now focus... | website/src/release/breaking-changes/modal-router-semantics-order.md/0 | {
"file_path": "website/src/release/breaking-changes/modal-router-semantics-order.md",
"repo_id": "website",
"token_count": 1585
} | 1,321 |
---
title: Dry layout support for RenderBox
description: >
The method "computeDryLayout" was added to the RenderBox protocol to
correctly calculate its intrinsic size in certain situations.
---
## Summary
A new method named `computeDryLayout` was added to the `RenderBox` protocol.
Subclasses of `RenderBox` are ex... | website/src/release/breaking-changes/renderbox-dry-layout.md/0 | {
"file_path": "website/src/release/breaking-changes/renderbox-dry-layout.md",
"repo_id": "website",
"token_count": 1387
} | 1,322 |
---
title: Replace with title of breaking change
description: >-
Brief description similar to the "context" section below.
Text should break at 80 chars or less.
---
{% comment %}
PLEASE READ THESE GENERAL INSTRUCTIONS:
* All lines of text should be 80 chars OR LESS.
The writers strongly prefer semantic l... | website/src/release/breaking-changes/template.md/0 | {
"file_path": "website/src/release/breaking-changes/template.md",
"repo_id": "website",
"token_count": 1972
} | 1,323 |
---
title: Migrate a Windows project to ensure the window is shown
description: How to update a Windows project to ensure the window is shown
---
Flutter 3.13 fixed a [bug][] that could result in the window not being shown.
Windows projects created using Flutter 3.7 or Flutter 3.10 need to be migrated
to fix this issu... | website/src/release/breaking-changes/windows-show-window-migration.md/0 | {
"file_path": "website/src/release/breaking-changes/windows-show-window-migration.md",
"repo_id": "website",
"token_count": 428
} | 1,324 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.