text
stringlengths 6
13.6M
| id
stringlengths 13
176
| metadata
dict | __index_level_0__
int64 0
1.69k
|
---|---|---|---|
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'ng-flutter'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('ng-flutter');
});
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.content span')?.textContent).toContain('ng-flutter app is running!');
});
});
| samples/web_embedding/ng-flutter/src/app/app.component.spec.ts/0 | {
"file_path": "samples/web_embedding/ng-flutter/src/app/app.component.spec.ts",
"repo_id": "samples",
"token_count": 365
} | 1,422 |
analyzer:
exclude: [flutter, site-shared, src, tmp, 'examples/codelabs']
| website/analysis_options.yaml/0 | {
"file_path": "website/analysis_options.yaml",
"repo_id": "website",
"token_count": 28
} | 1,423 |
name: basic_staggered
publish_to: none
description: An introductory example to staggered animations.
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
dev_dependencies:
example_utils:
path: ../../example_utils
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
| website/examples/_animation/basic_staggered_animation/pubspec.yaml/0 | {
"file_path": "website/examples/_animation/basic_staggered_animation/pubspec.yaml",
"repo_id": "website",
"token_count": 114
} | 1,424 |
name: radial_hero_animation_animate_rectclip
publish_to: none
description: >-
Shows how to apply a radial transformation to the Hero
as it animates to the new route.
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
dev_dependencies:
example_utils:
path: ../../example_utils
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- images/beachball-alpha.png
- images/binoculars-alpha.png
- images/chair-alpha.png
| website/examples/_animation/radial_hero_animation_animate_rectclip/pubspec.yaml/0 | {
"file_path": "website/examples/_animation/radial_hero_animation_animate_rectclip/pubspec.yaml",
"repo_id": "website",
"token_count": 182
} | 1,425 |
// 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.
/*
This app arranges its photos (allPhotos) in a list of blocks,
where each block contains an arrangement of a handful of photos
defined by photoBlockFrames.
*/
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart' show timeDilation;
class Photo {
const Photo(this.asset, this.id);
final String asset;
final int id;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is Photo && runtimeType == other.runtimeType && id == other.id;
@override
int get hashCode => id.hashCode;
}
final List<Photo> allPhotos = List<Photo>.generate(30, (index) {
return Photo('images/pic${index + 1}.jpg', index);
});
class PhotoFrame {
const PhotoFrame(this.width, this.height);
final double width;
final double height;
}
// Defines the app's repeating photo layout "block" in terms of
// photoBlockFrames.length rows of photos.
//
// Each photoBlockFrames[i] item defines the layout of one row of photos
// in terms of their relative widgets and heights. In a row: widths must
// sum to 1.0, heights must be the same.
const List<List<PhotoFrame>> photoBlockFrames = [
[PhotoFrame(1.0, 0.4)],
[PhotoFrame(0.25, 0.3), PhotoFrame(0.75, 0.3)],
[PhotoFrame(0.75, 0.3), PhotoFrame(0.25, 0.3)],
];
class PhotoCheck extends StatelessWidget {
const PhotoCheck({super.key});
@override
Widget build(BuildContext context) {
return DecoratedBox(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: const BorderRadius.all(Radius.circular(16)),
),
child: const Icon(
Icons.check,
size: 32,
color: Colors.white,
),
);
}
}
class PhotoItem extends StatefulWidget {
const PhotoItem({
super.key,
required this.photo,
this.color,
this.onTap,
required this.selected,
});
final Photo photo;
final Color? color;
final VoidCallback? onTap;
final bool selected;
@override
State<PhotoItem> createState() => _PhotoItemState();
}
class _PhotoItemState extends State<PhotoItem> with TickerProviderStateMixin {
late final AnimationController _selectController;
late final Animation<double> _stackScaleAnimation;
late final Animation<RelativeRect> _imagePositionAnimation;
late final Animation<double> _checkScaleAnimation;
late final Animation<double> _checkSelectedOpacityAnimation;
late final AnimationController _replaceController;
late final Animation<Offset> _replaceNewPhotoAnimation;
late final Animation<Offset> _replaceOldPhotoAnimation;
late final Animation<double> _removeCheckAnimation;
late Photo _oldPhoto;
Photo? _newPhoto; // non-null during a remove animation
@override
void initState() {
super.initState();
_oldPhoto = widget.photo;
_selectController = AnimationController(
duration: const Duration(milliseconds: 300), vsync: this);
final Animation<double> easeSelection = CurvedAnimation(
parent: _selectController,
curve: Curves.easeIn,
);
_stackScaleAnimation =
Tween<double>(begin: 1.0, end: 0.85).animate(easeSelection);
_checkScaleAnimation =
Tween<double>(begin: 0.0, end: 1.25).animate(easeSelection);
_checkSelectedOpacityAnimation =
Tween<double>(begin: 0.0, end: 1.0).animate(easeSelection);
_imagePositionAnimation = RelativeRectTween(
begin: const RelativeRect.fromLTRB(0.0, 0.0, 0.0, 0.0),
end: const RelativeRect.fromLTRB(12.0, 12.0, 12.0, 12.0),
).animate(easeSelection);
_replaceController = AnimationController(
duration: const Duration(milliseconds: 300), vsync: this);
final Animation<double> easeInsert = CurvedAnimation(
parent: _replaceController,
curve: Curves.easeIn,
);
_replaceNewPhotoAnimation = Tween<Offset>(
begin: const Offset(1.0, 0.0),
end: Offset.zero,
).animate(easeInsert);
_replaceOldPhotoAnimation = Tween<Offset>(
begin: const Offset(0.0, 0.0),
end: const Offset(-1.0, 0.0),
).animate(easeInsert);
_removeCheckAnimation = Tween<double>(begin: 1.0, end: 0.0).animate(
CurvedAnimation(
parent: _replaceController,
curve: const Interval(0.0, 0.25, curve: Curves.easeIn),
),
);
}
@override
void dispose() {
_selectController.dispose();
_replaceController.dispose();
super.dispose();
}
@override
void didUpdateWidget(PhotoItem oldWidget) {
super.didUpdateWidget(oldWidget);
if (widget.photo != oldWidget.photo) {
_replace(oldWidget.photo, widget.photo);
}
if (widget.selected != oldWidget.selected) _select();
}
Future<void> _replace(Photo oldPhoto, Photo newPhoto) async {
try {
setState(() {
_oldPhoto = oldPhoto;
_newPhoto = newPhoto;
});
await _replaceController.forward().orCancel;
setState(() {
_oldPhoto = newPhoto;
_newPhoto = null;
_replaceController.value = 0.0;
_selectController.value = 0.0;
});
} on TickerCanceled {
// This is never reached...
}
}
void _select() {
if (widget.selected) {
_selectController.forward();
} else {
_selectController.reverse();
}
}
@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
Positioned.fill(
child: ClipRect(
child: SlideTransition(
position: _replaceOldPhotoAnimation,
child: Material(
color: widget.color,
child: InkWell(
onTap: widget.onTap,
child: ScaleTransition(
scale: _stackScaleAnimation,
child: Stack(
children: <Widget>[
PositionedTransition(
rect: _imagePositionAnimation,
child: Image.asset(
_oldPhoto.asset,
fit: BoxFit.cover,
),
),
Positioned(
top: 0.0,
left: 0.0,
child: FadeTransition(
opacity: _checkSelectedOpacityAnimation,
child: FadeTransition(
opacity: _removeCheckAnimation,
child: ScaleTransition(
alignment: Alignment.topLeft,
scale: _checkScaleAnimation,
child: const PhotoCheck(),
),
),
),
),
PositionedTransition(
rect: _imagePositionAnimation,
child: Container(
margin: const EdgeInsets.all(8),
alignment: Alignment.topRight,
child: Text(
widget.photo.id.toString(),
style: const TextStyle(color: Colors.green),
),
),
),
],
),
),
),
),
),
),
),
Positioned.fill(
child: ClipRect(
child: SlideTransition(
position: _replaceNewPhotoAnimation,
child: _newPhoto == null
? null
: Image.asset(
_newPhoto!.asset,
fit: BoxFit.cover,
),
),
),
),
],
);
}
}
class ImagesDemo extends StatefulWidget {
const ImagesDemo({super.key});
@override
State<ImagesDemo> createState() => _ImagesDemoState();
}
class _ImagesDemoState extends State<ImagesDemo>
with SingleTickerProviderStateMixin {
static const double _photoBlockHeight = 576.0;
int? _selectedPhotoIndex;
void _selectPhoto(int photoIndex) {
setState(() {
_selectedPhotoIndex =
photoIndex == _selectedPhotoIndex ? null : photoIndex;
});
}
void _removeSelectedPhoto() {
if (_selectedPhotoIndex == null) return;
setState(() {
allPhotos.removeAt(_selectedPhotoIndex!);
_selectedPhotoIndex = null;
});
}
Widget _buildPhotoBlock(
BuildContext context, int blockIndex, int blockFrameCount) {
final List<Widget> rows = [];
var startPhotoIndex = blockIndex * blockFrameCount;
final photoColor = Colors.grey[500]!;
for (int rowIndex = 0; rowIndex < photoBlockFrames.length; rowIndex += 1) {
final List<Widget> rowChildren = [];
final int rowLength = photoBlockFrames[rowIndex].length;
for (var frameIndex = 0; frameIndex < rowLength; frameIndex += 1) {
final frame = photoBlockFrames[rowIndex][frameIndex];
final photoIndex = startPhotoIndex + frameIndex;
rowChildren.add(
Expanded(
flex: (frame.width * 100).toInt(),
child: Container(
padding: const EdgeInsets.all(4),
height: frame.height * _photoBlockHeight,
child: PhotoItem(
photo: allPhotos[photoIndex],
color: photoColor,
selected: photoIndex == _selectedPhotoIndex,
onTap: () {
_selectPhoto(photoIndex);
},
),
),
),
);
}
rows.add(Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: rowChildren,
));
startPhotoIndex += rowLength;
}
return Column(children: rows);
}
@override
Widget build(BuildContext context) {
timeDilation = 20.0; // 1.0 is normal animation speed.
// Number of PhotoBlockFrames in each _photoBlockHeight block
final int photoBlockFrameCount =
photoBlockFrames.map((l) => l.length).reduce((s, n) => s + n);
return Scaffold(
appBar: AppBar(
title: const Text('Images Demo'),
actions: [
IconButton(
icon: const Icon(Icons.delete),
onPressed: _removeSelectedPhoto,
),
],
),
body: SizedBox.expand(
child: ListView.builder(
padding: const EdgeInsets.all(4),
itemExtent: _photoBlockHeight,
itemCount: (allPhotos.length / photoBlockFrameCount).floor(),
itemBuilder: (context, blockIndex) {
return _buildPhotoBlock(context, blockIndex, photoBlockFrameCount);
},
),
),
);
}
}
void main() {
runApp(
const MaterialApp(
home: ImagesDemo(),
),
);
}
| website/examples/_animation/staggered_pic_selection/lib/main.dart/0 | {
"file_path": "website/examples/_animation/staggered_pic_selection/lib/main.dart",
"repo_id": "website",
"token_count": 5015
} | 1,426 |
# Implicit animations codelab examples
The code samples within this folder are used
within the [Implicit animations codelab][].
- `container1` -> `container5` are used for the
steps of "Shape-shifting effect" portion.
- `container1` is also used for the runnable starter sample and
`container5` for the complete sample.
- `container6` is an extra step that showcases specifying a
non-default animation curve.
- `opacity1` -> `opacity5` are used for the
steps of "Fade-in text effect" portion.
- `opacity1` is also used for the runnable starter sample and
`opacity5` for the complete sample.
- The severity of `missing_required_argument` is ignored manually
in the [`analysis_options.yaml`](analysis_options.yaml) file since the
diffing infrastructure currently can't handle the `ignore` for it.
[Implicit animations codelab]: https://docs.flutter.dev/codelabs/implicit-animations
| website/examples/animation/implicit/README.md/0 | {
"file_path": "website/examples/animation/implicit/README.md",
"repo_id": "website",
"token_count": 254
} | 1,427 |
name: null_safety_basics
description: Some code to demonstrate null safety.
version: 1.0.0
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
dev_dependencies:
example_utils:
path: ../example_utils
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
| website/examples/basics/pubspec.yaml/0 | {
"file_path": "website/examples/basics/pubspec.yaml",
"repo_id": "website",
"token_count": 115
} | 1,428 |
import 'package:flutter/material.dart';
void main() {
runApp(const MaterialApp(home: PhysicsCardDragDemo()));
}
class PhysicsCardDragDemo extends StatelessWidget {
const PhysicsCardDragDemo({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: const DraggableCard(
child: FlutterLogo(
size: 128,
),
),
);
}
}
class DraggableCard extends StatefulWidget {
const DraggableCard({required this.child, super.key});
final Widget child;
@override
State<DraggableCard> createState() => _DraggableCardState();
}
class _DraggableCardState extends State<DraggableCard> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Align(
child: Card(
child: widget.child,
),
);
}
}
| website/examples/cookbook/animation/physics_simulation/lib/starter.dart/0 | {
"file_path": "website/examples/cookbook/animation/physics_simulation/lib/starter.dart",
"repo_id": "website",
"token_count": 364
} | 1,429 |
name: orientation
description: Sample code for orientation 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/orientation/pubspec.yaml/0 | {
"file_path": "website/examples/cookbook/design/orientation/pubspec.yaml",
"repo_id": "website",
"token_count": 89
} | 1,430 |
import 'dart:math' as math;
import 'package:flutter/material.dart';
@immutable
class ExampleExpandableFab extends StatelessWidget {
static const _actionTitles = ['Create Post', 'Upload Photo', 'Upload Video'];
const ExampleExpandableFab({super.key});
void _showAction(BuildContext context, int index) {
showDialog<void>(
context: context,
builder: (context) {
return AlertDialog(
content: Text(_actionTitles[index]),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: const Text('CLOSE'),
),
],
);
},
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Expandable Fab'),
),
body: ListView.builder(
padding: const EdgeInsets.symmetric(vertical: 8),
itemCount: 25,
itemBuilder: (context, index) {
return FakeItem(isBig: index.isOdd);
},
),
floatingActionButton: ExpandableFab(
distance: 112,
children: [
ActionButton(
onPressed: () => _showAction(context, 0),
icon: const Icon(Icons.format_size),
),
ActionButton(
onPressed: () => _showAction(context, 1),
icon: const Icon(Icons.insert_photo),
),
ActionButton(
onPressed: () => _showAction(context, 2),
icon: const Icon(Icons.videocam),
),
],
),
);
}
}
@immutable
class ExpandableFab extends StatefulWidget {
const ExpandableFab({
super.key,
this.initialOpen,
required this.distance,
required this.children,
});
final bool? initialOpen;
final double distance;
final List<Widget> children;
@override
State<ExpandableFab> createState() => _ExpandableFabState();
}
// #docregion ExpandableFabState3
class _ExpandableFabState extends State<ExpandableFab>
with SingleTickerProviderStateMixin {
late final AnimationController _controller;
late final Animation<double> _expandAnimation;
bool _open = false;
@override
void initState() {
super.initState();
_open = widget.initialOpen ?? false;
_controller = AnimationController(
value: _open ? 1.0 : 0.0,
duration: const Duration(milliseconds: 250),
vsync: this,
);
_expandAnimation = CurvedAnimation(
curve: Curves.fastOutSlowIn,
reverseCurve: Curves.easeOutQuad,
parent: _controller,
);
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
void _toggle() {
setState(() {
_open = !_open;
if (_open) {
_controller.forward();
} else {
_controller.reverse();
}
});
}
// code-excerpt-closing-bracket
// #enddocregion ExpandableFabState3
@override
Widget build(BuildContext context) {
return SizedBox.expand(
child: Stack(
alignment: Alignment.bottomRight,
clipBehavior: Clip.none,
children: [
_buildTapToCloseFab(),
..._buildExpandingActionButtons(),
_buildTapToOpenFab(),
],
),
);
}
Widget _buildTapToCloseFab() {
return SizedBox(
width: 56,
height: 56,
child: Center(
child: Material(
shape: const CircleBorder(),
clipBehavior: Clip.antiAlias,
elevation: 4,
child: InkWell(
onTap: _toggle,
child: Padding(
padding: const EdgeInsets.all(8),
child: Icon(
Icons.close,
color: Theme.of(context).primaryColor,
),
),
),
),
),
);
}
List<Widget> _buildExpandingActionButtons() {
final children = <Widget>[];
final count = widget.children.length;
final step = 90.0 / (count - 1);
for (var i = 0, angleInDegrees = 0.0;
i < count;
i++, angleInDegrees += step) {
children.add(
_ExpandingActionButton(
directionInDegrees: angleInDegrees,
maxDistance: widget.distance,
progress: _expandAnimation,
child: widget.children[i],
),
);
}
return children;
}
Widget _buildTapToOpenFab() {
return IgnorePointer(
ignoring: _open,
child: AnimatedContainer(
transformAlignment: Alignment.center,
transform: Matrix4.diagonal3Values(
_open ? 0.7 : 1.0,
_open ? 0.7 : 1.0,
1.0,
),
duration: const Duration(milliseconds: 250),
curve: const Interval(0.0, 0.5, curve: Curves.easeOut),
child: AnimatedOpacity(
opacity: _open ? 0.0 : 1.0,
curve: const Interval(0.25, 1.0, curve: Curves.easeInOut),
duration: const Duration(milliseconds: 250),
child: FloatingActionButton(
onPressed: _toggle,
child: const Icon(Icons.create),
),
),
),
);
}
}
// #docregion ExpandingActionButton
@immutable
class _ExpandingActionButton extends StatelessWidget {
const _ExpandingActionButton({
required this.directionInDegrees,
required this.maxDistance,
required this.progress,
required this.child,
});
final double directionInDegrees;
final double maxDistance;
final Animation<double> progress;
final Widget child;
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: progress,
builder: (context, child) {
final offset = Offset.fromDirection(
directionInDegrees * (math.pi / 180.0),
progress.value * maxDistance,
);
return Positioned(
right: 4.0 + offset.dx,
bottom: 4.0 + offset.dy,
child: Transform.rotate(
angle: (1.0 - progress.value) * math.pi / 2,
child: child!,
),
);
},
child: FadeTransition(
opacity: progress,
child: child,
),
);
}
}
// #enddocregion ExpandingActionButton
@immutable
class ActionButton extends StatelessWidget {
const ActionButton({
super.key,
this.onPressed,
required this.icon,
});
final VoidCallback? onPressed;
final Widget icon;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Material(
shape: const CircleBorder(),
clipBehavior: Clip.antiAlias,
color: theme.colorScheme.secondary,
elevation: 4.0,
child: IconTheme.merge(
data: IconThemeData(color: theme.colorScheme.onSecondary),
child: IconButton(
onPressed: onPressed,
icon: icon,
),
),
);
}
}
@immutable
class FakeItem extends StatelessWidget {
const FakeItem({
super.key,
required this.isBig,
});
final bool isBig;
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.symmetric(vertical: 8, horizontal: 24),
height: isBig ? 128 : 36,
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(8)),
color: Colors.grey.shade300,
),
);
}
}
| website/examples/cookbook/effects/expandable_fab/lib/excerpt3.dart/0 | {
"file_path": "website/examples/cookbook/effects/expandable_fab/lib/excerpt3.dart",
"repo_id": "website",
"token_count": 3205
} | 1,431 |
import 'package:flutter/material.dart';
// #docregion SetupFlow
class SetupFlow extends StatefulWidget {
const SetupFlow({
super.key,
required this.setupPageRoute,
});
final String setupPageRoute;
@override
State<SetupFlow> createState() => SetupFlowState();
}
class SetupFlowState extends State<SetupFlow> {
@override
Widget build(BuildContext context) {
return const SizedBox();
}
}
// #enddocregion SetupFlow
| website/examples/cookbook/effects/nested_nav/lib/setupflow.dart/0 | {
"file_path": "website/examples/cookbook/effects/nested_nav/lib/setupflow.dart",
"repo_id": "website",
"token_count": 140
} | 1,432 |
import 'package:flutter/material.dart';
@immutable
class FilterSelector extends StatefulWidget {
const FilterSelector({
super.key,
required this.filters,
required this.onFilterChanged,
this.padding = const EdgeInsets.symmetric(vertical: 24),
});
final List<Color> filters;
final void Function(Color selectedColor) onFilterChanged;
final EdgeInsets padding;
@override
State<FilterSelector> createState() => _FilterSelectorState();
}
// #docregion PageViewController
class _FilterSelectorState extends State<FilterSelector> {
static const _filtersPerScreen = 5;
static const _viewportFractionPerItem = 1.0 / _filtersPerScreen;
late final PageController _controller;
Color itemColor(int index) => widget.filters[index % widget.filters.length];
@override
void initState() {
super.initState();
_controller = PageController(
viewportFraction: _viewportFractionPerItem,
);
_controller.addListener(_onPageChanged);
}
void _onPageChanged() {
final page = (_controller.page ?? 0).round();
widget.onFilterChanged(widget.filters[page]);
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
Widget _buildCarousel(double itemSize) {
return Container(
height: itemSize,
margin: widget.padding,
child: PageView.builder(
controller: _controller,
itemCount: widget.filters.length,
itemBuilder: (context, index) {
return Center(
child: FilterItem(
color: itemColor(index),
onFilterSelected: () {},
),
);
},
),
);
} //code-excerpt-close-bracket
// #enddocregion PageViewController
@override
Widget build(BuildContext context) {
_buildCarousel(5); // Makes sure _buildCarousel is used
return Container();
}
}
@immutable
class FilterItem extends StatelessWidget {
const FilterItem({
super.key,
required this.color,
this.onFilterSelected,
});
final Color color;
final VoidCallback? onFilterSelected;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onFilterSelected,
child: AspectRatio(
aspectRatio: 1.0,
child: Padding(
padding: const EdgeInsets.all(8),
child: ClipOval(
child: Image.network(
'https://docs.flutter.dev/cookbook/img-files'
'/effects/instagram-buttons/millennial-texture.jpg',
color: color.withOpacity(0.5),
colorBlendMode: BlendMode.hardLight,
),
),
),
),
);
}
}
| website/examples/cookbook/effects/photo_filter_carousel/lib/excerpt5.dart/0 | {
"file_path": "website/examples/cookbook/effects/photo_filter_carousel/lib/excerpt5.dart",
"repo_id": "website",
"token_count": 1047
} | 1,433 |
import 'package:flutter/material.dart';
class Menu extends StatefulWidget {
const Menu({super.key});
@override
State<Menu> createState() => _MenuState();
}
// #docregion AnimationController
class _MenuState extends State<Menu> with SingleTickerProviderStateMixin {
late AnimationController _staggeredController;
@override
void initState() {
super.initState();
_staggeredController = AnimationController(
vsync: this,
);
}
@override
void dispose() {
_staggeredController.dispose();
super.dispose();
}
// #enddocregion AnimationController
@override
Widget build(BuildContext context) {
return Container();
}
}
| website/examples/cookbook/effects/staggered_menu_animation/lib/step2.dart/0 | {
"file_path": "website/examples/cookbook/effects/staggered_menu_animation/lib/step2.dart",
"repo_id": "website",
"token_count": 216
} | 1,434 |
name: focus
description: Sample code for focus 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/focus/pubspec.yaml/0 | {
"file_path": "website/examples/cookbook/forms/focus/pubspec.yaml",
"repo_id": "website",
"token_count": 89
} | 1,435 |
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 = 'Form Validation Demo';
return MaterialApp(
title: appTitle,
home: Scaffold(
appBar: AppBar(
title: const Text(appTitle),
),
body: const MyCustomForm(),
),
);
}
}
// Create a Form widget.
class MyCustomForm extends StatefulWidget {
const MyCustomForm({super.key});
@override
MyCustomFormState createState() {
return MyCustomFormState();
}
}
// Create a corresponding State class.
// This class holds data related to the form.
class MyCustomFormState extends State<MyCustomForm> {
// Create a global key that uniquely identifies the Form widget
// and allows validation of the form.
//
// Note: This is a GlobalKey<FormState>,
// not a GlobalKey<MyCustomFormState>.
final _formKey = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
// Build a Form widget using the _formKey created above.
return Form(
key: _formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// #docregion TextFormField
TextFormField(
// The validator receives the text that the user has entered.
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter some text';
}
return null;
},
),
// #enddocregion TextFormField
Padding(
padding: const EdgeInsets.symmetric(vertical: 16),
// #docregion ElevatedButton
child: ElevatedButton(
onPressed: () {
// Validate returns true if the form is valid, or false otherwise.
if (_formKey.currentState!.validate()) {
// If the form is valid, display a snackbar. In the real world,
// you'd often call a server or save the information in a database.
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Processing Data')),
);
}
},
child: const Text('Submit'),
),
// #enddocregion ElevatedButton
),
],
),
);
}
}
| website/examples/cookbook/forms/validation/lib/main.dart/0 | {
"file_path": "website/examples/cookbook/forms/validation/lib/main.dart",
"repo_id": "website",
"token_count": 1067
} | 1,436 |
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 = 'Fade in images';
return MaterialApp(
title: title,
home: Scaffold(
appBar: AppBar(
title: const Text(title),
),
body: Center(
// #docregion AssetNetwork
child: FadeInImage.assetNetwork(
placeholder: 'assets/loading.gif',
image: 'https://picsum.photos/250?image=9',
),
// #enddocregion AssetNetwork
),
),
);
}
}
| website/examples/cookbook/images/fading_in_images/lib/asset_main.dart/0 | {
"file_path": "website/examples/cookbook/images/fading_in_images/lib/asset_main.dart",
"repo_id": "website",
"token_count": 302
} | 1,437 |
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 = 'Grid List';
return MaterialApp(
title: title,
home: Scaffold(
appBar: AppBar(
title: const Text(title),
),
// #docregion GridView
body: GridView.count(
// Create a grid with 2 columns. If you change the scrollDirection to
// horizontal, this produces 2 rows.
crossAxisCount: 2,
// Generate 100 widgets that display their index in the List.
children: List.generate(100, (index) {
return Center(
child: Text(
'Item $index',
style: Theme.of(context).textTheme.headlineSmall,
),
);
}),
),
// #enddocregion GridView
),
);
}
}
| website/examples/cookbook/lists/grid_lists/lib/main.dart/0 | {
"file_path": "website/examples/cookbook/lists/grid_lists/lib/main.dart",
"repo_id": "website",
"token_count": 449
} | 1,438 |
// #docregion InitializeSDK
import 'package:flutter/widgets.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
Future<void> main() async {
await SentryFlutter.init(
(options) => options.dsn = 'https://example@sentry.io/example',
appRunner: () => runApp(const MyApp()),
);
}
// #enddocregion InitializeSDK
Future<void> captureErrors() async {
try {
// Do something
} catch (exception, stackTrace) {
// #docregion CaptureException
await Sentry.captureException(exception, stackTrace: stackTrace);
// #enddocregion CaptureException
}
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return Container();
}
}
| website/examples/cookbook/maintenance/error_reporting/lib/main.dart/0 | {
"file_path": "website/examples/cookbook/maintenance/error_reporting/lib/main.dart",
"repo_id": "website",
"token_count": 253
} | 1,439 |
import 'package:flutter/material.dart';
// #docregion FirstSecondRoutes
class FirstRoute extends StatelessWidget {
const FirstRoute({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('First Route'),
),
body: Center(
child: ElevatedButton(
child: const Text('Open route'),
onPressed: () {
// Navigate to second route when tapped.
},
),
),
);
}
}
class SecondRoute extends StatelessWidget {
const SecondRoute({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Second Route'),
),
body: Center(
child: ElevatedButton(
onPressed: () {
// Navigate back to first route when tapped.
},
child: const Text('Go back!'),
),
),
);
}
}
| website/examples/cookbook/navigation/navigation_basics/lib/main_step1.dart/0 | {
"file_path": "website/examples/cookbook/navigation/navigation_basics/lib/main_step1.dart",
"repo_id": "website",
"token_count": 417
} | 1,440 |
import 'dart:async';
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
// #docregion fetchPhotos
Future<List<Photo>> fetchPhotos(http.Client client) async {
final response = await client
.get(Uri.parse('https://jsonplaceholder.typicode.com/photos'));
// Use the compute function to run parsePhotos in a separate isolate.
return compute(parsePhotos, response.body);
}
// #enddocregion fetchPhotos
// A function that converts a response body into a List<Photo>.
List<Photo> parsePhotos(String responseBody) {
final parsed =
(jsonDecode(responseBody) as List).cast<Map<String, dynamic>>();
return parsed.map<Photo>((json) => Photo.fromJson(json)).toList();
}
class Photo {
final int albumId;
final int id;
final String title;
final String url;
final String thumbnailUrl;
const Photo({
required this.albumId,
required this.id,
required this.title,
required this.url,
required this.thumbnailUrl,
});
factory Photo.fromJson(Map<String, dynamic> json) {
return Photo(
albumId: json['albumId'] as int,
id: json['id'] as int,
title: json['title'] as String,
url: json['url'] as String,
thumbnailUrl: json['thumbnailUrl'] as String,
);
}
}
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
const appTitle = 'Isolate Demo';
return const MaterialApp(
title: appTitle,
home: MyHomePage(title: appTitle),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(title),
),
body: FutureBuilder<List<Photo>>(
future: fetchPhotos(http.Client()),
builder: (context, snapshot) {
if (snapshot.hasError) {
return const Center(
child: Text('An error has occurred!'),
);
} else if (snapshot.hasData) {
return PhotosList(photos: snapshot.data!);
} else {
return const Center(
child: CircularProgressIndicator(),
);
}
},
),
);
}
}
class PhotosList extends StatelessWidget {
const PhotosList({super.key, required this.photos});
final List<Photo> photos;
@override
Widget build(BuildContext context) {
return GridView.builder(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
),
itemCount: photos.length,
itemBuilder: (context, index) {
return Image.network(photos[index].thumbnailUrl);
},
);
}
}
| website/examples/cookbook/networking/background_parsing/lib/main.dart/0 | {
"file_path": "website/examples/cookbook/networking/background_parsing/lib/main.dart",
"repo_id": "website",
"token_count": 1091
} | 1,441 |
name: reading_writing_files
description: Reading and Writing Files
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
path_provider: ^2.1.2
dev_dependencies:
example_utils:
path: ../../../example_utils
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
| website/examples/cookbook/persistence/reading_writing_files/pubspec.yaml/0 | {
"file_path": "website/examples/cookbook/persistence/reading_writing_files/pubspec.yaml",
"repo_id": "website",
"token_count": 118
} | 1,442 |
class Counter {
int value = 0;
void increment() => value++;
void decrement() => value--;
}
| website/examples/cookbook/testing/unit/counter_app/lib/counter.dart/0 | {
"file_path": "website/examples/cookbook/testing/unit/counter_app/lib/counter.dart",
"repo_id": "website",
"token_count": 31
} | 1,443 |
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
// ignore_for_file: unused_local_variable
// #docregion main
void main() {
testWidgets('MyWidget has a title and message', (tester) async {
await tester.pumpWidget(const MyWidget(title: 'T', message: 'M'));
// Create the Finders.
final titleFinder = find.text('T');
final messageFinder = find.text('M');
});
}
// #enddocregion main
class MyWidget extends StatelessWidget {
const MyWidget({
super.key,
required this.title,
required this.message,
});
final String title;
final String message;
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: Scaffold(
appBar: AppBar(
title: Text(title),
),
body: Center(
child: Text(message),
),
),
);
}
}
| website/examples/cookbook/testing/widget/introduction/test/main_step5_test.dart/0 | {
"file_path": "website/examples/cookbook/testing/widget/introduction/test/main_step5_test.dart",
"repo_id": "website",
"token_count": 355
} | 1,444 |
import 'dart:isolate';
import 'package:flutter/services.dart';
import 'package:shared_preferences/shared_preferences.dart';
void main() {
// Identify the root isolate to pass to the background isolate.
RootIsolateToken rootIsolateToken = RootIsolateToken.instance!;
Isolate.spawn(_isolateMain, rootIsolateToken);
}
Future<void> _isolateMain(RootIsolateToken rootIsolateToken) async {
// Register the background isolate with the root isolate.
BackgroundIsolateBinaryMessenger.ensureInitialized(rootIsolateToken);
// You can now use the shared_preferences plugin.
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
print(sharedPreferences.getBool('isDebug'));
}
| website/examples/development/concurrency/isolates/lib/isolate_binary_messenger.dart/0 | {
"file_path": "website/examples/development/concurrency/isolates/lib/isolate_binary_messenger.dart",
"repo_id": "website",
"token_count": 204
} | 1,445 |
// ignore_for_file: avoid_print, prefer_const_declarations, prefer_const_constructors
import 'package:flutter/material.dart';
// #docregion Main
import 'package:flutter/widgets.dart';
void main() {
runApp(const Center(child: Text('Hello', textDirection: TextDirection.ltr)));
}
// #enddocregion Main
// #docregion Enum
class Color {
Color(this.i, this.j);
final int i;
final int j;
}
// #enddocregion Enum
// #docregion Class
class A<T, V> {
T? i;
V? v;
}
// #enddocregion Class
// #docregion SampleTable
final sampleTable = [
Table(
children: const [
TableRow(
children: [Text('T1')],
)
],
),
Table(
children: const [
TableRow(
children: [Text('T2')],
)
],
),
Table(
children: const [
TableRow(
children: [Text('T3')],
)
],
),
Table(
children: const [
TableRow(
children: [Text('T10')], // modified
)
],
),
];
// #enddocregion SampleTable
// #docregion Const
const foo = 2; // modified
// #docregion FinalFoo
final bar = foo;
// #enddocregion FinalFoo
void onClick() {
print(foo);
print(bar);
}
// #enddocregion Const
| website/examples/development/tools/lib/hot-reload/after.dart/0 | {
"file_path": "website/examples/development/tools/lib/hot-reload/after.dart",
"repo_id": "website",
"token_count": 487
} | 1,446 |
import 'package:flutter/material.dart';
class WelcomeScreen extends StatelessWidget {
const WelcomeScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Text(
'Welcome!',
style: Theme.of(context).textTheme.displayMedium,
),
),
);
}
}
void main() => runApp(const SignUpApp());
class SignUpApp extends StatelessWidget {
const SignUpApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
routes: {
'/': (context) => const SignUpScreen(),
'/welcome': (context) => const WelcomeScreen(),
},
);
}
}
class SignUpScreen extends StatelessWidget {
const SignUpScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.grey[200],
body: const Center(
child: SizedBox(
width: 400,
child: Card(
child: SignUpForm(),
),
),
),
);
}
}
class SignUpForm extends StatefulWidget {
const SignUpForm({super.key});
@override
State<SignUpForm> createState() => _SignUpFormState();
}
class _SignUpFormState extends State<SignUpForm> {
final _firstNameTextController = TextEditingController();
final _lastNameTextController = TextEditingController();
final _usernameTextController = TextEditingController();
double _formProgress = 0;
void _showWelcomeScreen() {
Navigator.of(context).pushNamed('/welcome');
}
// #docregion updateFormProgress
void _updateFormProgress() {
var progress = 0.0;
final controllers = [
_firstNameTextController,
_lastNameTextController,
_usernameTextController
];
// #docregion forLoop
for (final controller in controllers) {
if (controller.value.text.isNotEmpty) {
progress += 1 / controllers.length;
}
}
// #enddocregion forLoop
setState(() {
_formProgress = progress;
});
}
// #enddocregion updateFormProgress
@override
Widget build(BuildContext context) {
// #docregion onChanged
return Form(
onChanged: _updateFormProgress, // NEW
child: Column(
// #enddocregion onChanged
mainAxisSize: MainAxisSize.min,
children: [
LinearProgressIndicator(value: _formProgress),
Text('Sign up', style: Theme.of(context).textTheme.headlineMedium),
Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller: _firstNameTextController,
decoration: const InputDecoration(hintText: 'First name'),
),
),
Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller: _lastNameTextController,
decoration: const InputDecoration(hintText: 'Last name'),
),
),
Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller: _usernameTextController,
decoration: const InputDecoration(hintText: 'Username'),
),
),
// #docregion onPressed
TextButton(
style: ButtonStyle(
foregroundColor: MaterialStateProperty.resolveWith((states) {
return states.contains(MaterialState.disabled)
? null
: Colors.white;
}),
backgroundColor: MaterialStateProperty.resolveWith((states) {
return states.contains(MaterialState.disabled)
? null
: Colors.blue;
}),
),
onPressed:
// #docregion ternary
_formProgress == 1 ? _showWelcomeScreen : null, // UPDATED
// #enddocregion ternary
child: const Text('Sign up'),
),
// #enddocregion onPressed
],
),
);
}
}
| website/examples/get-started/codelab_web/lib/step2.dart/0 | {
"file_path": "website/examples/get-started/codelab_web/lib/step2.dart",
"repo_id": "website",
"token_count": 1782
} | 1,447 |
// #docregion ToggleWidget
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 MaterialApp(
title: 'Sample App',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
home: const SampleAppPage(),
);
}
}
class SampleAppPage extends StatefulWidget {
const SampleAppPage({super.key});
@override
State<SampleAppPage> createState() => _SampleAppPageState();
}
class _SampleAppPageState extends State<SampleAppPage> {
// Default value for toggle.
bool toggle = true;
void _toggle() {
setState(() {
toggle = !toggle;
});
}
Widget _getToggleChild() {
if (toggle) {
return const Text('Toggle One');
} else {
return ElevatedButton(
onPressed: () {},
child: const Text('Toggle Two'),
);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Sample App'),
),
body: Center(
child: _getToggleChild(),
),
floatingActionButton: FloatingActionButton(
onPressed: _toggle,
tooltip: 'Update Text',
child: const Icon(Icons.update),
),
);
}
}
// #enddocregion ToggleWidget
class MyWidget extends StatelessWidget {
const MyWidget({super.key});
// #docregion SimpleWidget
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Sample App'),
),
body: Center(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.only(left: 20, right: 30),
),
onPressed: () {},
child: const Text('Hello'),
),
),
);
}
// #enddocregion SimpleWidget
}
class RowExample extends StatelessWidget {
const RowExample({super.key});
// #docregion Row
@override
Widget build(BuildContext context) {
return const Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('Row One'),
Text('Row Two'),
Text('Row Three'),
Text('Row Four'),
],
);
}
// #enddocregion Row
}
class ColumnExample extends StatelessWidget {
const ColumnExample({super.key});
// #docregion Column
@override
Widget build(BuildContext context) {
return const Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('Column One'),
Text('Column Two'),
Text('Column Three'),
Text('Column Four'),
],
);
}
// #enddocregion Column
}
class ListViewExample extends StatelessWidget {
const ListViewExample({super.key});
// #docregion ListView
@override
Widget build(BuildContext context) {
return ListView(
children: const <Widget>[
Text('Row One'),
Text('Row Two'),
Text('Row Three'),
Text('Row Four'),
],
);
}
// #enddocregion ListView
}
| website/examples/get-started/flutter-for/android_devs/lib/layout.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/android_devs/lib/layout.dart",
"repo_id": "website",
"token_count": 1268
} | 1,448 |
name: android_devs
description: A new Flutter project.
publish_to: none # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
cupertino_icons: ^1.0.6
http: ^1.2.0
shared_preferences: ^2.2.2
intl: any
dev_dependencies:
example_utils:
path: ../../../example_utils
flutter_test:
sdk: flutter
flutter:
generate: true
uses-material-design: true
| website/examples/get-started/flutter-for/android_devs/pubspec.yaml/0 | {
"file_path": "website/examples/get-started/flutter-for/android_devs/pubspec.yaml",
"repo_id": "website",
"token_count": 209
} | 1,449 |
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),
debugShowCheckedModeBanner: false,
home: HomePage(),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
child: Center(
child:
// docregion Image
Image.asset(
'images/Blueberries.jpg',
width: 200,
height: 200,
),
// enddocregion Image
),
);
}
}
| website/examples/get-started/flutter-for/ios_devs/lib/image.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/ios_devs/lib/image.dart",
"repo_id": "website",
"token_count": 336
} | 1,450 |
import 'package:flutter/material.dart';
import 'package:flutter/services.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 MaterialApp(
title: 'Sample Shared App Handler',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
home: const SampleAppPage(),
);
}
}
class SampleAppPage extends StatefulWidget {
const SampleAppPage({super.key});
@override
State<SampleAppPage> createState() => _SampleAppPageState();
}
class _SampleAppPageState extends State<SampleAppPage> {
static const platform = MethodChannel('app.channel.shared.data');
String dataShared = 'No data';
@override
void initState() {
super.initState();
getSharedText();
}
@override
Widget build(BuildContext context) {
return Scaffold(body: Center(child: Text(dataShared)));
}
Future<void> getSharedText() async {
var sharedData = await platform.invokeMethod('getSharedText');
if (sharedData != null) {
setState(() {
dataShared = sharedData;
});
}
}
}
| website/examples/get-started/flutter-for/ios_devs/lib/request_data.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/ios_devs/lib/request_data.dart",
"repo_id": "website",
"token_count": 435
} | 1,451 |
// Dart
import 'dart:convert';
import 'package:http/http.dart' as http;
class Example {
Future<String> _getIPAddress() async {
final url = Uri.https('httpbin.org', '/ip');
final response = await http.get(url);
final ip = jsonDecode(response.body)['origin'] as String;
return ip;
}
}
/// An async function returns a `Future`.
/// It can also return `void`, unless you use
/// the `avoid_void_async` lint. In that case,
/// return `Future<void>`.
void main() async {
final example = Example();
try {
final ip = await example._getIPAddress();
print(ip);
} catch (error) {
print(error);
}
}
| website/examples/get-started/flutter-for/react_native_devs/lib/async.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/react_native_devs/lib/async.dart",
"repo_id": "website",
"token_count": 222
} | 1,452 |
name: react_native_devs
description: A new Flutter project.
publish_to: none
version: 1.0.0+1
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.6
http: ^1.2.0
google_sign_in: ^6.2.1
shared_preferences: ^2.2.2
my_widgets:
path: my_widgets
dev_dependencies:
example_utils:
path: ../../../example_utils
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
| website/examples/get-started/flutter-for/react_native_devs/pubspec.yaml/0 | {
"file_path": "website/examples/get-started/flutter-for/react_native_devs/pubspec.yaml",
"repo_id": "website",
"token_count": 195
} | 1,453 |
import 'package:flutter/material.dart';
void main() {
runApp(const SampleApp());
}
class SampleApp extends StatelessWidget {
/// This widget is the root of your application.
const SampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Sample App',
home: SampleAppPage(),
);
}
}
class SampleAppPage extends StatelessWidget {
const SampleAppPage({super.key});
List<Widget> _getListData() {
return List<Widget>.generate(
100,
(index) => Padding(
padding: const EdgeInsets.all(10),
child: Text('Row $index'),
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Sample App')),
body: ListView(children: _getListData()),
);
}
}
| website/examples/get-started/flutter-for/xamarin_devs/lib/listview.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/xamarin_devs/lib/listview.dart",
"repo_id": "website",
"token_count": 313
} | 1,454 |
name: google_sign_in_example
publish_to: none
environment:
sdk: ^3.3.0
dependencies:
collection: any # Pull the version of collection from Flutter.
extension_google_sign_in_as_googleapis_auth: ^2.0.12
flutter:
sdk: flutter
google_sign_in: ^6.2.1
googleapis: ^13.1.0
http: ^1.2.0
dev_dependencies:
example_utils:
path: ../example_utils
| website/examples/googleapis/pubspec.yaml/0 | {
"file_path": "website/examples/googleapis/pubspec.yaml",
"repo_id": "website",
"token_count": 150
} | 1,455 |
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// #docregion all
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
// #docregion 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(
appBar: AppBar(
title: const Text(appTitle),
),
// #docregion centered-text
body: const Center(
// #docregion text
child: Text('Hello World'),
// #enddocregion text
),
// #enddocregion centered-text
),
);
}
}
// #enddocregion all
| website/examples/layout/base/lib/main.dart/0 | {
"file_path": "website/examples/layout/base/lib/main.dart",
"repo_id": "website",
"token_count": 330
} | 1,456 |
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart' show debugPaintSizeEnabled;
void main() {
debugPaintSizeEnabled = true; // Remove to suppress visual layout
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter layout demo',
home: Scaffold(
appBar: AppBar(
title: const Text('Flutter layout demo'),
),
// Change to buildColumn() for the other column example
body: Center(child: buildRow()),
),
);
}
Widget buildRow() =>
// #docregion Row
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Image.asset('images/pic1.jpg'),
Image.asset('images/pic2.jpg'),
Image.asset('images/pic3.jpg'),
],
);
// #enddocregion Row
Widget buildColumn() =>
// #docregion Column
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Image.asset('images/pic1.jpg'),
Image.asset('images/pic2.jpg'),
Image.asset('images/pic3.jpg'),
],
);
// #enddocregion Column
}
| website/examples/layout/row_column/lib/main.dart/0 | {
"file_path": "website/examples/layout/row_column/lib/main.dart",
"repo_id": "website",
"token_count": 538
} | 1,457 |
// ignore_for_file: unused_local_variable
// #docregion FFI
import 'dart:ffi';
import 'package:ffi/ffi.dart'; // contains .toNativeUtf16() extension method
typedef MessageBoxNative = Int32 Function(
IntPtr hWnd,
Pointer<Utf16> lpText,
Pointer<Utf16> lpCaption,
Int32 uType,
);
typedef MessageBoxDart = int Function(
int hWnd,
Pointer<Utf16> lpText,
Pointer<Utf16> lpCaption,
int uType,
);
void exampleFfi() {
final user32 = DynamicLibrary.open('user32.dll');
final messageBox =
user32.lookupFunction<MessageBoxNative, MessageBoxDart>('MessageBoxW');
final result = messageBox(
0, // No owner window
'Test message'.toNativeUtf16(), // Message
'Window caption'.toNativeUtf16(), // Window title
0, // OK button only
);
}
// #enddocregion FFI
| website/examples/resources/architectural_overview/lib/ffi.dart/0 | {
"file_path": "website/examples/resources/architectural_overview/lib/ffi.dart",
"repo_id": "website",
"token_count": 298
} | 1,458 |
import 'package:state_mgmt/src/provider.dart';
import 'package:test/test.dart';
void main() {
// #docregion test
test('adding item increases total cost', () {
final cart = CartModel();
final startingPrice = cart.totalPrice;
var i = 0;
cart.addListener(() {
expect(cart.totalPrice, greaterThan(startingPrice));
i++;
});
cart.add(Item('Dash'));
expect(i, 1);
});
// #enddocregion test
}
| website/examples/state_mgmt/simple/test/model_test.dart/0 | {
"file_path": "website/examples/state_mgmt/simple/test/model_test.dart",
"repo_id": "website",
"token_count": 167
} | 1,459 |
// #docregion PerfOverlay
import 'package:flutter/material.dart';
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
showPerformanceOverlay: true,
title: 'My Awesome App',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
home: const MyHomePage(title: 'My Awesome App'),
);
}
}
// #enddocregion PerfOverlay
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
Widget build(BuildContext context) {
return Text(title);
}
}
| website/examples/testing/code_debugging/lib/performance_overlay.dart/0 | {
"file_path": "website/examples/testing/code_debugging/lib/performance_overlay.dart",
"repo_id": "website",
"token_count": 242
} | 1,460 |
import 'package:flutter/material.dart';
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const Text('hello world!');
}
}
| website/examples/testing/errors/lib/my_app.dart/0 | {
"file_path": "website/examples/testing/errors/lib/my_app.dart",
"repo_id": "website",
"token_count": 66
} | 1,461 |
import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import 'app_model.dart';
import 'global/device_size.dart';
import 'global/device_type.dart';
import 'global/targeted_actions.dart';
import 'pages/adaptive_data_table_page.dart';
import 'pages/adaptive_grid_page.dart';
import 'pages/adaptive_reflow_page.dart';
import 'pages/focus_examples_page.dart';
import 'pages/login_page.dart';
import 'widgets/app_title_bar.dart';
import 'widgets/buttons.dart';
import 'widgets/ok_cancel_dialog.dart';
List<Widget> getMainMenuChildren(BuildContext context) {
// Define a method to change pages in the AppModel
void changePage(int value) => context.read<AppModel>().selectedIndex = value;
int index = context.select<AppModel, int>((m) => m.selectedIndex);
return [
SelectedPageButton(
onPressed: () => changePage(0),
label: 'Adaptive Grid',
isSelected: index == 0),
SelectedPageButton(
onPressed: () => changePage(1),
label: 'Adaptive Data Table',
isSelected: index == 1),
SelectedPageButton(
onPressed: () => changePage(2),
label: 'Adaptive Reflow',
isSelected: index == 2),
SelectedPageButton(
onPressed: () => changePage(3),
label: 'Focus Examples',
isSelected: index == 3),
];
}
// Uses a tab navigation + drawer, or a side-menu that combines both
class MainAppScaffold extends StatefulWidget {
const MainAppScaffold({super.key});
@override
State<MainAppScaffold> createState() => _MainAppScaffoldState();
}
class _MainAppScaffoldState extends State<MainAppScaffold> {
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey();
@override
Widget build(BuildContext context) {
bool useTabs = MediaQuery.of(context).size.width < FormFactor.tablet;
bool isLoggedOut =
context.select<AppModel, bool>((m) => m.isLoggedIn) == false;
return TargetedActionScope(
shortcuts: <LogicalKeySet, Intent>{
LogicalKeySet(LogicalKeyboardKey.keyA, LogicalKeyboardKey.control):
SelectAllIntent(),
LogicalKeySet(LogicalKeyboardKey.keyS, LogicalKeyboardKey.control):
SelectNoneIntent(),
LogicalKeySet(LogicalKeyboardKey.delete): DeleteIntent(),
},
child: WindowBorder(
color: Colors.white,
child: Material(
child: Column(
children: [
const AppTitleBar(),
Expanded(
child: isLoggedOut
// If logged out, show just the login page with no menus
? const LoginPage()
// Otherwise, show the full application with dynamic scaffold
: Focus(
autofocus: true,
child: Scaffold(
key: _scaffoldKey,
drawer: useTabs
? const _SideMenu(showPageButtons: false)
: null,
appBar: useTabs
? AppBar(backgroundColor: Colors.blue.shade300)
: null,
body: Stack(children: [
// Vertical layout with Tab controller and drawer
if (useTabs) ...[
Column(
children: [
Expanded(child: _PageStack()),
_TabMenu(),
],
)
]
// Horizontal layout with desktop style side menu
else ...[
Row(
children: [
const _SideMenu(),
Expanded(child: _PageStack()),
],
),
],
]),
),
),
),
],
),
),
),
);
}
}
class _PageStack extends StatelessWidget {
@override
Widget build(BuildContext context) {
int index = context.select<AppModel, int>((model) => model.selectedIndex);
Widget? page;
if (index == 0) page = const AdaptiveGridPage();
if (index == 1) page = AdaptiveDataTablePage();
if (index == 2) page = const AdaptiveReflowPage();
if (index == 3) page = const FocusExamplesPage();
return FocusTraversalGroup(child: page ?? Container());
}
}
class _SideMenu extends StatelessWidget {
const _SideMenu({this.showPageButtons = true});
final bool showPageButtons;
@override
Widget build(BuildContext context) {
Future<void> handleLogoutPressed() async {
String message = 'Are you sure you want to logout?';
bool? doLogout = await showDialog(
context: context,
builder: (_) => OkCancelDialog(message: message),
);
if (doLogout ?? false) {
if (!context.mounted) return;
context.read<AppModel>().logout();
}
}
return Container(
color: Colors.white,
width: 250,
child: Stack(
children: [
// Buttons
Column(children: [
const SizedBox(height: Insets.extraLarge),
if (showPageButtons) ...getMainMenuChildren(context),
const SizedBox(height: Insets.extraLarge),
const SecondaryMenuButton(label: 'Submenu Item 1'),
const SecondaryMenuButton(label: 'Submenu Item 2'),
const SecondaryMenuButton(label: 'Submenu Item 3'),
const Spacer(),
OutlinedButton(
onPressed: handleLogoutPressed,
child: const Text('Logout'),
),
const SizedBox(height: Insets.large),
]),
// Divider
Align(
alignment: Alignment.centerRight,
child: Container(
width: 1, height: double.infinity, color: Colors.blue)),
],
),
);
}
}
class _TabMenu extends StatelessWidget {
@override
Widget build(BuildContext context) {
// Wrap all the main menu buttons in Expanded() so they fill up the screen horizontally
List<Expanded> tabButtons = getMainMenuChildren(context)
.map((btn) => Expanded(child: btn))
.toList();
return Column(
children: [
// Top Divider
Container(width: double.infinity, height: 1, color: Colors.blue),
// Tab buttons
Row(children: tabButtons),
],
);
}
}
| website/examples/ui/layout/adaptive_app_demos/lib/main_app_scaffold.dart/0 | {
"file_path": "website/examples/ui/layout/adaptive_app_demos/lib/main_app_scaffold.dart",
"repo_id": "website",
"token_count": 3288
} | 1,462 |
import 'package:flutter/material.dart';
class MyAppBar extends StatelessWidget {
const MyAppBar({required this.title, super.key});
// Fields in a Widget subclass are always marked "final".
final Widget title;
@override
Widget build(BuildContext context) {
return Container(
height: 56, // in logical pixels
padding: const EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(color: Colors.blue[500]),
// Row is a horizontal, linear layout.
child: Row(
children: [
const IconButton(
icon: Icon(Icons.menu),
tooltip: 'Navigation menu',
onPressed: null, // null disables the button
),
// Expanded expands its child
// to fill the available space.
Expanded(
child: title,
),
const IconButton(
icon: Icon(Icons.search),
tooltip: 'Search',
onPressed: null,
),
],
),
);
}
}
class MyScaffold extends StatelessWidget {
const MyScaffold({super.key});
@override
Widget build(BuildContext context) {
// Material is a conceptual piece
// of paper on which the UI appears.
return Material(
// Column is a vertical, linear layout.
child: Column(
children: [
MyAppBar(
title: Text(
'Example title',
style: Theme.of(context) //
.primaryTextTheme
.titleLarge,
),
),
const Expanded(
child: Center(
child: Text('Hello, world!'),
),
),
],
),
);
}
}
void main() {
runApp(
const MaterialApp(
title: 'My app', // used by the OS task switcher
home: SafeArea(
child: MyScaffold(),
),
),
);
}
| website/examples/ui/widgets_intro/lib/main_myappbar.dart/0 | {
"file_path": "website/examples/ui/widgets_intro/lib/main_myappbar.dart",
"repo_id": "website",
"token_count": 876
} | 1,463 |
name: docs_flutter_dev
publish_to: none
environment:
sdk: ^3.3.0
dev_dependencies:
build_runner: ^2.4.8
code_excerpt_updater:
path: site-shared/packages/code_excerpt_updater
code_excerpter:
path: site-shared/packages/code_excerpter
flutter_site:
path: tool/flutter_site
| website/pubspec.yaml/0 | {
"file_path": "website/pubspec.yaml",
"repo_id": "website",
"token_count": 125
} | 1,464 |
<figure class="site-figure">
<div class="site-figure-container">
<img src='/assets/images/docs/get-started/android/{{include.image}}'
alt='{{include.alt}} on Android'
class='{{include.class}}'>
<figcaption class="figure-caption">Android</figcaption>
</div>
<div class="site-figure-container">
<img src='/assets/images/docs/get-started/ios/{{include.image}}'
alt='{{include.alt}} on iOS'
class='{{include.class}}'>
<figcaption class="figure-caption">iOS</figcaption>
</div>
</figure>
| website/src/_includes/docs/android-ios-figure-pair.md/0 | {
"file_path": "website/src/_includes/docs/android-ios-figure-pair.md",
"repo_id": "website",
"token_count": 231
} | 1,465 |
1. To open the Flutter app directory, go to
**File** <span aria-label="and then">></span>
**Open Folder...** and choose the `my_app` directory.
1. Open the `lib/main.dart` file.
1. If you can build an app for more than one device,
you must select the device first.
Go to
**View** <span aria-label="and then">></span>
**Command Palette...**
You can also press <kbd>Ctrl</kbd> / <kbd>Cmd</kbd> +
<kbd>Shift</kbd> + <kbd>P</kbd>.
1. Type `flutter select`.
1. Click the **Flutter: Select Device** command.
1. Choose your target device.
1. Click the debug icon
(![VS Code's bug icon to trigger the debugging mode of a Flutter app](/assets/images/docs/testing/debugging/vscode-ui/icons/debug.png)).
This opens the **Debug** pane and launches the app.
Wait for the app to launch on the device and for the debug pane to
indicate **Connected**.
The debugger takes longer to launch the first time.
Subsequent launches start faster.
This Flutter app contains two buttons:
- **Launch in browser**: This button opens this page in the
default browser of your device.
- **Launch in app**: This button opens this page within your app.
This button only works for iOS or Android. Desktop apps launch a browser. | website/src/_includes/docs/debug/debug-flow-vscode-as-start.md/0 | {
"file_path": "website/src/_includes/docs/debug/debug-flow-vscode-as-start.md",
"repo_id": "website",
"token_count": 404
} | 1,466 |
#### Configure your iOS simulator
To prepare to run and test your Flutter app on the iOS simulator,
follow this procedure.
1. To install the iOS Simulator, run the following command.
```terminal
{{prompt1}} xcodebuild -downloadPlatform iOS
```
1. To start the Simulator, run the following command:
```terminal
$ open -a Simulator
```
1. Set your Simulator to use a 64-bit device.
This covers the iPhone 5s or later.
* From **Xcode**, choose a simulator device type.
1. Go to **Window** <span aria-label="and then">></span>
**Devices and Simulators**.
You can also press <kbd>Cmd</kbd> + <kbd>Shift</kbd> + <kbd>2</kbd>.
2. Once the **Devices and Simulators** dialog opens,
click **Simulators**.
3. Choose a **Simulator** from the left-hand list or press **+** to
create a new simulator.
* From the **Simulator** app, go to
**File** <span aria-label="and then">></span>
**Open Simulator** <span aria-label="and then">></span>
Choose your target iOS device.
* To check the device version in the Simulator,
open the **Settings** app <span aria-label="and then">></span>
**General** <span aria-label="and then">></span>
**About**.
1. The simulated high-screen density iOS devices might overflow your screen.
If that appears true on your Mac, change the presented size in the
**Simulator** app.
| **Display Size** | **Menu command** | **Keyboard shortcut** |
|:-----------------:|:------------------------------------------------------------------:|:-----------------------------:|
| Small | **Window** <span aria-label="and then">></span> **Physical Size** | <kbd>Cmd</kbd> + <kbd>1</kbd> |
| Moderate | **Window** <span aria-label="and then">></span> **Point Accurate** | <kbd>Cmd</kbd> + <kbd>2</kbd> |
| HD accurate | **Window** <span aria-label="and then">></span> **Pixel Accurate** | <kbd>Cmd</kbd> + <kbd>3</kbd> |
| Fit to screen | **Window** <span aria-label="and then">></span> **Fit Screen** | <kbd>Cmd</kbd> + <kbd>4</kbd> |
{:.table.table-striped}
| website/src/_includes/docs/install/devices/ios-simulator.md/0 | {
"file_path": "website/src/_includes/docs/install/devices/ios-simulator.md",
"repo_id": "website",
"token_count": 840
} | 1,467 |
{% assign target = include.target %}
{% case target %}
{% when 'mobile-ios' %}
{% assign v-target = "iOS" %}
{% when 'mobile-android' %}
{% assign v-target = "Android" %}
{% else %}
{% assign v-target = target %}
{% endcase %}
{% 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 development environment must meet the following
minimal hardware requirements.
<div class="table-wrapper" markdown="1">
| Requirement | Minimum | Recommended |
|:-----------------------------|:------------------------------------------------------------------------:|:-------------------:|
| CPU Cores | 4 | 8 |
| Memory in GB | 8 | 16 |
| Display resolution in pixels | WXGA (1366 x 768) | FHD (1920 x 1080) |
| Free disk space in GB | {% include docs/install/reqs/macos/storage.md target=target %}
</div>
### Software requirements
To write and compile Flutter code for {{v-target}},
install the following packages.
#### Operating system
Flutter supports macOS {{site.devmin.macos}} or later.
This guide presumes your Mac runs the `zsh` as your default shell.
{% include docs/install/reqs/macos/zsh-config.md target=target %}
{% include docs/install/reqs/macos/apple-silicon.md %}
#### Development tools
Download and install the following packages.
{% include docs/install/reqs/macos/software.md target=target %}
The developers of the preceding software provide support for those products.
To troubleshoot installation issues, consult that product's documentation.
{% include /docs/install/reqs/flutter-sdk/flutter-doctor-precedence.md %}
#### Text editor or integrated development environment
You can build apps with Flutter using any text editor or
integrated development environment (IDE) combined with
Flutter's command-line tools.
Using an IDE with a Flutter extension or plugin provides code completion,
syntax highlighting, widget editing assists, debugging, and other features.
Popular options include:
* [Visual Studio Code][] {{site.appmin.vscode}} or later
with the [Flutter extension for VS Code][].
* [Android Studio][] {{site.appmin.android_studio}} or later
with the [Flutter plugin for IntelliJ][].
* [IntelliJ IDEA][] {{site.appmin.intellij_idea}} or later
with both the [Flutter plugin for IntelliJ][] and
the [Android plugin for IntelliJ][].
{{site.alert.recommend}}
The Flutter team recommends installing
[Visual Studio Code][] {{site.appmin.vscode}} or later and the
[Flutter extension for VS Code][].
This combination simplifies installing the Flutter SDK.
{{site.alert.end}}
[Android Studio]: https://developer.android.com/studio/install
[IntelliJ IDEA]: https://www.jetbrains.com/help/idea/installation-guide.html
[Visual Studio Code]: https://code.visualstudio.com/docs/setup/mac
[Flutter extension for VS Code]: https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[Flutter plugin for IntelliJ]: https://plugins.jetbrains.com/plugin/9212-flutter
[Android plugin for IntelliJ]: https://plugins.jetbrains.com/plugin/22989-android
| website/src/_includes/docs/install/reqs/macos/base.md/0 | {
"file_path": "website/src/_includes/docs/install/reqs/macos/base.md",
"repo_id": "website",
"token_count": 1303
} | 1,468 |
After the app build completes, your device displays your app.
{% include docs/app-figure.md img-class="site-mobile-screenshot border"
path-prefix="get-started" platform="macOS" image="starter-app.png"
caption="Starter app" %}
## Try hot reload
Flutter offers a fast development cycle with _Stateful Hot Reload_,
the ability to reload the code of a live running app without
restarting or losing app state.
You can change your app source code, run the hot reload command in
{{include.ide}}, and see the change in your target device.
1. Open `lib/main.dart`.
1. Change the word `pushed` to `clicked` in the following string.
It is on line 109 of the `main.dart` file as of this writing.
| **Original** | **New** |
|:-------------------------------------------------:|:--------------------------------------------------:|
| `'You have pushed the button this many times:' ,` | `'You have clicked the button this many times:' ,` |
{:.table.table-striped}
{{site.alert.important}}
_Don't stop your app._ Let your app run.
{{site.alert.end}}
1. Save your changes{{include.save_changes}}
Your app updates the string as you watch.
{% include docs/app-figure.md img-class="site-mobile-screenshot border"
path-prefix="get-started" platform="macOS" image="starter-app-hot-reload.png"
caption="Starter app after hot reload" %}
| website/src/_includes/docs/install/test-drive/try-hot-reload.md/0 | {
"file_path": "website/src/_includes/docs/install/test-drive/try-hot-reload.md",
"repo_id": "website",
"token_count": 488
} | 1,469 |
{% assign active_entries = include.page_url_path | active_nav_for_page: site.data.activenav -%}
<ul class="nav flex-column">
{%- for entry in include.nav -%}
{% if entry == 'divider' -%}
<li aria-hidden="true"><div class="sidebar-primary-divider"></div></li>
{% elsif entry contains 'header' -%}
<li class="nav-header">{{entry.header}}</li>
{% else -%}
{% assign id = include.base_id | append: '-sidenav-' | append: forloop.index -%}
{% if forloop.index == active_entries[0] -%}
{% assign isActive = true -%}
{% assign class = 'active' -%}
{% else -%}
{% assign isActive = false -%}
{% assign class = '' -%}
{% endif -%}
{% if entry contains 'children' -%}
{% if isActive or entry.expanded -%}
{% assign expanded = 'true' -%}
{% assign show = 'show' -%}
{% else -%}
{% assign class = 'collapsed' -%}
{% assign expanded = 'false' -%}
{% assign show = '' -%}
{% endif -%}
<li class="nav-item">
<a class="nav-link {{class}} collapsible" data-toggle="collapse" href="#{{id}}" role="button"
aria-expanded="{{expanded}}" aria-controls="{{id}}"
>{{entry.title}}</a>
<ul class="nav flex-column flex-nowrap collapse {{show}}" id="{{id}}">
{% if isActive -%}
{% include sidenav-level-2.html parent_id=id children=entry.children active_entries=active_entries -%}
{% else -%}
{% include sidenav-level-2.html parent_id=id children=entry.children -%}
{% endif -%}
</ul>
</li>
{%- elsif entry contains 'permalink' -%}
{% if entry.permalink contains '://' -%}
{% assign isExternal = true -%}
{% else -%}
{% assign isExternal = false -%}
{% endif -%}
<li class="nav-item">
<a class="{{class}} nav-link" href="{{entry.permalink}}"
{%- if isExternal %} target="_blank" rel="noopener" {%- endif -%}
>{{entry.title}}</a>
</li>
{% endif -%}
{% endif -%}
{%- endfor -%}
</ul>
| website/src/_includes/sidenav-level-1.html/0 | {
"file_path": "website/src/_includes/sidenav-level-1.html",
"repo_id": "website",
"token_count": 1055
} | 1,470 |
module DartSite
# Takes the given code excerpt (with the given attributes) and creates
# some framing HTML: e.g., a div with possible excerpt title in a header.
class CodeExcerptFramer
def frame_code(title, classes, attrs, escaped_code, indent, secondary_class)
_unindented_template(title, classes, attrs, escaped_code.gsub('\\','\\\\\\\\'), secondary_class)
end
private
# @param [String] div_classes, in the form "foo bar"
# @param [Hash] attrs: attributes as attribute-name/value pairs.
def _unindented_template(title, _div_classes, attrs, escaped_code, secondary_class)
div_classes = ['code-excerpt']
div_classes << _div_classes if _div_classes
pre_classes = attrs[:class] || []
pre_classes.unshift("lang-#{attrs[:lang]}") if attrs[:lang]
pre_classes.unshift('prettyprint')
# Was: <code>escaped_code</code>!n
# Also had: <copy-container></copy-container>
# Ensure that the template starts and ends with a blank line.
# We're rendering to markdown, and we don't want the frame HTML
# to be adjacent to any text, otherwise the text might not be rendered
# as a paragraph (e.g., esp. if inside an <li>).
<<~TEMPLATE.gsub(/!n\s*/,'').sub(/\bescaped_code\b/,escaped_code)
<div class="#{div_classes * ' '}">
#{title ? "<div class=\"code-excerpt__header\">#{title}</div>" : '!n'}
<div class="code-excerpt__code">!n
<pre>!n
<code class="#{secondary_class} #{pre_classes * ' '}">!n
escaped_code!n
</code>!n
</pre>!n
</div>
</div>
TEMPLATE
end
end
end
| website/src/_plugins/code_excerpt_framer.rb/0 | {
"file_path": "website/src/_plugins/code_excerpt_framer.rb",
"repo_id": "website",
"token_count": 698
} | 1,471 |
@use '../base/variables' as *;
@use '../vendor/bootstrap';
.site-banner {
background-color: $flutter-color-blue;
color: $site-color-white;
font-family: $site-font-family-alt;
font-size: bootstrap.$font-size-lg;
padding: bootstrap.bs-spacer(5);
position: relative;
text-align: center;
z-index: bootstrap.$zindex-sticky;
p {
margin-bottom: bootstrap.bs-spacer(3);
&:last-of-type {
margin-bottom: 0;
}
}
a {
color: $flutter-color-blue-on-dark;
&:hover {
color: $flutter-color-blue-on-dark;
}
}
// customizations per banner
&.site-banner--default {
&:before,
&:after {
background-image: url('/assets/images/flutter-chevron-bg.svg');
background-position: right center;
background-repeat: no-repeat;
background-size: auto 100%;
content: '';
height: 100%;
left: 0;
pointer-events: none;
position: absolute;
top: 0;
width: 100%;
}
&:before {
transform: scaleX(-1);
}
}
}
| website/src/_sass/components/_banner.scss/0 | {
"file_path": "website/src/_sass/components/_banner.scss",
"repo_id": "website",
"token_count": 453
} | 1,472 |
@use '../base/variables' as *;
// Import from NPM library directly
@forward '../../../node_modules/bootstrap-scss/bootstrap' with (
$primary: $site-color-primary,
$body-color: $site-color-body,
// Font config
$font-family-sans-serif: $site-font-family-base,
$font-family-monospace: $site-font-family-monospace,
$font-weight-base: $font-size-base-weight,
$font-weight-bold: 500,
$headings-font-family: $site-font-family-alt,
$headings-font-weight: $font-size-base-weight,
$dt-font-weight: $font-size-base-weight,
// Layout config
$container-max-widths: (
sm: 540px,
md: 720px,
lg: 960px,
xl: 1140px,
xxl: 1330px
),
$grid-breakpoints: (
0: 0,
xxs: 320px,
xs: 480px,
sm: 576px,
md: 768px,
lg: 992px,
xl: 1200px,
xxl: 1440px
),
$spacers: (
1: ($site-spacer * 0.25),
2: ($site-spacer * 0.5),
3: ($site-spacer * 0.75),
4: $site-spacer,
5: ($site-spacer * 1.25),
6: ($site-spacer * 1.5),
7: ($site-spacer * 1.75),
8: ($site-spacer * 2),
9: ($site-spacer * 2.25),
10: ($site-spacer * 2.5),
11: ($site-spacer * 2.75),
12: ($site-spacer * 3),
),
// Component config
$alert-padding-y: $site-spacer * 1.5,
$alert-padding-x: $site-spacer * 1.5,
$border-radius: 0,
$border-radius-lg: 0,
$border-radius-sm: 0,
$breadcrumb-divider: 'chevron_right',
$breadcrumb-item-padding: .25rem,
$breadcrumb-bg: none,
$breadcrumb-padding-x: 0,
$card-border-radius: 4px,
$card-group-margin: $site-spacer * 0.5,
$grid-gutter-width: 50px,
$nav-tabs-link-active-color: $site-color-body,
$nav-tabs-link-active-border-color: transparent transparent $site-color-primary,
$tooltip-bg: #343a40,
);
@use '../../../node_modules/bootstrap-scss/bootstrap';
@function bs-spacer($key: 3) {
@return map-get(bootstrap.$spacers, $key);
}
// Bootstrap adjustments
.alert {
border: none;
border-radius: 0;
color: $site-color-body;
margin-top: 1rem;
padding: 1.25rem;
.alert-header {
display: flex;
align-items: center;
gap: 0.5rem;
font-family: $site-font-family-alt;
font-size: 1.125rem;
font-weight: 500;
}
.alert-content {
margin-top: 0.5rem;
}
i.material-icons {
font-size: 1.25em;
user-select: none;
}
code {
background-color: transparent;
}
p:last-child {
margin-bottom: 0;
}
&.alert-success {
width: auto;
background-color: $alert-success-bg;
}
&.alert-info {
width: auto;
background-color: $alert-info-bg;
}
&.alert-secondary {
width: auto;
background-color: $flutter-color-grey-500;
}
&.alert-warning {
width: auto;
background-color: $alert-warning-bg;
}
&.alert-danger {
width: auto;
background-color: $alert-danger-bg;
}
}
a.card {
color: inherit;
.card-title { color: $site-color-primary; }
.card-subtitle {
font-size: bootstrap.$font-size-sm;
}
&:hover {
$border-height: 0.25rem;
border-bottom: $border-height solid $site-color-primary;
text-decoration: none;
.card-body {
padding-bottom: bootstrap.$card-spacer-x - $border-height;
}
}
}
.card-title {
font-family: $site-font-family-alt;
font-size: bootstrap.$font-size-lg;
margin-bottom: bs-spacer(2);
}
.breadcrumb {
align-items: center;
@at-root {
.breadcrumb-item {
align-items: center;
display: flex;
+ .breadcrumb-item {
// padding-left: 0; // Fix BS 4.1 padding issue: push left padding into ::before for balance
&::before { font: $site-font-icon; }
}
&.active a {
color: bootstrap.$breadcrumb-active-color;
cursor: default;
&:hover { text-decoration: none; }
}
}
}
}
// The nav bar for viewing code samples on GitHub / DartPad
.navbar-code {
flex-direction: row;
}
// The nav bar for viewing code samples on GitHub / DartPad
.btn-navbar-code {
font-size: bootstrap.$font-size-sm;
color: $site-color-primary;
background-color: $site-color-white;
font-weight: bold;
margin-left: bs-spacer(1);
}
.btn {
font-family: $site-font-family-alt;
font-weight: 500;
padding: bs-spacer(2);
white-space: normal;
}
.btn-link {
&:hover, &:focus {
text-decoration: none;
}
}
.nav-tabs {
font-family: $site-font-family-alt;
margin-bottom: 0.75rem;
.nav-item {
&:not(:last-child) {
margin-right: bs-spacer(8);
}
a {
color: $site-color-nav-links;
padding: bs-spacer(4) 0;
}
}
.nav-link {
&, &:hover {
border: none;
border-bottom: 2px solid transparent;
}
&.active, &:active {
border-color: $site-color-primary;
}
}
}
@mixin reset-carousel-animation {
.carousel-item-next,
.carousel-item-prev {
display: none;
}
.carousel-item-left,
.carousel-item-right {
transform: none;
}
}
| website/src/_sass/vendor/_bootstrap.scss/0 | {
"file_path": "website/src/_sass/vendor/_bootstrap.scss",
"repo_id": "website",
"token_count": 2305
} | 1,473 |
---
---
@forward 'site';
| website/src/assets/css/main.scss/0 | {
"file_path": "website/src/assets/css/main.scss",
"repo_id": "website",
"token_count": 11
} | 1,474 |
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 27.7.0, 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="48px" height="48px" viewBox="0 0 48 48" style="enable-background:new 0 0 48 48;" xml:space="preserve">
<style type="text/css">
.st0{fill:#027DFD;}
</style>
<path class="st0" d="M16,24.1c0,2.2,0.8,4.1,2.4,5.6s3.5,2.4,5.6,2.4s4.1-0.8,5.6-2.4s2.4-3.4,2.4-5.6s-0.8-4.1-2.4-5.6
s-3.4-2.4-5.6-2.4s-4.1,0.8-5.6,2.4S16,21.9,16,24.1z M24,36.2c0.4,0,0.9,0,1.2-0.1c0.4,0,0.8-0.1,1.2-0.2L21.8,44
c-5-0.6-9.2-2.7-12.6-6.5S4,29.3,4,24.1c0-1.4,0.1-2.8,0.4-4.1s0.7-2.6,1.2-3.8l8,13.9c1,1.8,2.5,3.3,4.3,4.4
C19.7,35.6,21.8,36.2,24,36.2z M24,12.1c-2.7,0-5,0.8-7.1,2.3s-3.5,3.5-4.3,5.9l-4.7-8.1c1.8-2.5,4.1-4.4,6.9-5.9s5.8-2.2,9.2-2.2
c3.3,0,6.3,0.7,9.1,2.2c2.8,1.5,5.1,3.4,6.9,5.8H24z M42.3,16.1c0.6,1.2,1,2.5,1.3,3.9s0.4,2.7,0.4,4.1c0,5.2-1.7,9.6-5.1,13.4
c-3.4,3.7-7.6,5.9-12.5,6.5l8-13.9c0.5-0.9,0.9-1.8,1.2-2.8c0.3-1,0.4-2.1,0.4-3.2c0-1.6-0.3-3-0.8-4.4c-0.5-1.4-1.3-2.6-2.3-3.6
H42.3z"/>
</svg>
| website/src/assets/images/docs/brand-svg/chromeos.svg/0 | {
"file_path": "website/src/assets/images/docs/brand-svg/chromeos.svg",
"repo_id": "website",
"token_count": 857
} | 1,475 |
document.addEventListener("DOMContentLoaded", function(_) {
adjustToc();
initFixedColumns();
scrollSidebarIntoView();
initVideoModal();
initCarousel();
initSnackbar();
initCookieNotice();
addCopyCodeButtonsEverywhere(); // Must be before tooltip activation.
$('[data-toggle="tooltip"]').tooltip();
setupClipboardJS();
setupTabs($('#os-archive-tabs'), 'dev.flutter.tab-os', _getOSForArchive);
setupTabs($('#editor-setup'), 'io.flutter.tool-id');
setupTabs($('.sample-code-tabs'), 'io.flutter.tool-id');
setupTabs($('#vscode-to-xcode-ios-setup'), 'dev.flutter.debug.vscode-to-xcode-ios');
setupTabs($('#vscode-to-xcode-macos-setup'), 'dev.flutter.debug.vscode-to-xcode-macos');
setupTabs($('#vscode-to-android-studio-setup'), 'dev.flutter.debug.vscode-to-as');
setupTabs($('#vscode-to-vs-setup'), 'dev.flutter.debug.vscode-to-vs');
setupTabs($('#add-to-app-android'), 'dev.flutter.add-to-app.android');
setupTabs($('#add-to-app-android-deps'), 'dev.flutter.add-to-app.android.deps');
setupTabs($('#ios-versions'), 'dev.flutter.ios-versions');
setupTabs($('#android-devices-vp'), 'dev.flutter.install.android-devices-vp');
setupTabs($('#android-studio-start'), 'dev.flutter.install.android-studio-start');
setupTabs($('#flutter-install'), 'dev.flutter.install.options');
setupTabs($('#ios-devices-vp'), 'dev.flutter.install.ios-devices-vp');
setupTabs($('#china-os-tabs'), 'dev.flutter.china-os');
setupTabs($('#china-os-dl-tabs'), 'dev.flutter.china-os-dl');
setupTabs($('#china-os-pub-tabs'), 'dev.flutter.china-os-pub');
setupTabs($('#base-os-tabs'), 'dev.flutter.os');
prettyPrint();
});
function _getOSForArchive() {
const os = getOS();
// The archive doesn't have chromeos, fall back to linux.
if (os === 'chromeos') {
return 'linux';
}
return os;
}
/**
* Get the user's current operating system, or
* `null` if not of one "macos", "windows", "linux", or "chromeos".
*
* @returns {'macos'|'linux'|'windows'|'chromeos'|null}
*/
function getOS() {
const userAgent = window.navigator.userAgent;
if (userAgent.indexOf('Mac') !== -1) {
// macOS or iPhone
return 'macos';
}
if (userAgent.indexOf('Win')) {
// Windows
return 'windows';
}
if ((userAgent.indexOf('Linux') !== -1 || userAgent.indexOf("X11") !== -1)
&& userAgent.indexOf('Android') !== -1) {
// Linux, but not Android
return 'linux';
}
if (userAgent.indexOf('CrOS') !== -1) {
// ChromeOS
return 'chromeos';
}
// Anything else
return null;
}
function scrollSidebarIntoView() {
const fixedSidebar = document.querySelector('.site-sidebar--fixed');
if (!fixedSidebar) {
return;
}
const activeEntries = fixedSidebar.querySelectorAll('a.nav-link.active');
if (activeEntries.length > 0) {
const activeEntry = activeEntries[activeEntries.length - 1];
fixedSidebar.scrollTo({
top: activeEntry.offsetTop - window.innerHeight / 3,
});
}
}
/**
* Adjusts the behavior of the table of contents (TOC) on the page.
*
* This function enables a "scrollspy" feature on the TOC,
* where the active link in the TOC is updated
* based on the currently visible section in the page.
*
* Enables a "back to top" button in the TOC header.
*/
function adjustToc() {
const tocId = '#site-toc--side';
const tocHeader = document.querySelector(tocId + ' header');
if (tocHeader) {
tocHeader.addEventListener('click', (_) => {
_scrollToTop();
});
}
// This will not be migrated for now until we migrate
// the entire site to Bootstrap 5.
// see https://github.com/flutter/website/pull/9167#discussion_r1286457246
$('body').scrollspy({ offset: 100, target: tocId });
function _scrollToTop() {
const distanceBetweenTop = document.documentElement.scrollTop || document.body.scrollTop;
if (distanceBetweenTop > 0) {
window.scrollTo({ top: 0, behavior: 'smooth' });
}
}
}
function initFixedColumns() {
var fixedColumnsSelector = '[data-fixed-column]';
var bannerSelector = '.site-banner';
var footerSelector = 'footer.site-footer';
var headerSelector = '.site-header';
var fixedColumns = $(fixedColumnsSelector);
function adjustFixedColumns() {
// only change values if the fixed col is visible
if ($(fixedColumnsSelector).css('display') == 'none') {
return;
}
var headerHeight = $(headerSelector).outerHeight();
var bannerVisibleHeight = 0;
// First, make sure the banner element even exists on the page.
if ($(bannerSelector).length > 0) {
var bannerHeight = $(bannerSelector).outerHeight();
var bannerOffset = $(bannerSelector).offset().top;
var bannerPosition = bannerOffset - $(window).scrollTop();
bannerVisibleHeight =
Math.max(bannerHeight - (headerHeight - bannerPosition), 0);
}
var topOffset = headerHeight + bannerVisibleHeight;
var footerOffset = $(footerSelector).offset().top;
var footerPosition = footerOffset - $(window).scrollTop();
var footerVisibleHeight = $(window).height() - footerPosition;
var fixedColumnsMaxHeight = $(window).height() - topOffset - footerVisibleHeight;
$(fixedColumnsSelector).css('max-height', fixedColumnsMaxHeight);
$(fixedColumnsSelector).css('top', topOffset);
}
if (fixedColumns.length) {
$(fixedColumnsSelector).css('position', 'fixed');
// listen for scroll and execute once
$(window).scroll(adjustFixedColumns);
$(window).resize(adjustFixedColumns);
adjustFixedColumns();
}
}
function initVideoModal() {
var videoModalObject = $('[data-video-modal]');
if (videoModalObject.length) {
// there is a video modal in the DOM, load the YouTube API
var tag = document.createElement('script');
tag.src = 'https://www.youtube.com/iframe_api';
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
window.onYouTubeIframeAPIReady = function () {
window.videoPlayer = new YT.Player('video-player-iframe');
};
}
videoModalObject.on('shown.bs.modal', function (event) {
if (window.videoPlayer) {
var videoId = event.relatedTarget.dataset.video;
window.videoPlayer.loadVideoById(videoId);
window.videoPlayer.playVideo();
}
});
videoModalObject.on('hide.bs.modal', function (event) {
if (window.videoPlayer) {
window.videoPlayer.stopVideo();
}
});
}
function initCarousel() {
var CAROUSEL_SELECTOR = '.carousel';
var CAROUSEL_ITEM_SELECTOR = '.carousel-item';
var carousel = $(CAROUSEL_SELECTOR);
carousel.on('slide.bs.carousel', function (e) {
carousel.find(CAROUSEL_ITEM_SELECTOR).eq(e.from).addClass('transition-out');
});
carousel.on('slid.bs.carousel', function (e) {
carousel.find(CAROUSEL_ITEM_SELECTOR).eq(e.from).removeClass('transition-out');
});
}
function initSnackbar() {
var SNACKBAR_SELECTOR = '.snackbar';
var SNACKBAR_ACTION_SELECTOR = '.snackbar__action';
var snackbars = $(SNACKBAR_SELECTOR);
snackbars.each(function () {
var snackbar = $(this);
snackbar.find(SNACKBAR_ACTION_SELECTOR).click(function () {
snackbar.fadeOut();
});
})
}
function setupClipboardJS() {
var clipboard = new ClipboardJS('.code-excerpt__copy-btn', {
text: function (trigger) {
var targetId = trigger.getAttribute('data-clipboard-target');
var target = document.querySelector(targetId);
var terminalRegExp = /^(\s*\$\s*)|(C:\\(.*)>\s*)/gm;
var copy = target.textContent.replace(terminalRegExp, '');
return copy;
}
});
clipboard.on('success', _copiedFeedback);
}
function _copiedFeedback(e) {
// e.action === 'copy'
// e.text === copied text
e.clearSelection(); // Unselect copied code
var copied = 'Copied';
var target = e.trigger;
var title = target.getAttribute('title') || target.getAttribute('data-original-title')
var savedTitle;
if (title === copied) return;
savedTitle = title;
setTimeout(function () {
_changeTooltip(target, savedTitle);
}, 1500);
_changeTooltip(target, copied);
}
function _changeTooltip(target, text) {
target.setAttribute('title', text);
$(target).tooltip('dispose'); // Dispose of tip with old title
$(target).tooltip('show'); // Recreate tip with new title ...
if (!$(target).is(":hover")) {
$(target).tooltip('hide'); // ... but hide it if it isn't being hovered over
}
}
function addCopyCodeButtonsEverywhere() {
var elts = $('pre');
elts.wrap(function (i) {
return $(this).parent('div.code-excerpt__code').length === 0
? '<div class="code-excerpt__code"></div>'
: '';
});
elts.wrap(function (i) {
return '<div id="code-excerpt-' + i + '"></div>'
});
elts.parent() // === div#code-excerpt-X
.parent() // === div.code-excerpt__code
.prepend(function (i) {
return '' +
'<button class="code-excerpt__copy-btn" type="button"' +
' data-toggle="tooltip" title="Copy code"' +
' data-clipboard-target="#code-excerpt-' + i + '">' +
' <i class="material-symbols">content_copy</i>' +
'</button>';
});
}
/**
* Activate the cookie notice footer
* @returns null
*/
function initCookieNotice() {
const notice = document.getElementById('cookie-notice');
const agreeBtn = document.getElementById('cookie-consent');
const cookieKey = 'cookie-consent';
const cookieConsentValue = 'true'
const activeClass = 'show';
if (Cookies.get(cookieKey) === cookieConsentValue) {
return;
}
notice.classList.add(activeClass);
agreeBtn.addEventListener('click', (e) => {
e.preventDefault();
Cookies.set(cookieKey, cookieConsentValue, { sameSite: 'strict', expires: 30 });
notice.classList.remove(activeClass);
});
}
| website/src/assets/js/main.js/0 | {
"file_path": "website/src/assets/js/main.js",
"repo_id": "website",
"token_count": 3585
} | 1,476 |
---
title: Animate a widget using a physics simulation
description: How to implement a physics animation.
diff2html: true
js:
- defer: true
url: https://old-dartpad-3ce3f.web.app/inject_embed.dart.js
---
<?code-excerpt path-base="cookbook/animation/physics_simulation/"?>
Physics simulations can make app interactions feel realistic and interactive.
For example, you might want to animate a widget to act as if it were attached to
a spring or falling with gravity.
This recipe demonstrates how to move a widget from a dragged point back to the
center using a spring simulation.
This recipe uses these steps:
1. Set up an animation controller
2. Move the widget using gestures
3. Animate the widget
4. Calculate the velocity to simulate a springing motion
## Step 1: Set up an animation controller
Start with a stateful widget called `DraggableCard`:
<?code-excerpt "lib/starter.dart"?>
```dart
import 'package:flutter/material.dart';
void main() {
runApp(const MaterialApp(home: PhysicsCardDragDemo()));
}
class PhysicsCardDragDemo extends StatelessWidget {
const PhysicsCardDragDemo({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: const DraggableCard(
child: FlutterLogo(
size: 128,
),
),
);
}
}
class DraggableCard extends StatefulWidget {
const DraggableCard({required this.child, super.key});
final Widget child;
@override
State<DraggableCard> createState() => _DraggableCardState();
}
class _DraggableCardState extends State<DraggableCard> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Align(
child: Card(
child: widget.child,
),
);
}
}
```
Make the `_DraggableCardState` class extend from
[SingleTickerProviderStateMixin][].
Then construct an [AnimationController][] in
`initState` and set `vsync` to `this`.
{{site.alert.note}}
Extending `SingleTickerProviderStateMixin` allows the state object to be a
`TickerProvider` for the `AnimationController`. For more information, see the
documentation for [TickerProvider][].
{{site.alert.end}}
<?code-excerpt "lib/{starter,step1}.dart"?>
```diff
--- lib/starter.dart
+++ lib/step1.dart
@@ -29,14 +29,20 @@
State<DraggableCard> createState() => _DraggableCardState();
}
-class _DraggableCardState extends State<DraggableCard> {
+class _DraggableCardState extends State<DraggableCard>
+ with SingleTickerProviderStateMixin {
+ late AnimationController _controller;
+
@override
void initState() {
super.initState();
+ _controller =
+ AnimationController(vsync: this, duration: const Duration(seconds: 1));
}
@override
void dispose() {
+ _controller.dispose();
super.dispose();
}
```
## Step 2: Move the widget using gestures
Make the widget move when it's dragged, and add an [Alignment][] field to the
`_DraggableCardState` class:
<?code-excerpt "lib/{step1,step2}.dart (alignment)"?>
```diff
--- lib/step1.dart (alignment)
+++ lib/step2.dart (alignment)
@@ -1,3 +1,4 @@
class _DraggableCardState extends State<DraggableCard>
with SingleTickerProviderStateMixin {
late AnimationController _controller;
+ Alignment _dragAlignment = Alignment.center;
```
Add a [GestureDetector][] that handles the `onPanDown`, `onPanUpdate`, and
`onPanEnd` callbacks. To adjust the alignment, use a [MediaQuery][] to get the
size of the widget, and divide by 2. (This converts units of "pixels dragged" to
coordinates that [Align][] uses.) Then, set the `Align` widget's `alignment` to
`_dragAlignment`:
<?code-excerpt "lib/{step1,step2}.dart (build)"?>
```diff
--- lib/step1.dart (build)
+++ lib/step2.dart (build)
@@ -1,8 +1,22 @@
@override
Widget build(BuildContext context) {
- return Align(
- child: Card(
- child: widget.child,
+ var size = MediaQuery.of(context).size;
+ return GestureDetector(
+ onPanDown: (details) {},
+ onPanUpdate: (details) {
+ setState(() {
+ _dragAlignment += Alignment(
+ details.delta.dx / (size.width / 2),
+ details.delta.dy / (size.height / 2),
+ );
+ });
+ },
+ onPanEnd: (details) {},
+ child: Align(
+ alignment: _dragAlignment,
+ child: Card(
+ child: widget.child,
+ ),
),
);
}
```
## Step 3: Animate the widget
When the widget is released, it should spring back to the center.
Add an `Animation<Alignment>` field and an `_runAnimation` method. This
method defines a `Tween` that interpolates between the point the widget was
dragged to, to the point in the center.
<?code-excerpt "lib/{step2,step3}.dart (animation)"?>
```diff
--- lib/step2.dart (animation)
+++ lib/step3.dart (animation)
@@ -1,4 +1,5 @@
class _DraggableCardState extends State<DraggableCard>
with SingleTickerProviderStateMixin {
late AnimationController _controller;
+ late Animation<Alignment> _animation;
Alignment _dragAlignment = Alignment.center;
```
<?code-excerpt "lib/step3.dart (runAnimation)"?>
```dart
void _runAnimation() {
_animation = _controller.drive(
AlignmentTween(
begin: _dragAlignment,
end: Alignment.center,
),
);
_controller.reset();
_controller.forward();
}
```
Next, update `_dragAlignment` when the `AnimationController` produces a
value:
<?code-excerpt "lib/{step2,step3}.dart (initState)"?>
```diff
--- lib/step2.dart (initState)
+++ lib/step3.dart (initState)
@@ -3,4 +3,9 @@
super.initState();
_controller =
AnimationController(vsync: this, duration: const Duration(seconds: 1));
+ _controller.addListener(() {
+ setState(() {
+ _dragAlignment = _animation.value;
+ });
+ });
}
```
Next, make the `Align` widget use the `_dragAlignment` field:
<?code-excerpt "lib/step3.dart (align)"?>
```dart
child: Align(
alignment: _dragAlignment,
child: Card(
child: widget.child,
),
),
```
Finally, update the `GestureDetector` to manage the animation controller:
<?code-excerpt "lib/{step2,step3}.dart (gesture)"?>
```diff
--- lib/step2.dart (gesture)
+++ lib/step3.dart (gesture)
@@ -1,5 +1,7 @@
return GestureDetector(
- onPanDown: (details) {},
+ onPanDown: (details) {
+ _controller.stop();
+ },
onPanUpdate: (details) {
setState(() {
_dragAlignment += Alignment(
@@ -8,7 +10,9 @@
);
});
},
- onPanEnd: (details) {},
+ onPanEnd: (details) {
+ _runAnimation();
+ },
child: Align(
alignment: _dragAlignment,
child: Card(
```
## Step 4: Calculate the velocity to simulate a springing motion
The last step is to do a little math, to calculate the velocity of the widget
after it's finished being dragged. This is so that the widget realistically
continues at that speed before being snapped back. (The `_runAnimation` method
already sets the direction by setting the animation's start and end alignment.)
First, import the `physics` package:
<?code-excerpt "lib/main.dart (import)"?>
```dart
import 'package:flutter/physics.dart';
```
The `onPanEnd` callback provides a [DragEndDetails][] object. This object
provides the velocity of the pointer when it stopped contacting the screen. The
velocity is in pixels per second, but the `Align` widget doesn't use pixels. It
uses coordinate values between [-1.0, -1.0] and [1.0, 1.0], where [0.0, 0.0]
represents the center. The `size` calculated in step 2 is used to convert pixels
to coordinate values in this range.
Finally, `AnimationController` has an `animateWith()` method that can be given a
[SpringSimulation][]:
<?code-excerpt "lib/main.dart (runAnimation)"?>
```dart
/// Calculates and runs a [SpringSimulation].
void _runAnimation(Offset pixelsPerSecond, Size size) {
_animation = _controller.drive(
AlignmentTween(
begin: _dragAlignment,
end: Alignment.center,
),
);
// Calculate the velocity relative to the unit interval, [0,1],
// used by the animation controller.
final unitsPerSecondX = pixelsPerSecond.dx / size.width;
final unitsPerSecondY = pixelsPerSecond.dy / size.height;
final unitsPerSecond = Offset(unitsPerSecondX, unitsPerSecondY);
final unitVelocity = unitsPerSecond.distance;
const spring = SpringDescription(
mass: 30,
stiffness: 1,
damping: 1,
);
final simulation = SpringSimulation(spring, 0, 1, -unitVelocity);
_controller.animateWith(simulation);
}
```
Don't forget to call `_runAnimation()` with the velocity and size:
<?code-excerpt "lib/main.dart (onPanEnd)"?>
```dart
onPanEnd: (details) {
_runAnimation(details.velocity.pixelsPerSecond, size);
},
```
{{site.alert.note}}
Now that the animation controller uses a simulation it's `duration` argument
is no longer required.
{{site.alert.end}}
## Interactive Example
<?code-excerpt "lib/main.dart"?>
```run-dartpad:theme-light:mode-flutter:run-true:width-100%:height-600px:split-60:ga_id-interactive_example
import 'package:flutter/material.dart';
import 'package:flutter/physics.dart';
void main() {
runApp(const MaterialApp(home: PhysicsCardDragDemo()));
}
class PhysicsCardDragDemo extends StatelessWidget {
const PhysicsCardDragDemo({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: const DraggableCard(
child: FlutterLogo(
size: 128,
),
),
);
}
}
/// A draggable card that moves back to [Alignment.center] when it's
/// released.
class DraggableCard extends StatefulWidget {
const DraggableCard({required this.child, super.key});
final Widget child;
@override
State<DraggableCard> createState() => _DraggableCardState();
}
class _DraggableCardState extends State<DraggableCard>
with SingleTickerProviderStateMixin {
late AnimationController _controller;
/// The alignment of the card as it is dragged or being animated.
///
/// While the card is being dragged, this value is set to the values computed
/// in the GestureDetector onPanUpdate callback. If the animation is running,
/// this value is set to the value of the [_animation].
Alignment _dragAlignment = Alignment.center;
late Animation<Alignment> _animation;
/// Calculates and runs a [SpringSimulation].
void _runAnimation(Offset pixelsPerSecond, Size size) {
_animation = _controller.drive(
AlignmentTween(
begin: _dragAlignment,
end: Alignment.center,
),
);
// Calculate the velocity relative to the unit interval, [0,1],
// used by the animation controller.
final unitsPerSecondX = pixelsPerSecond.dx / size.width;
final unitsPerSecondY = pixelsPerSecond.dy / size.height;
final unitsPerSecond = Offset(unitsPerSecondX, unitsPerSecondY);
final unitVelocity = unitsPerSecond.distance;
const spring = SpringDescription(
mass: 30,
stiffness: 1,
damping: 1,
);
final simulation = SpringSimulation(spring, 0, 1, -unitVelocity);
_controller.animateWith(simulation);
}
@override
void initState() {
super.initState();
_controller = AnimationController(vsync: this);
_controller.addListener(() {
setState(() {
_dragAlignment = _animation.value;
});
});
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final size = MediaQuery.of(context).size;
return GestureDetector(
onPanDown: (details) {
_controller.stop();
},
onPanUpdate: (details) {
setState(() {
_dragAlignment += Alignment(
details.delta.dx / (size.width / 2),
details.delta.dy / (size.height / 2),
);
});
},
onPanEnd: (details) {
_runAnimation(details.velocity.pixelsPerSecond, size);
},
child: Align(
alignment: _dragAlignment,
child: Card(
child: widget.child,
),
),
);
}
}
```
<noscript>
<img src="/assets/images/docs/cookbook/animation-physics-card-drag.gif" alt="Demo showing a widget being dragged and snapped back to the center" class="site-mobile-screenshot" />
</noscript>
[Align]: {{site.api}}/flutter/widgets/Align-class.html
[Alignment]: {{site.api}}/flutter/painting/Alignment-class.html
[AnimationController]: {{site.api}}/flutter/animation/AnimationController-class.html
[GestureDetector]: {{site.api}}/flutter/widgets/GestureDetector-class.html
[SingleTickerProviderStateMixin]: {{site.api}}/flutter/widgets/SingleTickerProviderStateMixin-mixin.html
[TickerProvider]: {{site.api}}/flutter/scheduler/TickerProvider-class.html
[MediaQuery]: {{site.api}}/flutter/widgets/MediaQuery-class.html
[DragEndDetails]: {{site.api}}/flutter/gestures/DragEndDetails-class.html
[SpringSimulation]: {{site.api}}/flutter/physics/SpringSimulation-class.html
| website/src/cookbook/animation/physics-simulation.md/0 | {
"file_path": "website/src/cookbook/animation/physics-simulation.md",
"repo_id": "website",
"token_count": 4653
} | 1,477 |
---
title: Create a photo filter carousel
description: How to implement a photo filter carousel in Flutter.
js:
- defer: true
url: https://old-dartpad-3ce3f.web.app/inject_embed.dart.js
---
<?code-excerpt path-base="cookbook/effects/photo_filter_carousel"?>
Everybody knows that a photo looks better with a filter.
In this recipe, you build a scrollable,
filter selection carousel.
The following animation shows the app's behavior:
![Photo Filter Carousel](/assets/images/docs/cookbook/effects/PhotoFilterCarousel.gif){:.site-mobile-screenshot}
This recipe begins with the photo and filters
already in place. Filters are applied with the
`color` and `colorBlendMode` properties of the
[`Image`][] widget.
## Add a selector ring and dark gradient
The selected filter circle is displayed within a
selector ring. Additionally, a dark gradient is
behind the available filters, which helps the contrast
between the filters and any photo that you choose.
Create a new stateful widget called
`FilterSelector` that you'll use to
implement the selector.
<?code-excerpt "lib/excerpt1.dart (FilterSelector)"?>
```dart
@immutable
class FilterSelector extends StatefulWidget {
const FilterSelector({
super.key,
});
@override
State<FilterSelector> createState() => _FilterSelectorState();
}
class _FilterSelectorState extends State<FilterSelector> {
@override
Widget build(BuildContext context) {
return const SizedBox();
}
}
```
Add the `FilterSelector` widget to the existing
widget tree. Position the `FilterSelector` widget
on top of the photo, at the bottom and centered.
<?code-excerpt "lib/excerpt1.dart (Stack)" replace="/^child: //g"?>
```dart
Stack(
children: [
Positioned.fill(
child: _buildPhotoWithFilter(),
),
const Positioned(
left: 0.0,
right: 0.0,
bottom: 0.0,
child: FilterSelector(),
),
],
),
```
Within the `FilterSelector` widget,
display a selector ring on top of a
dark gradient by using a `Stack` widget.
<?code-excerpt "lib/excerpt2.dart (FilterSelectorState2)"?>
```dart
class _FilterSelectorState extends State<FilterSelector> {
static const _filtersPerScreen = 5;
static const _viewportFractionPerItem = 1.0 / _filtersPerScreen;
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, constraints) {
final itemSize = constraints.maxWidth * _viewportFractionPerItem;
return Stack(
alignment: Alignment.bottomCenter,
children: [
_buildShadowGradient(itemSize),
_buildSelectionRing(itemSize),
],
);
},
);
}
Widget _buildShadowGradient(double itemSize) {
return SizedBox(
height: itemSize * 2 + widget.padding.vertical,
child: const DecoratedBox(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.transparent,
Colors.black,
],
),
),
child: SizedBox.expand(),
),
);
}
Widget _buildSelectionRing(double itemSize) {
return IgnorePointer(
child: Padding(
padding: widget.padding,
child: SizedBox(
width: itemSize,
height: itemSize,
child: const DecoratedBox(
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.fromBorderSide(
BorderSide(width: 6, color: Colors.white),
),
),
),
),
),
);
}
}
```
The size of the selector circle and the background gradient
depends on the size of an individual filter in the carousel
called `itemSize`. The `itemSize` depends on the available width.
Therefore, a `LayoutBuilder` widget is used to determine the
available space, and then you calculate the size of an
individual filter's `itemSize`.
The selector ring includes an `IgnorePointer` widget
because when carousel interactivity is added,
the selector ring shouldn't interfere with
tap and drag events.
## Create a filter carousel item
Each filter item in the carousel displays a
circular image with a color applied to the image
that corresponds to the associated filter color.
Define a new stateless widget called `FilterItem`
that displays a single list item.
<?code-excerpt "lib/original_example.dart (FilterItem)"?>
```dart
@immutable
class FilterItem extends StatelessWidget {
const FilterItem({
super.key,
required this.color,
this.onFilterSelected,
});
final Color color;
final VoidCallback? onFilterSelected;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onFilterSelected,
child: AspectRatio(
aspectRatio: 1.0,
child: Padding(
padding: const EdgeInsets.all(8),
child: ClipOval(
child: Image.network(
'https://docs.flutter.dev/cookbook/img-files'
'/effects/instagram-buttons/millennial-texture.jpg',
color: color.withOpacity(0.5),
colorBlendMode: BlendMode.hardLight,
),
),
),
),
);
}
}
```
## Implement the filter carousel
Filter items scroll to the left and right as the user drags. Scrolling requires
some kind of `Scrollable` widget.
You might consider using a horizontal `ListView` widget,
but a `ListView` widget positions the first element at the
beginning of the available space, not at
the center, where your selector ring sits.
A `PageView` widget is better suited for a carousel.
A `PageView` widget lays out its children from the
center of the available space and provides snapping physics.
Snapping physics is what causes an item to snap to the center,
no matter where the user releases a drag.
{{site.alert.note}}
In cases where you need to customize the
position of child widgets within a scrollable area,
consider using a [`Scrollable`][] widget with a
[`viewportBuilder`][], and place a
[`Flow`][] widget inside the `viewportBuilder`.
The `Flow` widget has a [delegate property][]
that allows you to position child widgets wherever
you want, based on the current `viewportOffset`.
{{site.alert.end}}
Configure your widget tree to make space for the `PageView`.
<?code-excerpt "lib/excerpt3.dart (PageView)"?>
```dart
@override
Widget build(BuildContext context) {
return LayoutBuilder(builder: (context, constraints) {
final itemSize = constraints.maxWidth * _viewportFractionPerItem;
return Stack(
alignment: Alignment.bottomCenter,
children: [
_buildShadowGradient(itemSize),
_buildCarousel(itemSize),
_buildSelectionRing(itemSize),
],
);
});
}
Widget _buildCarousel(double itemSize) {
return Container(
height: itemSize,
margin: widget.padding,
child: PageView.builder(
itemCount: widget.filters.length,
itemBuilder: (context, index) {
return const SizedBox();
},
),
);
}
```
Build each `FilterItem` widget within the
`PageView` widget based on the given `index`.
<?code-excerpt "lib/excerpt4.dart (BuildFilterItem)"?>
```dart
Color itemColor(int index) => widget.filters[index % widget.filters.length];
Widget _buildCarousel(double itemSize) {
return Container(
height: itemSize,
margin: widget.padding,
child: PageView.builder(
itemCount: widget.filters.length,
itemBuilder: (context, index) {
return Center(
child: FilterItem(
color: itemColor(index),
onFilterSelected: () {},
),
);
},
),
);
}
```
The `PageView` widget displays all of the `FilterItem`
widgets, and you can drag to the left and right.
However, right now each `FilterItem` widget takes
up the entire width of the screen,
and each `FilterItem` widget is displayed
at the same size and opacity. There should be
five `FilterItem` widgets on the screen,
and the `FilterItem` widgets need to shrink and
fade as they move farther from the center of the screen.
The solution to both of these issues is to introduce
a `PageViewController`. The `PageViewController`'s
`viewportFraction` property is used to display
multiple `FilterItem` widgets on the screen at
the same time. Rebuilding each `FilterItem` widget
as the `PageViewController` changes allows you to
change each `FilterItem` widget's size and opacity
as the user scrolls.
Create a `PageViewController` and connect it to the
`PageView` widget.
<?code-excerpt "lib/excerpt5.dart (PageViewController)" replace="/\/\/code-excerpt-close-bracket/\n}/g;"?>
```dart
class _FilterSelectorState extends State<FilterSelector> {
static const _filtersPerScreen = 5;
static const _viewportFractionPerItem = 1.0 / _filtersPerScreen;
late final PageController _controller;
Color itemColor(int index) => widget.filters[index % widget.filters.length];
@override
void initState() {
super.initState();
_controller = PageController(
viewportFraction: _viewportFractionPerItem,
);
_controller.addListener(_onPageChanged);
}
void _onPageChanged() {
final page = (_controller.page ?? 0).round();
widget.onFilterChanged(widget.filters[page]);
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
Widget _buildCarousel(double itemSize) {
return Container(
height: itemSize,
margin: widget.padding,
child: PageView.builder(
controller: _controller,
itemCount: widget.filters.length,
itemBuilder: (context, index) {
return Center(
child: FilterItem(
color: itemColor(index),
onFilterSelected: () {},
),
);
},
),
);
}
}
```
With the `PageViewController` added, five `FilterItem`
widgets are visible on the screen at the same time,
and the photo filter changes as you scroll, but
the `FilterItem` widgets are still the same size.
Wrap each `FilterItem` widget with an `AnimatedBuilder`
to change the visual properties of each `FilterItem`
widget as the scroll position changes.
<?code-excerpt "lib/excerpt6.dart (BuildCarousel)"?>
```dart
Widget _buildCarousel(double itemSize) {
return Container(
height: itemSize,
margin: widget.padding,
child: PageView.builder(
controller: _controller,
itemCount: widget.filters.length,
itemBuilder: (context, index) {
return Center(
child: AnimatedBuilder(
animation: _controller,
builder: (context, child) {
return FilterItem(
color: itemColor(index),
onFilterSelected: () => {},
);
},
),
);
},
),
);
}
```
The `AnimatedBuilder` widget rebuilds every time the
`_controller` changes its scroll position.
These rebuilds allow you to change the `FilterItem`
size and opacity as the user drags.
Calculate an appropriate scale and opacity for each
`FilterItem` widget within the `AnimatedBuilder` and
apply those values.
<?code-excerpt "lib/original_example.dart (FinalBuildCarousel)"?>
```dart
Widget _buildCarousel(double itemSize) {
return Container(
height: itemSize,
margin: widget.padding,
child: PageView.builder(
controller: _controller,
itemCount: widget.filters.length,
itemBuilder: (context, index) {
return Center(
child: AnimatedBuilder(
animation: _controller,
builder: (context, child) {
if (!_controller.hasClients ||
!_controller.position.hasContentDimensions) {
// The PageViewController isn't connected to the
// PageView widget yet. Return an empty box.
return const SizedBox();
}
// The integer index of the current page,
// 0, 1, 2, 3, and so on
final selectedIndex = _controller.page!.roundToDouble();
// The fractional amount that the current filter
// is dragged to the left or right, for example, 0.25 when
// the current filter is dragged 25% to the left.
final pageScrollAmount = _controller.page! - selectedIndex;
// The page-distance of a filter just before it
// moves off-screen.
const maxScrollDistance = _filtersPerScreen / 2;
// The page-distance of this filter item from the
// currently selected filter item.
final pageDistanceFromSelected =
(selectedIndex - index + pageScrollAmount).abs();
// The distance of this filter item from the
// center of the carousel as a percentage, that is, where the selector
// ring sits.
final percentFromCenter =
1.0 - pageDistanceFromSelected / maxScrollDistance;
final itemScale = 0.5 + (percentFromCenter * 0.5);
final opacity = 0.25 + (percentFromCenter * 0.75);
return Transform.scale(
scale: itemScale,
child: Opacity(
opacity: opacity,
child: FilterItem(
color: itemColor(index),
onFilterSelected: () => () {},
),
),
);
},
),
);
},
),
);
}
```
Each `FilterItem` widget now shrinks and fades
away as it moves farther from the center of the screen.
Add a method to change the selected filter when a
`FilterItem` widget is tapped.
<?code-excerpt "lib/original_example.dart (FilterTapped)"?>
```dart
void _onFilterTapped(int index) {
_controller.animateToPage(
index,
duration: const Duration(milliseconds: 450),
curve: Curves.ease,
);
}
```
Configure each `FilterItem` widget to invoke
`_onFilterTapped` when tapped.
<?code-excerpt "lib/original_example.dart (OnFilterTapped)" replace="/child: //g;/\(\) {}/_onFilterTapped/g;"?>
```dart
FilterItem(
color: itemColor(index),
onFilterSelected: () => _onFilterTapped,
),
```
Congratulations!
You now have a draggable, tappable photo filter carousel.
## Interactive example
<?code-excerpt "lib/main.dart"?>
```run-dartpad:theme-light:mode-flutter:run-true:width-100%:height-600px:split-60:ga_id-interactive_example
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart' show ViewportOffset;
void main() {
runApp(
const MaterialApp(
home: ExampleInstagramFilterSelection(),
debugShowCheckedModeBanner: false,
),
);
}
@immutable
class ExampleInstagramFilterSelection extends StatefulWidget {
const ExampleInstagramFilterSelection({super.key});
@override
State<ExampleInstagramFilterSelection> createState() =>
_ExampleInstagramFilterSelectionState();
}
class _ExampleInstagramFilterSelectionState
extends State<ExampleInstagramFilterSelection> {
final _filters = [
Colors.white,
...List.generate(
Colors.primaries.length,
(index) => Colors.primaries[(index * 4) % Colors.primaries.length],
)
];
final _filterColor = ValueNotifier<Color>(Colors.white);
void _onFilterChanged(Color value) {
_filterColor.value = value;
}
@override
Widget build(BuildContext context) {
return Material(
color: Colors.black,
child: Stack(
children: [
Positioned.fill(
child: _buildPhotoWithFilter(),
),
Positioned(
left: 0.0,
right: 0.0,
bottom: 0.0,
child: _buildFilterSelector(),
),
],
),
);
}
Widget _buildPhotoWithFilter() {
return ValueListenableBuilder(
valueListenable: _filterColor,
builder: (context, color, child) {
return Image.network(
'https://docs.flutter.dev/cookbook/img-files'
'/effects/instagram-buttons/millennial-dude.jpg',
color: color.withOpacity(0.5),
colorBlendMode: BlendMode.color,
fit: BoxFit.cover,
);
},
);
}
Widget _buildFilterSelector() {
return FilterSelector(
onFilterChanged: _onFilterChanged,
filters: _filters,
);
}
}
@immutable
class FilterSelector extends StatefulWidget {
const FilterSelector({
super.key,
required this.filters,
required this.onFilterChanged,
this.padding = const EdgeInsets.symmetric(vertical: 24),
});
final List<Color> filters;
final void Function(Color selectedColor) onFilterChanged;
final EdgeInsets padding;
@override
State<FilterSelector> createState() => _FilterSelectorState();
}
class _FilterSelectorState extends State<FilterSelector> {
static const _filtersPerScreen = 5;
static const _viewportFractionPerItem = 1.0 / _filtersPerScreen;
late final PageController _controller;
late int _page;
int get filterCount => widget.filters.length;
Color itemColor(int index) => widget.filters[index % filterCount];
@override
void initState() {
super.initState();
_page = 0;
_controller = PageController(
initialPage: _page,
viewportFraction: _viewportFractionPerItem,
);
_controller.addListener(_onPageChanged);
}
void _onPageChanged() {
final page = (_controller.page ?? 0).round();
if (page != _page) {
_page = page;
widget.onFilterChanged(widget.filters[page]);
}
}
void _onFilterTapped(int index) {
_controller.animateToPage(
index,
duration: const Duration(milliseconds: 450),
curve: Curves.ease,
);
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scrollable(
controller: _controller,
axisDirection: AxisDirection.right,
physics: const PageScrollPhysics(),
viewportBuilder: (context, viewportOffset) {
return LayoutBuilder(
builder: (context, constraints) {
final itemSize = constraints.maxWidth * _viewportFractionPerItem;
viewportOffset
..applyViewportDimension(constraints.maxWidth)
..applyContentDimensions(0.0, itemSize * (filterCount - 1));
return Stack(
alignment: Alignment.bottomCenter,
children: [
_buildShadowGradient(itemSize),
_buildCarousel(
viewportOffset: viewportOffset,
itemSize: itemSize,
),
_buildSelectionRing(itemSize),
],
);
},
);
},
);
}
Widget _buildShadowGradient(double itemSize) {
return SizedBox(
height: itemSize * 2 + widget.padding.vertical,
child: const DecoratedBox(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.transparent,
Colors.black,
],
),
),
child: SizedBox.expand(),
),
);
}
Widget _buildCarousel({
required ViewportOffset viewportOffset,
required double itemSize,
}) {
return Container(
height: itemSize,
margin: widget.padding,
child: Flow(
delegate: CarouselFlowDelegate(
viewportOffset: viewportOffset,
filtersPerScreen: _filtersPerScreen,
),
children: [
for (int i = 0; i < filterCount; i++)
FilterItem(
onFilterSelected: () => _onFilterTapped(i),
color: itemColor(i),
),
],
),
);
}
Widget _buildSelectionRing(double itemSize) {
return IgnorePointer(
child: Padding(
padding: widget.padding,
child: SizedBox(
width: itemSize,
height: itemSize,
child: const DecoratedBox(
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.fromBorderSide(
BorderSide(width: 6, color: Colors.white),
),
),
),
),
),
);
}
}
class CarouselFlowDelegate extends FlowDelegate {
CarouselFlowDelegate({
required this.viewportOffset,
required this.filtersPerScreen,
}) : super(repaint: viewportOffset);
final ViewportOffset viewportOffset;
final int filtersPerScreen;
@override
void paintChildren(FlowPaintingContext context) {
final count = context.childCount;
// All available painting width
final size = context.size.width;
// The distance that a single item "page" takes up from the perspective
// of the scroll paging system. We also use this size for the width and
// height of a single item.
final itemExtent = size / filtersPerScreen;
// The current scroll position expressed as an item fraction, e.g., 0.0,
// or 1.0, or 1.3, or 2.9, etc. A value of 1.3 indicates that item at
// index 1 is active, and the user has scrolled 30% towards the item at
// index 2.
final active = viewportOffset.pixels / itemExtent;
// Index of the first item we need to paint at this moment.
// At most, we paint 3 items to the left of the active item.
final min = math.max(0, active.floor() - 3).toInt();
// Index of the last item we need to paint at this moment.
// At most, we paint 3 items to the right of the active item.
final max = math.min(count - 1, active.ceil() + 3).toInt();
// Generate transforms for the visible items and sort by distance.
for (var index = min; index <= max; index++) {
final itemXFromCenter = itemExtent * index - viewportOffset.pixels;
final percentFromCenter = 1.0 - (itemXFromCenter / (size / 2)).abs();
final itemScale = 0.5 + (percentFromCenter * 0.5);
final opacity = 0.25 + (percentFromCenter * 0.75);
final itemTransform = Matrix4.identity()
..translate((size - itemExtent) / 2)
..translate(itemXFromCenter)
..translate(itemExtent / 2, itemExtent / 2)
..multiply(Matrix4.diagonal3Values(itemScale, itemScale, 1.0))
..translate(-itemExtent / 2, -itemExtent / 2);
context.paintChild(
index,
transform: itemTransform,
opacity: opacity,
);
}
}
@override
bool shouldRepaint(covariant CarouselFlowDelegate oldDelegate) {
return oldDelegate.viewportOffset != viewportOffset;
}
}
@immutable
class FilterItem extends StatelessWidget {
const FilterItem({
super.key,
required this.color,
this.onFilterSelected,
});
final Color color;
final VoidCallback? onFilterSelected;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onFilterSelected,
child: AspectRatio(
aspectRatio: 1.0,
child: Padding(
padding: const EdgeInsets.all(8),
child: ClipOval(
child: Image.network(
'https://docs.flutter.dev/cookbook/img-files'
'/effects/instagram-buttons/millennial-texture.jpg',
color: color.withOpacity(0.5),
colorBlendMode: BlendMode.hardLight,
),
),
),
),
);
}
}
```
[`Image`]: {{site.api}}/flutter/widgets/Image-class.html
[`Scrollable`]: {{site.api}}/flutter/widgets/Scrollable-class.html
[`viewportBuilder`]: {{site.api}}/flutter/widgets/Scrollable/viewportBuilder.html
[`Flow`]: {{site.api}}/flutter/widgets/Flow-class.html
[delegate property]: {{site.api}}/flutter/widgets/Flow/delegate.html
| website/src/cookbook/effects/photo-filter-carousel.md/0 | {
"file_path": "website/src/cookbook/effects/photo-filter-carousel.md",
"repo_id": "website",
"token_count": 9355
} | 1,478 |
---
title: Add Material touch ripples
description: How to implement ripple animations.
js:
- defer: true
url: https://old-dartpad-3ce3f.web.app/inject_embed.dart.js
---
<?code-excerpt path-base="cookbook/gestures/ripples/"?>
Widgets that follow the Material Design guidelines display
a ripple animation when tapped.
Flutter provides the [`InkWell`][]
widget to perform this effect.
Create a ripple effect using the following steps:
1. Create a widget that supports tap.
2. Wrap it in an `InkWell` widget to manage tap callbacks and
ripple animations.
<?code-excerpt "lib/main.dart (InkWell)" replace="/return //g;/;$//g"?>
```dart
// The InkWell wraps the custom flat button widget.
InkWell(
// When the user taps the button, show a snackbar.
onTap: () {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text('Tap'),
));
},
child: const Padding(
padding: EdgeInsets.all(12),
child: Text('Flat Button'),
),
)
```
## Interactive example
<?code-excerpt "lib/main.dart"?>
```run-dartpad:theme-light:mode-flutter:run-true:width-100%:height-600px:split-60:ga_id-interactive_example
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 = 'InkWell Demo';
return const MaterialApp(
title: title,
home: MyHomePage(title: title),
);
}
}
class MyHomePage extends StatelessWidget {
final String title;
const MyHomePage({super.key, required this.title});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(title),
),
body: const Center(
child: MyButton(),
),
);
}
}
class MyButton extends StatelessWidget {
const MyButton({super.key});
@override
Widget build(BuildContext context) {
// The InkWell wraps the custom flat button widget.
return InkWell(
// When the user taps the button, show a snackbar.
onTap: () {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text('Tap'),
));
},
child: const Padding(
padding: EdgeInsets.all(12),
child: Text('Flat Button'),
),
);
}
}
```
<noscript>
<img src="/assets/images/docs/cookbook/ripples.gif" alt="Ripples Demo" class="site-mobile-screenshot" />
</noscript>
[`InkWell`]: {{site.api}}/flutter/material/InkWell-class.html
| website/src/cookbook/gestures/ripples.md/0 | {
"file_path": "website/src/cookbook/gestures/ripples.md",
"repo_id": "website",
"token_count": 940
} | 1,479 |
---
title: Maintenance
description: A catalog of recipes covering maintenance of Flutter apps.
---
{% include docs/cookbook-group-index.md %}
| website/src/cookbook/maintenance/index.md/0 | {
"file_path": "website/src/cookbook/maintenance/index.md",
"repo_id": "website",
"token_count": 39
} | 1,480 |
---
title: Update data over the internet
description: How to use the http package to update data over the internet.
---
<?code-excerpt path-base="cookbook/networking/update_data/"?>
Updating data over the internet is necessary for most apps.
The `http` package has got that covered!
This recipe uses the following steps:
1. Add the `http` package.
2. Update data over the internet using the `http` package.
3. Convert the response into a custom Dart object.
4. Get the data from the internet.
5. Update the existing `title` from user input.
6. Update and display the response on screen.
## 1. Add the `http` package
To add the `http` package as a dependency,
run `flutter pub add`:
```terminal
$ flutter pub add http
```
Import the `http` package.
<?code-excerpt "lib/main.dart (Http)"?>
```dart
import 'package:http/http.dart' as http;
```
## 2. Updating data over the internet using the `http` package
This recipe covers how to update an album title to the
[JSONPlaceholder][] using the [`http.put()`][] method.
<?code-excerpt "lib/main_step2.dart (updateAlbum)"?>
```dart
Future<http.Response> updateAlbum(String title) {
return http.put(
Uri.parse('https://jsonplaceholder.typicode.com/albums/1'),
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
},
body: jsonEncode(<String, String>{
'title': title,
}),
);
}
```
The `http.put()` method returns a `Future` that contains a `Response`.
* [`Future`][] is a core Dart class for working with
async operations. A `Future` object represents a potential
value or error that will be available at some time in the future.
* The `http.Response` class contains the data received from a successful
http call.
* The `updateAlbum()` method takes an argument, `title`,
which is sent to the server to update the `Album`.
## 3. Convert the `http.Response` to a custom Dart object
While it's easy to make a network request,
working with a raw `Future<http.Response>`
isn't very convenient. To make your life easier,
convert the `http.Response` into a Dart object.
### Create an Album class
First, create an `Album` class that contains the data from the
network request. It includes a factory constructor that
creates an `Album` from JSON.
Converting JSON with [pattern matching][] is only one option.
For more information, see the full article on
[JSON and serialization][].
<?code-excerpt "lib/main.dart (Album)"?>
```dart
class Album {
final int id;
final String title;
const Album({required this.id, required this.title});
factory Album.fromJson(Map<String, dynamic> json) {
return switch (json) {
{
'id': int id,
'title': String title,
} =>
Album(
id: id,
title: title,
),
_ => throw const FormatException('Failed to load album.'),
};
}
}
```
### Convert the `http.Response` to an `Album`
Now, use the following steps to update the `updateAlbum()`
function to return a `Future<Album>`:
1. Convert the response body into a JSON `Map` with the
`dart:convert` package.
2. If the server returns an `UPDATED` response with a status
code of 200, then convert the JSON `Map` into an `Album`
using the `fromJson()` factory method.
3. If the server doesn't return an `UPDATED` response with a
status code of 200, then throw an exception.
(Even in the case of a "404 Not Found" server response,
throw an exception. Do not return `null`.
This is important when examining
the data in `snapshot`, as shown below.)
<?code-excerpt "lib/main.dart (updateAlbum)"?>
```dart
Future<Album> updateAlbum(String title) async {
final response = await http.put(
Uri.parse('https://jsonplaceholder.typicode.com/albums/1'),
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
},
body: jsonEncode(<String, String>{
'title': title,
}),
);
if (response.statusCode == 200) {
// If the server did return a 200 OK response,
// then parse the JSON.
return Album.fromJson(jsonDecode(response.body) as Map<String, dynamic>);
} else {
// If the server did not return a 200 OK response,
// then throw an exception.
throw Exception('Failed to update album.');
}
}
```
Hooray!
Now you've got a function that updates the title of an album.
### 4. Get the data from the internet
Get the data from internet before you can update it.
For a complete example, see the [Fetch data][] recipe.
<?code-excerpt "lib/main.dart (fetchAlbum)"?>
```dart
Future<Album> fetchAlbum() async {
final response = await http.get(
Uri.parse('https://jsonplaceholder.typicode.com/albums/1'),
);
if (response.statusCode == 200) {
// If the server did return a 200 OK response,
// then parse the JSON.
return Album.fromJson(jsonDecode(response.body) as Map<String, dynamic>);
} else {
// If the server did not return a 200 OK response,
// then throw an exception.
throw Exception('Failed to load album');
}
}
```
Ideally, you will use this method to set
`_futureAlbum` during `initState` to fetch
the data from the internet.
## 5. Update the existing title from user input
Create a `TextField` to enter a title and a `ElevatedButton`
to update the data on server.
Also define a `TextEditingController` to
read the user input from a `TextField`.
When the `ElevatedButton` is pressed,
the `_futureAlbum` is set to the value returned by
`updateAlbum()` method.
<?code-excerpt "lib/main_step5.dart (Column)"?>
```dart
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8),
child: TextField(
controller: _controller,
decoration: const InputDecoration(hintText: 'Enter Title'),
),
),
ElevatedButton(
onPressed: () {
setState(() {
_futureAlbum = updateAlbum(_controller.text);
});
},
child: const Text('Update Data'),
),
],
);
```
On pressing the **Update Data** button, a network request
sends the data in the `TextField` to the server as a `PUT` request.
The `_futureAlbum` variable is used in the next step.
## 5. Display the response on screen
To display the data on screen, use the
[`FutureBuilder`][] widget.
The `FutureBuilder` widget comes with Flutter and
makes it easy to work with async data sources.
You must provide two parameters:
1. The `Future` you want to work with. In this case,
the future returned from the `updateAlbum()` function.
2. A `builder` function that tells Flutter what to render,
depending on the state of the `Future`: loading,
success, or error.
Note that `snapshot.hasData` only returns `true` when
the snapshot contains a non-null data value.
This is why the `updateAlbum` function should throw an exception
even in the case of a "404 Not Found" server response.
If `updateAlbum` returns `null` then
`CircularProgressIndicator` will display indefinitely.
<?code-excerpt "lib/main_step5.dart (FutureBuilder)"?>
```dart
FutureBuilder<Album>(
future: _futureAlbum,
builder: (context, snapshot) {
if (snapshot.hasData) {
return Text(snapshot.data!.title);
} else if (snapshot.hasError) {
return Text('${snapshot.error}');
}
return const CircularProgressIndicator();
},
);
```
## Complete example
<?code-excerpt "lib/main.dart"?>
```dart
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
Future<Album> fetchAlbum() async {
final response = await http.get(
Uri.parse('https://jsonplaceholder.typicode.com/albums/1'),
);
if (response.statusCode == 200) {
// If the server did return a 200 OK response,
// then parse the JSON.
return Album.fromJson(jsonDecode(response.body) as Map<String, dynamic>);
} else {
// If the server did not return a 200 OK response,
// then throw an exception.
throw Exception('Failed to load album');
}
}
Future<Album> updateAlbum(String title) async {
final response = await http.put(
Uri.parse('https://jsonplaceholder.typicode.com/albums/1'),
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
},
body: jsonEncode(<String, String>{
'title': title,
}),
);
if (response.statusCode == 200) {
// If the server did return a 200 OK response,
// then parse the JSON.
return Album.fromJson(jsonDecode(response.body) as Map<String, dynamic>);
} else {
// If the server did not return a 200 OK response,
// then throw an exception.
throw Exception('Failed to update album.');
}
}
class Album {
final int id;
final String title;
const Album({required this.id, required this.title});
factory Album.fromJson(Map<String, dynamic> json) {
return switch (json) {
{
'id': int id,
'title': String title,
} =>
Album(
id: id,
title: title,
),
_ => throw const FormatException('Failed to load album.'),
};
}
}
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() {
return _MyAppState();
}
}
class _MyAppState extends State<MyApp> {
final TextEditingController _controller = TextEditingController();
late Future<Album> _futureAlbum;
@override
void initState() {
super.initState();
_futureAlbum = fetchAlbum();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Update Data Example',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
home: Scaffold(
appBar: AppBar(
title: const Text('Update Data Example'),
),
body: Container(
alignment: Alignment.center,
padding: const EdgeInsets.all(8),
child: FutureBuilder<Album>(
future: _futureAlbum,
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.hasData) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(snapshot.data!.title),
TextField(
controller: _controller,
decoration: const InputDecoration(
hintText: 'Enter Title',
),
),
ElevatedButton(
onPressed: () {
setState(() {
_futureAlbum = updateAlbum(_controller.text);
});
},
child: const Text('Update Data'),
),
],
);
} else if (snapshot.hasError) {
return Text('${snapshot.error}');
}
}
return const CircularProgressIndicator();
},
),
),
),
);
}
}
```
[ConnectionState]: {{site.api}}/flutter/widgets/ConnectionState-class.html
[`didChangeDependencies()`]: {{site.api}}/flutter/widgets/State/didChangeDependencies.html
[Fetch data]: /cookbook/networking/fetch-data
[`Future`]: {{site.api}}/flutter/dart-async/Future-class.html
[`FutureBuilder`]: {{site.api}}/flutter/widgets/FutureBuilder-class.html
[`http`]: {{site.pub-pkg}}/http
[`http.put()`]: {{site.pub-api}}/http/latest/http/put.html
[`http` package]: {{site.pub}}/packages/http/install
[`InheritedWidget`]: {{site.api}}/flutter/widgets/InheritedWidget-class.html
[Introduction to unit testing]: /cookbook/testing/unit/introduction
[`initState()`]: {{site.api}}/flutter/widgets/State/initState.html
[JSONPlaceholder]: https://jsonplaceholder.typicode.com/
[JSON and serialization]: /data-and-backend/serialization/json
[Mock dependencies using Mockito]: /cookbook/testing/unit/mocking
[pattern matching]: {{site.dart-site}}/language/patterns
[`State`]: {{site.api}}/flutter/widgets/State-class.html
| website/src/cookbook/networking/update-data.md/0 | {
"file_path": "website/src/cookbook/networking/update-data.md",
"repo_id": "website",
"token_count": 4641
} | 1,481 |
---
title: Mock dependencies using Mockito
description: >
Use the Mockito package to mimic the behavior of services for testing.
short-title: Mocking
---
<?code-excerpt path-base="cookbook/testing/unit/mocking"?>
Sometimes, unit tests might depend on classes that fetch data from live
web services or databases. This is inconvenient for a few reasons:
* Calling live services or databases slows down test execution.
* A passing test might start failing if a web service or database returns
unexpected results. This is known as a "flaky test."
* It is difficult to test all possible success and failure scenarios
by using a live web service or database.
Therefore, rather than relying on a live web service or database,
you can "mock" these dependencies. Mocks allow emulating a live
web service or database and return specific results depending
on the situation.
Generally speaking, you can mock dependencies by creating an alternative
implementation of a class. Write these alternative implementations by
hand or make use of the [Mockito package][] as a shortcut.
This recipe demonstrates the basics of mocking with the
Mockito package using the following steps:
1. Add the package dependencies.
2. Create a function to test.
3. Create a test file with a mock `http.Client`.
4. Write a test for each condition.
5. Run the tests.
For more information, see the [Mockito package][] documentation.
## 1. Add the package dependencies
To use the `mockito` package, add it to the
`pubspec.yaml` file along with the `flutter_test` dependency in the
`dev_dependencies` section.
This example also uses the `http` package,
so define that dependency in the `dependencies` section.
`mockito: 5.0.0` supports Dart's null safety thanks to code generation.
To run the required code generation, add the `build_runner` dependency
in the `dev_dependencies` section.
To add the dependencies, run `flutter pub add`:
```terminal
$ flutter pub add http dev:mockito dev:build_runner
```
## 2. Create a function to test
In this example, unit test the `fetchAlbum` function from the
[Fetch data from the internet][] recipe.
To test this function, make two changes:
1. Provide an `http.Client` to the function. This allows providing the
correct `http.Client` depending on the situation.
For Flutter and server-side projects, provide an `http.IOClient`.
For Browser apps, provide an `http.BrowserClient`.
For tests, provide a mock `http.Client`.
2. Use the provided `client` to fetch data from the internet,
rather than the static `http.get()` method, which is difficult to mock.
The function should now look like this:
<?code-excerpt "lib/main.dart (fetchAlbum)"?>
```dart
Future<Album> fetchAlbum(http.Client client) async {
final response = await client
.get(Uri.parse('https://jsonplaceholder.typicode.com/albums/1'));
if (response.statusCode == 200) {
// If the server did return a 200 OK response,
// then parse the JSON.
return Album.fromJson(jsonDecode(response.body) as Map<String, dynamic>);
} else {
// If the server did not return a 200 OK response,
// then throw an exception.
throw Exception('Failed to load album');
}
}
```
In your app code, you can provide an `http.Client` to the `fetchAlbum` method
directly with `fetchAlbum(http.Client())`. `http.Client()` creates a default
`http.Client`.
## 3. Create a test file with a mock `http.Client`
Next, create a test file.
Following the advice in the [Introduction to unit testing][] recipe,
create a file called `fetch_album_test.dart` in the root `test` folder.
Add the annotation `@GenerateMocks([http.Client])` to the main
function to generate a `MockClient` class with `mockito`.
The generated `MockClient` class implements the `http.Client` class.
This allows you to pass the `MockClient` to the `fetchAlbum` function,
and return different http responses in each test.
The generated mocks will be located in `fetch_album_test.mocks.dart`.
Import this file to use them.
<?code-excerpt "test/fetch_album_test.dart (mockClient)" plaster="none"?>
```dart
import 'package:http/http.dart' as http;
import 'package:mocking/main.dart';
import 'package:mockito/annotations.dart';
// Generate a MockClient using the Mockito package.
// Create new instances of this class in each test.
@GenerateMocks([http.Client])
void main() {
}
```
Next, generate the mocks running the following command:
```terminal
$ dart run build_runner build
```
## 4. Write a test for each condition
The `fetchAlbum()` function does one of two things:
1. Returns an `Album` if the http call succeeds
2. Throws an `Exception` if the http call fails
Therefore, you want to test these two conditions.
Use the `MockClient` class to return an "Ok" response
for the success test, and an error response for the unsuccessful test.
Test these conditions using the `when()` function provided by
Mockito:
<?code-excerpt "test/fetch_album_test.dart"?>
```dart
import 'package:flutter_test/flutter_test.dart';
import 'package:http/http.dart' as http;
import 'package:mocking/main.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import 'fetch_album_test.mocks.dart';
// Generate a MockClient using the Mockito package.
// Create new instances of this class in each test.
@GenerateMocks([http.Client])
void main() {
group('fetchAlbum', () {
test('returns an Album if the http call completes successfully', () async {
final client = MockClient();
// Use Mockito to return a successful response when it calls the
// provided http.Client.
when(client
.get(Uri.parse('https://jsonplaceholder.typicode.com/albums/1')))
.thenAnswer((_) async =>
http.Response('{"userId": 1, "id": 2, "title": "mock"}', 200));
expect(await fetchAlbum(client), isA<Album>());
});
test('throws an exception if the http call completes with an error', () {
final client = MockClient();
// Use Mockito to return an unsuccessful response when it calls the
// provided http.Client.
when(client
.get(Uri.parse('https://jsonplaceholder.typicode.com/albums/1')))
.thenAnswer((_) async => http.Response('Not Found', 404));
expect(fetchAlbum(client), throwsException);
});
});
}
```
## 5. Run the tests
Now that you have a `fetchAlbum()` function with tests in place,
run the tests.
```terminal
$ flutter test test/fetch_album_test.dart
```
You can also run tests inside your favorite editor by following the
instructions in the [Introduction to unit testing][] recipe.
## Complete example
##### lib/main.dart
<?code-excerpt "lib/main.dart"?>
```dart
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
Future<Album> fetchAlbum(http.Client client) async {
final response = await client
.get(Uri.parse('https://jsonplaceholder.typicode.com/albums/1'));
if (response.statusCode == 200) {
// If the server did return a 200 OK response,
// then parse the JSON.
return Album.fromJson(jsonDecode(response.body) as Map<String, dynamic>);
} else {
// If the server did not return a 200 OK response,
// then throw an exception.
throw Exception('Failed to load album');
}
}
class Album {
final int userId;
final int id;
final String title;
const Album({required this.userId, required this.id, required this.title});
factory Album.fromJson(Map<String, dynamic> json) {
return Album(
userId: json['userId'] as int,
id: json['id'] as int,
title: json['title'] as String,
);
}
}
void main() => runApp(const MyApp());
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
late final Future<Album> futureAlbum;
@override
void initState() {
super.initState();
futureAlbum = fetchAlbum(http.Client());
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Fetch Data Example',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
home: Scaffold(
appBar: AppBar(
title: const Text('Fetch Data Example'),
),
body: Center(
child: FutureBuilder<Album>(
future: futureAlbum,
builder: (context, snapshot) {
if (snapshot.hasData) {
return Text(snapshot.data!.title);
} else if (snapshot.hasError) {
return Text('${snapshot.error}');
}
// By default, show a loading spinner.
return const CircularProgressIndicator();
},
),
),
),
);
}
}
```
##### test/fetch_album_test.dart
<?code-excerpt "test/fetch_album_test.dart"?>
```dart
import 'package:flutter_test/flutter_test.dart';
import 'package:http/http.dart' as http;
import 'package:mocking/main.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import 'fetch_album_test.mocks.dart';
// Generate a MockClient using the Mockito package.
// Create new instances of this class in each test.
@GenerateMocks([http.Client])
void main() {
group('fetchAlbum', () {
test('returns an Album if the http call completes successfully', () async {
final client = MockClient();
// Use Mockito to return a successful response when it calls the
// provided http.Client.
when(client
.get(Uri.parse('https://jsonplaceholder.typicode.com/albums/1')))
.thenAnswer((_) async =>
http.Response('{"userId": 1, "id": 2, "title": "mock"}', 200));
expect(await fetchAlbum(client), isA<Album>());
});
test('throws an exception if the http call completes with an error', () {
final client = MockClient();
// Use Mockito to return an unsuccessful response when it calls the
// provided http.Client.
when(client
.get(Uri.parse('https://jsonplaceholder.typicode.com/albums/1')))
.thenAnswer((_) async => http.Response('Not Found', 404));
expect(fetchAlbum(client), throwsException);
});
});
}
```
## Summary
In this example, you've learned how to use Mockito to test functions or classes
that depend on web services or databases. This is only a short introduction to
the Mockito library and the concept of mocking. For more information,
see the documentation provided by the [Mockito package][].
[Fetch data from the internet]: /cookbook/networking/fetch-data
[Introduction to unit testing]: /cookbook/testing/unit/introduction
[Mockito package]: {{site.pub-pkg}}/mockito
| website/src/cookbook/testing/unit/mocking.md/0 | {
"file_path": "website/src/cookbook/testing/unit/mocking.md",
"repo_id": "website",
"token_count": 3653
} | 1,482 |
---
layout: toc
title: State management
description: Content covering state management in Flutter apps.
---
| website/src/data-and-backend/state-mgmt/index.md/0 | {
"file_path": "website/src/data-and-backend/state-mgmt/index.md",
"repo_id": "website",
"token_count": 26
} | 1,483 |
---
title: Networking and data
description: Learn how to network your Flutter app.
prev:
title: Handling user input
next:
title: Local data and caching
---
While it's said that "no man is an island",
a Flutter app without any networking capability
can feel a tad disconnected.
This page covers how to add networking features
to your Flutter app. Your app will retrieve data,
parse JSON into usable in memory representations,
and then send data out again.
## Introduction to retrieving data over the network
The following two tutorials introduce you to the
[`http`][] package, which enables your app to make
[HTTP][] requests with ease,
whether you are running on Android,
iOS, inside a web browser, or natively on Windows,
macOS, or Linux.
The first tutorial shows you how to make an
unauthenticated `GET` request to a website,
parse the retrieved data as `JSON` and then
display the resulting data. The second tutorial
builds on the first by adding authentication headers,
enabling access to web servers requiring authorization.
The article by the Mozilla Developer Network (MDN)
gives more background on how authorization works on the web.
* Tutorial: [Fetch data from the internet][]
* Tutorial: [Make authenticated requests][]
* Article: [MDN's article on Authorization for websites][]
## Making data retrieved from the network useful
Once you retrieve data from the network,
you need a way to convert the data from the network
into something that you can easily work with in Dart.
The tutorials in the previous section used hand rolled Dart
to convert network data into an in-memory representation.
In this section,
you'll see other options for handling this conversion.
The first links to a YouTube video showing an overview
of the [`freezed` package][].
The second links to a codelab that covers patterns
and records using a case study of parsing JSON.
* YouTube video: [Freezed (Package of the Week)][]
* Codelab: [Dive into Dart's patterns and records][]
## Going both ways, getting data out again
Now that you've mastered the art of retrieving data,
it's time to look at pushing data out.
This information starts with sending data to the network,
but then dives into asynchronicity. The truth is,
once you are in a conversation over the network,
you'll need to deal with the fact that web servers
that are physically far away can take a while to respond,
and you can't stop rendering to the screen
while you wait for packets to round trip.
Dart has great support for asynchronicity,
as does Flutter.
You'll learn all about Dart's support in a tutorial,
then see Flutter's capability covered in a
Widget of the Week video.
Once you complete that, you'll learn how to debug
network traffic using DevTool's Network View.
* Tutorial: [Send data to the internet][]
* Tutorial: [Asynchronous programming: futures, async, await][]
* YouTube video: [FutureBuilder (Widget of the Week)][]
* Article: [Using the Network View][]
## Extension material
Now that you've mastered using Flutter's networking APIs,
it helps to see Flutter's network usage in context.
The first codelab (ostensibly on creating Adaptive apps in Flutter),
uses a web server written in Dart to work around the web browsers'
[Cross-Origin Resource Sharing (CORS) restrictions][].
{{site.alert.note}}
If you've already worked through this codelab
on the [layout][] page, feel free to skip this step.
{{site.alert.end}}
[layout]: {{site.url}}/get-started/fwe/layout
Next, a long-form YouTube video where
Flutter DevRel alumnus, Fitz,
talks about how the location of data matters for Flutter apps.
Finally, a really useful series of articles by Flutter GDE
Anna (Domashych) Leushchenko covering advanced networking in Flutter.
* Codelab: [Adaptive apps in Flutter][]
* Video: [Keeping it local: Managing a Flutter app's data][]
* Article series: [Basic and advanced networking in Dart and Flutter][]
[Adaptive apps in Flutter]: {{site.codelabs}}/codelabs/flutter-adaptive-app
[Asynchronous programming: futures, async, await]: {{site.dart-site}}/codelabs/async-await
[Basic and advanced networking in Dart and Flutter]: {{site.medium}}/tide-engineering-team/basic-and-advanced-networking-in-dart-and-flutter-the-tide-way-part-0-introduction-33ac040a4a1c
[Cross-Origin Resource Sharing (CORS) restrictions]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
[Dive into Dart's patterns and records]: {{site.codelabs}}/codelabs/dart-patterns-records
[Fetch data from the internet]: /cookbook/networking/fetch-data
[Freezed (Package of the Week)]: {{site.youtube-site}}/watch?v=RaThk0fiphA
[`freezed` package]: {{site.pub-pkg}}/freezed
[FutureBuilder (Widget of the Week)]: {{site.youtube-site}}/watch?v=zEdw_1B7JHY
[`http`]: {{site.pub-pkg}}/http
[HTTP]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview
[Keeping it local: Managing a Flutter app's data]: {{site.youtube-site}}/watch?v=uCbHxLA9t9E
[Make authenticated requests]: /cookbook/networking/authenticated-requests
[MDN's article on Authorization for websites]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization
[Using the Network View]: https://docs.flutter.dev/tools/devtools/network
[Send data to the internet]: https://docs.flutter.dev/cookbook/networking/send-data
## Feedback
As this section of the website is evolving,
we [welcome your feedback][]!
[welcome your feedback]: {{site.url}}/get-started/fwe
| website/src/get-started/fwe/networking.md/0 | {
"file_path": "website/src/get-started/fwe/networking.md",
"repo_id": "website",
"token_count": 1504
} | 1,484 |
## Windows setup
[Announcing Flutter for Windows]: {{site.flutter-medium}}/announcing-flutter-for-windows-6979d0d01fed
### Additional Windows requirements
{% include_relative _help-link.md location='win-desktop' %}
For Windows desktop development,
you need the following in addition to the Flutter SDK:
* [Visual Studio 2022][] or [Visual Studio Build Tools 2022][]
When installing Visual Studio or only the Build Tools,
you need the "Desktop development with C++" workload installed
for building windows, including all of its default components.
{{site.alert.note}}
**Visual Studio** is different than Visual Studio _Code_.
{{site.alert.end}}
For more information, see [Building Windows apps][].
[Building Windows apps]: /platform-integration/windows/building
[Visual Studio 2022]: https://visualstudio.microsoft.com/downloads/
[Visual Studio Build Tools 2022]: https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022
| website/src/get-started/install/_deprecated/_windows-desktop-setup.md/0 | {
"file_path": "website/src/get-started/install/_deprecated/_windows-desktop-setup.md",
"repo_id": "website",
"token_count": 258
} | 1,485 |
---
title: Start building Flutter native desktop apps on Windows
description: Configure your system to develop Flutter desktop apps on Windows.
short-title: Make Windows desktop apps
target: desktop
config: WindowsDesktop
devos: Windows
next:
title: Create a test app
path: /get-started/test-drive
---
{% include docs/install/reqs/windows/base.md
os=page.devos
target=page.target
-%}
{% include docs/install/flutter-sdk.md
os=page.devos
target=page.target
terminal='PowerShell'
-%}
{% include docs/install/flutter-doctor.md
devos=page.devos
target=page.target platform=page.target
config=page.config
-%}
{% include docs/install/next-steps.md
devos=page.devos
target=page.target
config=page.config
-%}
| website/src/get-started/install/windows/desktop.md/0 | {
"file_path": "website/src/get-started/install/windows/desktop.md",
"repo_id": "website",
"token_count": 263
} | 1,486 |
---
title: More thoughts about performance
description: What is performance, and why is performance important
---
## What is performance?
Performance is a set of quantifiable properties of a performer.
In this context, performance isn't the execution of an action itself;
it's how well something or someone performs. Therefore, we use the adjective
_performant_.
While the _how well_ part can, in general, be described in natural languages,
in our limited scope, the focus is on something that is quantifiable as a real
number. Real numbers include integers and 0/1 binaries as special cases.
Natural language descriptions are still very important. For example, a news
article that heavily criticizes Flutter's performance by just using words
without any numbers (a quantifiable value) could still be meaningful, and it
could have great impacts. The limited scope is chosen only because of our
limited resources.
The required quantity to describe performance is often referred to as a
metric.
To navigate through countless performance issues and metrics, you can categorize
based on performers.
For example, most of the content on this website is about the Flutter app
performance, where the performer is a Flutter app. Infra performance is also
important to Flutter, where the performers are build bots and CI task runners:
they heavily affect how fast Flutter can incorporate code changes, to improve
the app's performance.
Here, the scope was intentionally broadened to include performance issues other
than just app performance issues because they can share many tools regardless of
who the performers are. For example, Flutter app performance and infra
performance might share the same dashboard and similar alert mechanisms.
Broadening the scope also allows performers to be included that traditionally
are easy to ignore. Document performance is such an example. The performer
could be an API doc of the SDK, and a metric could be: the percentage of readers
who find the API doc useful.
## Why is performance important?
Answering this question is not only crucial for validating the work in
performance, but also for guiding the performance work in order to be more
useful. The answer to "why is performance important?" often is also the answer
to "how is performance useful?"
Simply speaking, performance is important and useful because, in the scope,
performance must have quantifiable properties or metrics. This implies:
1. A performance report is easy to consume.
2. Performance has little ambiguity.
3. Performance is comparable and convertible.
4. Performance is fair.
Not that non-performance, or non-measurable issues or descriptions are not
important. They're meant to highlight the scenarios where performance can be
more useful.
### 1. A performance report is easy to consume
Performance metrics are numbers. Reading a number is much easier than reading a
passage. For example, it probably takes an engineer 1 second to consume the
performance rating as a number from 1 to 5. It probably takes the same engineer
at least 1 minute to read the full, 500-word feedback summary.
If there are many numbers, it's easy to summarize or visualize them for quick
consumption. For example, you can quickly consume millions of numbers by
looking at its histogram, average, quantiles, and so on. If a metric has a
history of thousands of data points, then you can easily plot a timeline to
read its trend.
On the other hand, having _n_ number of 500-word texts almost guarantees an
_n_-time cost to consume those texts. It would be a daunting task to analyze
thousands of historical descriptions, each having 500 words.
### 2. Performance has little ambiguity
Another advantage of having performance as a set of numbers is its unambiguity.
When you want an animation to have a performance of 20 ms per frame or
50 fps, there's little room for different interpretations about the numbers. On
the other hand, to describe the same animation in words, someone might call it
good, while someone else might complain that it's bad. Similarly, the same
word or phrase could be interpreted differently by different people. You might
interpret an OK frame rate to be 60 fps, while someone else might interpret it
to be 30 fps.
Numbers can still be noisy. For example, the measured time per frame might
be a true computation time of this frame, plus a random amount of time (noise)
that CPU/GPU spends on some unrelated work. Hence, the metric fluctuates.
Nevertheless, there's no ambiguity of what the number means. And, there are
also rigorous theory and testing tools to handle such noise. For example, you
could take multiple measurements to estimate the distribution of a random
variable, or you could take the average of many measurements to eliminate the
noise by [the law of large numbers][1].
### 3. Performance is comparable and convertible
Performance numbers not only have unambiguous meanings, but they also have
unambiguous comparisons. For example, there's no doubt that 5 is greater than 4.
On the other hand, it might be subjective to figure out whether excellent is
better or worse than superb. Similarly, could you figure out whether epic is
better than legendary? Actually, the phrase _strongly exceeds expectations_
could be better than _superb_ in someone's interpretation. It only becomes
unambiguous and comparable after a definition that maps strongly exceeds
expectations to 4 and superb to 5.
Numbers are also easily convertible using formulas and functions. For example,
60 fps can be converted to 16.67 ms per frame. A frame's rendering
time _x_ (ms) can be converted to a binary indicator
`isSmooth = [x <= 16] = (x <= 16 ? 1 :0)`. Such conversion can be compounded or
chained, so you can get a large variety of quantities using a single
measurement without any added noise or ambiguity. The converted quantity can
then be used for further comparisons and consumption. Such conversions are
almost impossible if you're dealing with natural languages.
### 4. Performance is fair
If issues rely on verbose words to be discovered, then an unfair advantage is
given to people who are more verbose (more willing to chat or write) or those
who are closer to the development team, who have a larger bandwidth and lower
cost for chatting or face-to-face meetings.
By having the same metrics to detect problems no matter how far away or how
silent the users are, we can treat all issues fairly. That, in turn,
allows us to focus on the right issues that have greater impact.
### How to make performance useful
The following summarizes the 4 points discussed here, from a slightly different
perspective:
1. Make performance metrics easy to consume. Do not overwhelm the readers with a
lot of numbers (or words). If there are many numbers, then try to summarize
them into a smaller set of numbers (for example, summarize many numbers into
a single average number). Only notify readers when the numbers change
significantly (for example, automatic alerts on spikes or regressions).
2. Make performance metrics as unambiguous as possible. Define the unit that the
number is using. Precisely describe how the number is measured. Make the
number easily reproducible. When there's a lot of noise, try to show the full
distribution, or eliminate the noise as much as possible by aggregating many
noisy measurements.
3. Make it easy to compare performance. For example, provide a timeline to
compare the current version with the old version. Provide ways and tools to
convert one metric to another. For example, if we can convert both memory
increase and fps drops into the number of users dropped or revenue lost in
dollars, then we can compare them and make an informed trade-off.
4. Make performance metrics monitor a population that is as wide as possible,
so no one is left behind.
[1]: https://en.wikipedia.org/wiki/Law_of_large_numbers
| website/src/perf/appendix.md/0 | {
"file_path": "website/src/perf/appendix.md",
"repo_id": "website",
"token_count": 1775
} | 1,487 |
---
title: Add Android devtools for Flutter from iOS start
description: Configure your Mac to develop Flutter mobile apps for Android.
short-title: Starting from iOS on macOS
---
To add Android as a Flutter app target for iOS, follow this procedure.
## Install Android Studio
1. Allocate a minimum of 7.5 GB of storage for Android Studio.
Consider allocating 10 GB of storage for an optimal configuration.
1. Install [Android Studio][] {{site.appmin.android_studio}} to debug and compile
Java or Kotlin code for Android.
Flutter requires the full version of Android Studio.
{% include docs/install/compiler/android.md
target='macos'
devos='macOS'
attempt="first" -%}
{% include docs/install/flutter-doctor.md
target='Android'
devos='macOS'
config='macOSDesktopAndroid' %}
[Android Studio]: https://developer.android.com/studio/install#mac
| website/src/platform-integration/android/install-android/install-android-from-ios.md/0 | {
"file_path": "website/src/platform-integration/android/install-android/install-android-from-ios.md",
"repo_id": "website",
"token_count": 255
} | 1,488 |
---
title: iOS
layout: toc
description: Content covering integration with iOS in Flutter apps.
---
| website/src/platform-integration/ios/index.md/0 | {
"file_path": "website/src/platform-integration/ios/index.md",
"repo_id": "website",
"token_count": 26
} | 1,489 |
---
title: Add Web devtools to Flutter from Android on Windows start
description: Configure your system to develop Flutter web apps on Windows.
short-title: Starting from Android on Windows
---
To add Web as a Flutter app target for Windows with Android,
follow this procedure.
## Configure Chrome as the web DevTools tools
{% include docs/install/reqs/add-web.md devos='Windows' %}
{% include docs/install/flutter-doctor.md
target='Web'
devos='Windows'
config='WindowsDesktopAndroidWeb' %}
| website/src/platform-integration/web/install-web/install-web-from-android-on-windows.md/0 | {
"file_path": "website/src/platform-integration/web/install-web/install-web-from-android-on-windows.md",
"repo_id": "website",
"token_count": 144
} | 1,490 |
---
title: Security false positives
description: Security vulnerabilities incorrectly reported by automated static analysis tools
---
## Introduction
We occasionally receive false reports of security
vulnerabilities in Dart and Flutter applications,
generated by tools that were built for other kinds
of applications (for example, those written with Java or C++).
This document provides information on reports that we believe
are incorrect and explains why the concerns are misplaced.
## Common concerns
### Shared objects should use fortified functions
> The shared object does not have any fortified functions.
> Fortified functions provides buffer overflow checks against glibc's commons insecure functions like `strcpy`, `gets` etc.
> Use the compiler option `-D_FORTIFY_SOURCE=2` to fortify functions.
When this refers to compiled Dart code
(such as the `libapp.so` file in Flutter applications),
this advice is misguided because Dart code doesn't
directly invoke libc functions;
all Dart code goes through the Dart standard library.
(In general, MobSF gets false positives here because
it checks for any use of functions with a `_chk` suffix,
but since Dart doesn't use these functions at all,
it doesn't have calls with or without the suffix,
and therefore MobSF treats the code as containing
non-fortified calls.)
### Shared objects should use RELRO
> no RELRO found for `libapp.so` binaries
Dart doesn't use the normal Procedure Linkage Table
(PLT) or Global Offsets Table (GOT) mechanisms at all,
so the Relocation Read-Only (RELRO) technique doesn't
really make much sense for Dart.
Dart's equivalent of GOT is the pool pointer,
which unlike GOT, is located in a randomized location
and is therefore much harder to exploit.
In principle, you can create vulnerable code when using Dart FFI,
but normal use of Dart FFI wouldn't be prone to these issues either,
assuming it's used with C code that itself uses RELRO appropriately.
### Shared objects should use stack canary values
> no canary are found for `libapp.so` binaries
> This shared object does not have a stack canary value added to the stack.
> Stack canaries are used to detect and prevent exploits from overwriting return address.
> Use the option -fstack-protector-all to enable stack canaries.
Dart doesn't generate stack canaries because,
unlike C++, Dart doesn't have stack-allocated arrays
(the primary source of stack smashing in C/C++).
When writing pure Dart (without using `dart:ffi`),
you already have much stronger isolation guarantees
than any C++ mitigation can provide,
simply because pure Dart code is a managed language
where things like buffer overruns don't exist.
In principle, you can create vulnerable code when using Dart FFI,
but normal use of Dart FFI would not be prone to these issues either,
assuming it's used with C code that itself uses stack canary values
appropriately.
### Code should avoid using the `_sscanf`, `_strlen`, and `_fopen` APIs
> The binary may contain the following insecure API(s) `_sscanf` , `_strlen` , `_fopen`.
The tools that report these issues tend to be
overly-simplistic in their scans;
for example, finding custom functions with
these names and assuming they refer to the
standard library functions.
Many of Flutter's third-party dependencies have
functions with similar names that trip these checks.
It's possible that some occurrences are valid concerns,
but it's impossible to tell from the output of these tools
due to the sheer number of false positives.
### Code should use `calloc` (instead of `_malloc`) for memory allocations
> The binary may use `_malloc` function instead of `calloc`.
Memory allocation is a nuanced topic,
where trade-offs have to be made between performance
and resilience to vulnerabilities.
Merely using `malloc` is not automatically indicative
of a security vulnerability.
While we welcome concrete reports (see below)
for cases where using `calloc` would be preferable,
in practice it would be inappropriate to uniformly
replace all `malloc` calls with `calloc`.
### The iOS binary has a Runpath Search Path (`@rpath`) set
> The binary has Runpath Search Path (`@rpath`) set.
> In certain cases an attacker can abuse this feature to run arbitrary executable for code execution and privilege escalation.
> Remove the compiler option `-rpath` to remove `@rpath`.
When the app is being built, Runpath Search Path refers
to the paths the linker searches to find dynamic libraries
(dylibs) used by the app.
By default, iOS apps have this set to
`@executable_path/Frameworks`,
which means the linker should search for dylibs
in the `Frameworks` directory relative to the app
binary inside the app bundle.
The `Flutter.framework` engine,
like most embedded frameworks or dylibs,
is correctly copied into this directory.
When the app runs, it loads the library binary.
Flutter apps use the default iOS build setting
(`LD_RUNPATH_SEARCH_PATHS=@executable_path/Frameworks`).
Vulnerabilities involving `@rpath` don't apply
in mobile settings, as attackers don't have
access to the file system and can't arbitrarily
swap out these frameworks.
Even if an attacker somehow _could_ swap out the
framework with a malicious one,
the app would crash on launch due to codesigning violations.
### CBC with PKCS5/PKCS7 padding vulnerability
We have received vague reports that there is a
"CBC with PKCS5/PKCS7 padding vulnerability"
in some Flutter packages.
As far as we can tell, this is triggered by the HLS
implementation in ExoPlayer
(the `com.google.android.exoplayer2.source.hls.Aes128DataSource` class).
HLS is Apple's streaming format,
which defines the type of encryption that must be used for DRM;
this isn't a vulnerability,
as DRM doesn't protect the user's machine or data
but instead merely provides obfuscation
to limit the user's ability to fully use their software and hardware.
### Apps can read and write to external storage
> App can read/write to External Storage. Any App can read data written to External Storage.
> As with data from any untrusted source, you should perform input validation when handling data from external storage.
> We strongly recommend that you not store executables or class files on external storage prior to dynamic loading.
> If your app does retrieve executable files from external storage,
> the files should be signed and cryptographically verified prior to dynamic loading.
We have received reports that some vulnerability
scanning tools interpret the ability for image
picker plugins to read and write to external storage as a threat.
Reading images from local storage is the purpose of these plugins;
this is not a vulnerability.
### Apps delete data using file.delete()
> When you delete a file using file. delete, only the reference to the file is removed from the file system table.
> The file still exists on disk until other data overwrites it, leaving it vulnerable to recovery.
Some vulnerability scanning tools interpret the deletion of
temporary files after a camera plugin records data from
the device's camera as a security vulnerability.
Because the video is recorded by the user and is stored
on the user's hardware, there is no actual risk.
## Obsolete concerns
This section contains valid messages that might be seen with
older versions of Dart and Flutter, but should no longer
be seen with more recent versions.
If you see these messages with old versions of Dart or Flutter,
upgrade to the latest stable version.
If you see these with the current stable version,
please report them (see the section at the end of this document).
### The stack should have its NX bit set
> The shared object does not have NX bit set.
> NX bit offer protection against exploitation of memory corruption vulnerabilities by marking memory page as non-executable.
> Use option `--noexecstack` or `-z noexecstack` to mark stack as non executable.
(The message from MobSF is misleading; it's looking
for whether the stack is marked as non-executable,
not the shared object.)
In older versions of Dart and Flutter there was a bug
where the ELF generator didn't emit the `gnustack`
segment with the `~X` permission, but this is now fixed.
## Reporting real concerns
While automated vulnerability scanning tools report
false positives such as the examples above,
we can't rule out that there are real issues that
deserve closer attention.
Should you find an issue that you believe is a
legitimate security vulnerability, we would greatly
appreciate if you would report it:
* [Flutter security policy](/security)
* [Dart security policy]({{site.dart-site}}/security)
| website/src/reference/security-false-positives.md/0 | {
"file_path": "website/src/reference/security-false-positives.md",
"repo_id": "website",
"token_count": 2076
} | 1,491 |
---
title: Deprecated API removed after v3.7
description: >
After reaching end of life, the following deprecated APIs
were removed from Flutter.
---
## Summary
In accordance with Flutter's [Deprecation Policy][],
deprecated APIs that reached end of life after the
3.7 stable release have been removed.
All affected APIs have been compiled into this
primary source to aid in migration. A
[quick reference sheet][] is available as well.
[Deprecation Policy]: {{site.repo.flutter}}/wiki/Tree-hygiene#deprecation
[quick reference sheet]: /go/deprecations-removed-after-3-7
## Changes
This section lists the deprecations, listed by the affected class.
### `GestureRecognizer.kind` & subclasses
Supported by Flutter Fix: yes
`GestureRecognizer.kind` was deprecated in v2.3.
Use `GestureRecognizer.supportedDevices` instead.
This same change affects all subclasses of `GestureRecognizer`:
* `EagerGestureRecognizer`
* `ForcePressGestureRecognizer`
* `LongPressGestureRecognizer`
* `DragGestureRecognizer`
* `VerticalDragGestureRecognizer`
* `HorizontalDragGestureRecognizer`
* `MultiDragGestureRecognizer`
* `ImmediateMultiDragGestureRecognizer`
* `HorizontalMultiDragGestureRecognizer`
* `VerticalMultiDragGestureRecognizer`
* `DelayedMultiDragGestureRecognizer`
* `DoubleTapGestureRecognizer`
* `MultiTapGestureRecognizer`
* `OneSequenceGestureRecognizer`
* `PrimaryPointerGestureRecognizer`
* `ScaleGestureRecognizer`
This change allowed for multiple devices to be recognized for a gesture, rather
than the single option `kind` provided.
**Migration guide**
Code before migration:
```dart
var myRecognizer = GestureRecognizer(
kind: PointerDeviceKind.mouse,
);
```
Code after migration:
```dart
var myRecognizer = GestureRecognizer(
supportedDevices: <PointerDeviceKind>[ PointerDeviceKind.mouse ],
);
```
**References**
API documentation:
* [`GestureRecognizer`][]
* [`EagerGestureRecognizer`][]
* [`ForcePressGestureRecognizer`][]
* [`LongPressGestureRecognizer`][]
* [`DragGestureRecognizer`][]
* [`VerticalDragGestureRecognizer`][]
* [`HorizontalDragGestureRecognizer`][]
* [`MultiDragGestureRecognizer`][]
* [`ImmediateMultiDragGestureRecognizer`][]
* [`HorizontalMultiDragGestureRecognizer`][]
* [`VerticalMultiDragGestureRecognizer`][]
* [`DelayedMultiDragGestureRecognizer`][]
* [`DoubleTapGestureRecognizer`][]
* [`MultiTapGestureRecognizer`][]
* [`OneSequenceGestureRecognizer`][]
* [`PrimaryPointerGestureRecognizer`][]
* [`ScaleGestureRecognizer`][]
Relevant PRs:
* Deprecated in [#81858][]
* Removed in [#119572][]
[`GestureRecognizer`]: {{site.api}}/flutter/gestures/GestureRecognizer-class.html
[`EagerGestureRecognizer`]: {{site.api}}/flutter/gestures/EagerGestureRecognizer-class.html
[`ForcePressGestureRecognizer`]: {{site.api}}/flutter/gestures/ForcePressGestureRecognizer-class.html
[`LongPressGestureRecognizer`]: {{site.api}}/flutter/gestures/LongPressGestureRecognizer-class.html
[`DragGestureRecognizer`]: {{site.api}}/flutter/gestures/DragGestureRecognizer-class.html
[`VerticalDragGestureRecognizer`]: {{site.api}}/flutter/gestures/VerticalDragGestureRecognizer-class.html
[`HorizontalDragGestureRecognizer`]: {{site.api}}/flutter/gestures/HorizontalDragGestureRecognizer-class.html
[`MultiDragGestureRecognizer`]: {{site.api}}/flutter/gestures/MultiDragGestureRecognizer-class.html
[`ImmediateMultiDragGestureRecognizer`]: {{site.api}}/flutter/gestures/ImmediateMultiDragGestureRecognizer-class.html
[`HorizontalMultiDragGestureRecognizer`]: {{site.api}}/flutter/gestures/HorizontalMultiDragGestureRecognizer-class.html
[`VerticalMultiDragGestureRecognizer`]: {{site.api}}/flutter/gestures/VerticalMultiDragGestureRecognizer-class.html
[`DelayedMultiDragGestureRecognizer`]: {{site.api}}/flutter/gestures/DelayedMultiDragGestureRecognizer-class.html
[`DoubleTapGestureRecognizer`]: {{site.api}}/flutter/gestures/DoubleTapGestureRecognizer-class.html
[`MultiTapGestureRecognizer`]: {{site.api}}/flutter/gestures/MultiTapGestureRecognizer-class.html
[`OneSequenceGestureRecognizer`]: {{site.api}}/flutter/gestures/OneSequenceGestureRecognizer-class.html
[`PrimaryPointerGestureRecognizer`]: {{site.api}}/flutter/gestures/PrimaryPointerGestureRecognizer-class.html
[`ScaleGestureRecognizer`]: {{site.api}}/flutter/gestures/ScaleGestureRecognizer-class.html
[#81858]: {{site.repo.flutter}}/pull/81858
[#119572]: {{site.repo.flutter}}/pull/119572
---
### `ThemeData` `accentColor`, `accentColorBrightness`, `accentColorTextTheme`, `accentColorIconTheme`, and `buttonColor`
Supported by Flutter Fix: yes
The `accentColor`, `accentColorBrightness`, `accentColorTextTheme`,
`accentColorIconTheme`, and `buttonColor` properties of `ThemeData` were
deprecated in v2.3.
This change better aligned `ThemeData` with Material Design guidelines. It also
created more clarity in theming by relying either on the core color scheme or
individual component themes for desired styling.
The `accentColorBrightness`, `accentColorTextTheme`,
`accentColorIconTheme`, and `buttonColor` are no longer used by the framework.
References should be removed.
Uses of `ThemeData.accentColor` should be replaced with
`ThemeData.colorScheme.secondary`.
## Migration guide
Code before migration:
```dart
var myTheme = ThemeData(
//...
accentColor: Colors.blue,
//...
);
var color = myTheme.accentColor;
```
Code after migration:
```dart
var myTheme = ThemeData(
//...
colorScheme: ColorScheme(
//...
secondary:Colors.blue,
//...
),
//...
);
var color = myTheme.colorScheme.secondary;
```
**References**
* [Accent color migration guide][]
API documentation:
* [`ThemeData`][]
* [`ColorScheme`][]
Relevant issues:
* [#56639][]
* [#84748][]
* [#56918][]
* [#91772][]
Relevant PRs:
Deprecated in:
* [#92822][]
* [#81336][]
* [#85144][]
Removed in:
* [#118658][]
* [#119360][]
* [#120577][]
* [#120932][]
[Accent color migration guide]: /release/breaking-changes/theme-data-accent-properties
[`ThemeData`]: {{site.api}}/flutter/widgets/Draggable-class.html
[`ColorScheme`]: {{site.api}}/flutter/widgets/LongPressDraggable-class.html
[#56639]: {{site.repo.flutter}}/pull/56639
[#84748]: {{site.repo.flutter}}/pull/84748
[#56918]: {{site.repo.flutter}}/pull/56918
[#91772]: {{site.repo.flutter}}/pull/91772
[#92822]: {{site.repo.flutter}}/pull/92822
[#81336]: {{site.repo.flutter}}/pull/81336
[#85144]: {{site.repo.flutter}}/pull/85144
[#118658]: {{site.repo.flutter}}/pull/118658
[#119360]: {{site.repo.flutter}}/pull/119360
[#120577]: {{site.repo.flutter}}/pull/120577
[#120932]: {{site.repo.flutter}}/pull/120932
---
### `AppBar`, `SliverAppBar`, and `AppBarTheme` updates
Supported by Flutter Fix: yes
In v2.4, several changes were made ot the app bar classes and their themes to
better align with Material Design. Several properties were deprecated at that
time and have been removed.
For `AppBar`, `SliverAppBar` and `AppBarTheme`:
* `brightness` has been removed, and is replaced by `systemOverlayStyle`
* `textTheme` has been removed, and is replaced by either `toolbarTextStyle` or `titleTextStyle`.
* `backwardsCompatibility` can be removed, as it was a temporary migration flag for these properties.
Additionally, `AppBarTheme.color` was removed, with `AppBarTheme.backgroundColor`
as its replacement.
**Migration guide**
Code before migration:
```dart
var toolbarTextStyle = TextStyle(...);
var titleTextStyle = TextStyle(...);
AppBar(
brightness: Brightness.light,
textTheme: TextTheme(
bodyMedium: toolbarTextStyle,
titleLarge: titleTextStyle,
)
backwardsCompatibility: true,
);
AppBarTheme(color: Colors.blue);
```
Code after migration:
```dart
var toolbarTextStyle = TextStyle(...);
var titleTextStyle = TextStyle(...);
AppBar(
systemOverlayStyle: SystemOverlayStyle(statusBarBrightness: Brightness.light),
toolbarTextStyle: toolbarTextStyle,
titleTextStyle: titleTextStyle,
);
AppBarTheme(backgroundColor: Colors.blue);
```
**References**
API documentation:
* [`AppBar`][]
* [`SliverAppBar`][]
* [`AppBarTheme`][]
Relevant issues:
* [#86127][]
* [#70645][]
* [#67921][]
* [#67497][]
* [#50606][]
* [#51820][]
* [#61618][]
Deprecated in:
* [#86198][]
* [#71184][]
Removed in:
* [#120618][]
* [#119253][]
* [#120575][]
[`AppBar`]: {{site.api}}/flutter/material/AppBar-class.html
[`SliverAppBar`]: {{site.api}}/flutter/material/SliverAppBar-class.html
[`AppBarTheme`]: {{site.api}}/flutter/material/AppBarTheme-class.html
[#86127]: {{site.repo.flutter}}/pull/86127
[#70645]: {{site.repo.flutter}}/pull/70645
[#67921]: {{site.repo.flutter}}/pull/67921
[#67497]: {{site.repo.flutter}}/pull/67497
[#50606]: {{site.repo.flutter}}/pull/50606
[#51820]: {{site.repo.flutter}}/pull/51820
[#61618]: {{site.repo.flutter}}/pull/61618
[#86198]: {{site.repo.flutter}}/pull/86198
[#71184]: {{site.repo.flutter}}/pull/71184
[#120618]: {{site.repo.flutter}}/pull/120618
[#119253]: {{site.repo.flutter}}/pull/119253
[#120575]: {{site.repo.flutter}}/pull/120575
---
### `SystemChrome.setEnabledSystemUIOverlays`
Supported by Flutter Fix: yes
In v2.3, `SystemChrome.setEnabledSystemUIOVerlays`, the static method for
setting device system level overlays like status and navigation bars, was
deprecated in favor of `SystemChrome.setEnabledSystemUIMode`.
This change allowed for setting up common fullscreen modes that match native
Android app designs like edge to edge.
Manually setting overlays, instead of choosing a specific mode, is still
supported through `SystemUiMode.manual`, allowing developers to pass the same
list of overlays as before.
**Migration guide**
Code before migration:
```dart
SystemChrome.setEnabledSystemUIOverlays(<SystemUiOverlay>[
SystemUiOverlay.top,
SystemUiOverlay.bottom,
]);
```
Code after migration:
```dart
SystemChrome.setEnabledSystemUIMode(
SystemUiMode.manual,
overlays: <SystemUiOverlay>[
SystemUiOverlay.top,
SystemUiOverlay.bottom,
],
);
```
**References**
API documentation:
* [`SystemChrome`][]
Relevant issues:
* [#35748][]
* [#40974][]
* [#44033][]
* [#63761][]
* [#69999][]
Deprecated in:
* [#81303][]
Removed in:
* [#11957][]
[`SystemChrome`]: {{site.api}}/flutter/services/SystemChrome-class.html
[#35748]: {{site.repo.flutter}}/pull/35748
[#40974]: {{site.repo.flutter}}/pull/40974
[#44033]: {{site.repo.flutter}}/pull/44033
[#63761]: {{site.repo.flutter}}/pull/63761
[#69999]: {{site.repo.flutter}}/pull/69999
[#81303]: {{site.repo.flutter}}/pull/81303
[#11957]: {{site.repo.flutter}}/pull/11957
---
### `SystemNavigator.routeUpdated`
Supported by Flutter Fix: yes
In v2.3, `SystemNavigator.routeUpdated` was deprecated in favor of
`SystemNavigator.routeInformationUpdated`.
Instead of having two ways to update the engine about the current route, the
change moved everything to one API, which separately selects the single-entry
history mode if a `Navigator` that reports routes is created.
**Migration guide**
Code before migration:
```dart
SystemNavigator.routeUpdated(routeName: 'foo', previousRouteName: 'bar');
```
Code after migration:
```dart
SystemNavigator.routeInformationUpdated(location: 'foo');
```
**References**
API documentation:
* [`SystemNavigator`][]
Relevant issues:
* [#82574][]
Deprecated in:
* [#82594][]
Removed in:
* [#119187][]
[`SystemNavigator`]: {{site.api}}/flutter/services/SystemNavigator-class.html
[#82594]: {{site.repo.flutter}}/pull/82594
[#82574]: {{site.repo.flutter}}/pull/82574
[#119187]: {{site.repo.flutter}}/pull/119187
---
### `AnimatedSize.vsync`
Supported by Flutter Fix: yes
In v2.2, `AnimatedSize.vsyc` was deprecated. This property was no longer
necessary after `AnimatedSize` was converted to a `StatefulWidget` whose `State`
mixed in `SingleTickerProviderStateMixin`. The change was made to fix a memory
leak.
Uses of `vsync` should be removed, as `AnimatedSize` now handles this property.
**Migration guide**
Code before migration:
```dart
AnimatedSize(
vsync: this,
// ...
);
```
Code after migration:
```dart
AnimatedSize(
// ...
);
```
**References**
API documentation:
* [`AnimatedSize`][]
Deprecated in:
* [#80554][]
* [#81067][]
Removed in:
* [#119186][]
[`AnimatedSize`]: {{site.api}}/flutter/widgets/AnimatedSize-class.html
[#80554]: {{site.repo.flutter}}/pull/80554
[#81067]: {{site.repo.flutter}}/pull/81067
[#119186]: {{site.repo.flutter}}/pull/119186
---
## Timeline
In stable release: TBD
| website/src/release/breaking-changes/3-7-deprecations.md/0 | {
"file_path": "website/src/release/breaking-changes/3-7-deprecations.md",
"repo_id": "website",
"token_count": 4529
} | 1,492 |
---
title: Container with color optimization
description: >
A container with a color and no other background decoration
no longer builds the same child widgets.
---
## Summary
A new `ColoredBox` widget has been added to the framework,
and the `Container` widget has been optimized to use it
if a user specifies a `color` instead of a `decoration`.
## Context
It is very common to use the `Container` widget as follows:
```dart
return Container(color: Colors.red);
```
Previously, this code resulted in a widget hierarchy that used a
`BoxDecoration` to actually paint the background color.
The `BoxDecoration` widget covers many cases other than
just painting a background color,
and is not as efficient as the new `ColoredBox` widget,
which only paints a background color.
Widget tests that wanted to assert based on the color
of a container in the widget tree would previously have
to find the `BoxDecoration` to actually get
the color of the container.
Now, they are able to check the `color` property
on the `Container` itself, unless a `BoxDecoration`
was explicitly provided as the `decoration` property.
It is still an error to supply both `color` and
`decoration` to `Container`.
## Migration guide
Tests that assert on the color of a `Container`
or that expected it to create a
`BoxDecoration` need to be modified.
Code before migration:
```dart
testWidgets('Container color', (WidgetTester tester) async {
await tester.pumpWidget(Container(color: Colors.red));
final Container container = tester.widgetList<Container>().first;
expect(container.decoration.color, Colors.red);
// Or, a test may have specifically looked for the BoxDecoration, e.g.:
expect(find.byType(BoxDecoration), findsOneWidget);
});
```
Code after migration:
```dart
testWidgets('Container color', (WidgetTester tester) async {
await tester.pumpWidget(Container(color: Colors.red));
final Container container = tester.widgetList<Container>().first;
expect(container.color, Colors.red);
// If your test needed to work directly with the BoxDecoration, it should
// instead look for the ColoredBox, e.g.:
expect(find.byType(BoxDecoration), findsNothing);
expect(find.byType(ColoredBox), findsOneWidget);
});
```
## Timeline
Landed in version: 1.15.4<br>
In stable release: 1.17
## References
API documentation:
* [`Container`][]
* [`ColoredBox`][]
* [`BoxDecoration`][]
Relevant issues:
* [Issue 9672][]
* [Issue 28753][]
Relevant PR:
* [Colored box and container optimization #50979][]
[`Container`]: {{site.api}}/flutter/widgets/Container-class.html
[`ColoredBox`]: {{site.api}}/flutter/widgets/ColoredBox-class.html
[`BoxDecoration`]: {{site.api}}/flutter/painting/BoxDecoration-class.html
[Issue 9672]: {{site.repo.flutter}}/issues/9672
[Issue 28753]: {{site.repo.flutter}}/issues/28753
[Colored box and container optimization #50979]: {{site.repo.flutter}}/pull/50979
| website/src/release/breaking-changes/container-color.md/0 | {
"file_path": "website/src/release/breaking-changes/container-color.md",
"repo_id": "website",
"token_count": 863
} | 1,493 |
---
title: Deprecated imperative apply of Flutter's Gradle plugins
description: >
How to migrate your Flutter app's Android Gradle build files to the
new, declarative format.
---
## Summary
To build a Flutter app for Android, Flutter's Gradle plugins must be applied.
Historically, this was done imperatively with Gradle's
[legacy, imperative apply script method][].
In Flutter 3.16, support was added for applying these plugins with Gradle's
[declarative plugins {} block][] (also called the Plugin DSL) and it is
now the recommended approach. Since Flutter 3.16, projects generated with
`flutter create` use the Plugin DSL to apply Gradle plugins. Projects created
with versions of Flutter prior to 3.16 need to be migrated manually.
Applying Gradle plugins using the `plugins {}` block executes the same code as
before and should produce equivalent app binaries.
To learn about advantages the new Plugin DSL syntax has over the legacy `apply`
script syntax, see [Gradle docs][plugins block].
Migrating the app ecosystem to use the new approach will also make it easier for
Flutter team to develop Flutter's Gradle plugins, and to enable exciting new
features in the future, such as using Kotlin instead of Groovy in Gradle
buildscripts.
## Migrate
### android/settings.gradle
First, find the values of the Android Gradle Plugin (AGP) and Kotlin that the project currently
uses. Unless they have been moved, they are likely defined in the buildscript block of the
`<app-src>/android/build.gradle` file. As an example, consider the `build.gradle` file from
a new Flutter app created before this change:
```gradle
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
```
The AGP version is the number that comes at the end of the line
`classpath 'com.android.tools.build:gradle:7.3.0'`, so `7.3.0`
in this case. Similarly, the kotlin version comes at the end of the line
`ext.kotlin_version = '1.7.10'`, in this case `1.7.10`.
Next, replace the contents of `<app-src>/android/settings.gradle` with the below,
remembering to replace `{agpVersion}` and `{kotlinVersion}` with previously
identified values:
```gradle
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "{agpVersion}" apply false
id "org.jetbrains.kotlin.android" version "{kotlinVersion}" apply false
}
include ":app"
```
If you made some changes to this file, make sure they're placed after
`pluginManagement {}` and `plugins {}` blocks, since Gradle enforces that no
other code may be placed before these blocks.
### android/build.gradle
Remove the whole `buildscript` block from `<app-src/android/build.gradle`:
```diff
-buildscript {
- ext.kotlin_version = '{kotlinVersion}'
- repositories {
- google()
- mavenCentral()
- }
-
- dependencies {
- classpath "org.jetbrains.kotlin:gradle-plugin:$kotlin_version"
- }
-}
```
Here's how that file will likely end up:
```gradle
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
```
### android/app/build.gradle
Most changes have to be made in the `<app-src>/android/app/build.gradle`. First,
remove these 2 chunks of code that use the legacy imperative apply method:
```diff
-def flutterRoot = localProperties.getProperty('flutter.sdk')
-if (flutterRoot == null) {
- throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
-}
```
```diff
-apply plugin: 'com.android.application'
-apply plugin: 'com.jetbrains.kotlin.android'
-apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
```
Now apply the plugins again, but this time using the Plugin DSL syntax. At the
very top of your file, add:
```diff
+plugins {
+ id "com.android.application"
+ id "kotlin-android"
+ id "dev.flutter.flutter-gradle-plugin"
+}
```
### Validation
Execute `flutter run` to confirm your app builds and launches on a connected
Android device or emulator.
## Examples
### Google Mobile Services and Crashlytics
If your app was using Google Mobile Services and Crashlytics, remove the
following lines from `<app-src>/android/build.gradle`:
```diff
buildscript {
// ...
dependencies {
// ...
- classpath "com.google.gms:google-services:4.4.0"
- classpath "com.google.firebase:firebase-crashlytics-gradle:2.9.9"
}
}
```
and remove these 2 lines from `<app-src>/android/app/build.gradle`:
```diff
-apply plugin: 'com.google.gms.google-services'
-apply plugin: 'com.google.firebase.crashlytics'
```
To migrate to the new, declarative apply of the GMS and Crashlytics plugins, add
the following lines to `<app-src>/android/settings.gradle`:
```diff
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "{agpVersion}" apply false
id "org.jetbrains.kotlin.android" version "{kotlinVersion}" apply false
+ id "com.google.gms.google-services" version "4.4.0" apply false
+ id "com.google.firebase.crashlytics" version "2.9.9" apply false
}
```
and the following lines to `<app-src>/android/app/build.gradle`:
```diff
plugins {
id "com.android.application"
id "dev.flutter.flutter-gradle-plugin"
id "org.jetbrains.kotlin.android"
+ id "com.google.gms.google-services"
+ id "com.google.firebase.crashlytics"
}
```
## Timeline
Support in stable release: 3.16.0
Recommended in stable release: 3.19.0
## References
Gradle build files generated by `flutter create` differ across Flutter versions.
For a detailed overview, see [issue #135392][]. You should consider using the
latest versions of build files.
[legacy, imperative apply script method]: https://docs.gradle.org/8.5/userguide/plugins.html#sec:script_plugins
[declarative plugins {} block]: https://docs.gradle.org/8.5/userguide/plugins.html#sec:plugins_block
[plugins block]: https://docs.gradle.org/current/userguide/plugins.html#plugins_dsl_limitations
[issue #135392]: https://github.com/flutter/flutter/issues/135392
| website/src/release/breaking-changes/flutter-gradle-plugin-apply.md/0 | {
"file_path": "website/src/release/breaking-changes/flutter-gradle-plugin-apply.md",
"repo_id": "website",
"token_count": 2532
} | 1,494 |
---
title: LayoutBuilder optimization
description: >
LayoutBuilder and SliverLayoutBuilder call the builder function less often.
---
## Summary
This guide explains how to migrate Flutter applications after
[the LayoutBuilder optimization][1].
## Context
[LayoutBuilder][2] and [SliverLayoutBuilder][3] call
the [builder][4] function more often than necessary to
fulfill their primary goal of allowing apps to adapt their
widget structure to parent layout constraints.
This has led to less efficient and jankier applications
because widgets are rebuilt unnecessarily.
This transitively affects [OrientationBuilder][5] as well.
In order to improve app performance
the [LayoutBuilder optimization][1] was made,
which results in calling the `builder` function less often.
Apps that rely on this function to be called with a certain frequency may break.
The app may exhibit some combination of the following symptoms:
* The `builder` function is not called when it would before the upgrade to the
Flutter version that introduced the optimization.
* The UI of a widget is missing.
* The UI of a widget is not updating.
## Description of change
Prior to the optimization the builder function passed to `LayoutBuilder` or
`SliverLayoutBuilder` was called when any one of the following happened:
1. `LayoutBuilder` is rebuilt due to a widget configuration change
(this typically happens when the widget that uses `LayoutBuilder` rebuilds
due to `setState`, `didUpdateWidget` or `didChangeDependencies`).
1. `LayoutBuilder` is laid out and receives layout constraints from its parent
that are _different_ from the last received constraints.
1. `LayoutBuilder` is laid out and receives layout constraints from its parent
that are the _same_ as the constraints received last time.
After the optimization the builder function is no longer called in the latter
case. If the constraints are the same and the widget configuration did not
change, the builder function is not called.
Your app can break if it relies on the relayout to cause the rebuilding of the
`LayoutBuilder` rather than on an explicit call to `setState`. This usually
happens by accident. You meant to add `setState`, but you forgot because the app
continued functioning as you wanted, and therefore nothing reminded you to add
it.
## Migration guide
Look for usages of `LayoutBuilder` and `SliverLayoutBuilder` and make sure to
call `setState` any time the widget state changes.
**Example**: in the example below the contents of the builder function depend
on the value of the `_counter` field. Therefore, whenever the value is updated,
you should call `setState` to tell the framework to rebuild the widget. However,
this example may have previously worked even without calling `setState`, if the
`_ResizingBox` triggers a relayout of `LayoutBuilder`.
Code before migration (note the missing `setState` inside the `onPressed`
callback):
```dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
home: Counter(),
);
}
}
class Counter extends StatefulWidget {
Counter({Key key}) : super(key: key);
@override
_CounterState createState() => _CounterState();
}
class _CounterState extends State<Counter> {
int _counter = 0;
@override
Widget build(BuildContext context) {
return Center(child: Container(
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return _ResizingBox(
TextButton(
onPressed: () {
_counter++;
},
child: Text('Increment Counter')),
Text(_counter.toString()),
);
},
),
));
}
}
class _ResizingBox extends StatefulWidget {
_ResizingBox(this.child1, this.child2);
final Widget child1;
final Widget child2;
@override
State<StatefulWidget> createState() => _ResizingBoxState();
}
class _ResizingBoxState extends State<_ResizingBox>
with SingleTickerProviderStateMixin {
Animation animation;
@override
void initState() {
super.initState();
animation = AnimationController(
vsync: this,
duration: const Duration(minutes: 1),
)
..forward()
..addListener(() {
setState(() {});
});
}
@override
Widget build(BuildContext context) {
return Row(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
width: 100 + animation.value * 100,
child: widget.child1,
),
SizedBox(
width: 100 + animation.value * 100,
child: widget.child2,
),
],
);
}
}
```
Code after migration (`setState` added to `onPressed`):
```dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
home: Counter(),
);
}
}
class Counter extends StatefulWidget {
Counter({Key key}) : super(key: key);
@override
_CounterState createState() => _CounterState();
}
class _CounterState extends State<Counter> {
int _counter = 0;
@override
Widget build(BuildContext context) {
return Center(child: Container(
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return _ResizingBox(
TextButton(
onPressed: () {
setState(() {
_counter++;
});
},
child: Text('Increment Counter')),
Text(_counter.toString()),
);
},
),
));
}
}
class _ResizingBox extends StatefulWidget {
_ResizingBox(this.child1, this.child2);
final Widget child1;
final Widget child2;
@override
State<StatefulWidget> createState() => _ResizingBoxState();
}
class _ResizingBoxState extends State<_ResizingBox>
with SingleTickerProviderStateMixin {
Animation animation;
@override
void initState() {
super.initState();
animation = AnimationController(
vsync: this,
duration: const Duration(minutes: 1),
)
..forward()
..addListener(() {
setState(() {});
});
}
@override
Widget build(BuildContext context) {
return Row(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
width: 100 + animation.value * 100,
child: widget.child1,
),
SizedBox(
width: 100 + animation.value * 100,
child: widget.child2,
),
],
);
}
}
```
Watch for usages of `Animation` and `LayoutBuilder` in the same widget.
Animations have internal mutable state that changes on every frame. If the
logic of your builder function depends on the value of the animation, it may
require a `setState` to update in tandem with the animation. To do that, add an
[animation listener][7] that calls `setState`, like so:
```dart
Animation animation = … create animation …;
animation.addListener(() {
setState(() {
// Intentionally empty. The state is inside the animation object.
});
});
```
## Timeline
This change was released in Flutter v1.20.0.
## References
API documentation:
* [`LayoutBuilder`][2]
* [`SliverLayoutBuilder`][3]
Relevant issue:
* [Issue 6469][8]
Relevant PR:
* [LayoutBuilder: skip calling builder when constraints are the same][6]
[1]: /go/layout-builder-optimization
[2]: {{site.api}}/flutter/widgets/LayoutBuilder-class.html
[3]: {{site.api}}/flutter/widgets/SliverLayoutBuilder-class.html
[4]: {{site.api}}/flutter/widgets/LayoutBuilder/builder.html
[5]: {{site.api}}/flutter/widgets/OrientationBuilder-class.html
[6]: {{site.repo.flutter}}/pull/55414
[7]: {{site.api}}/flutter/animation/Animation/addListener.html
[8]: {{site.repo.flutter}}/issues/6469
| website/src/release/breaking-changes/layout-builder-optimization.md/0 | {
"file_path": "website/src/release/breaking-changes/layout-builder-optimization.md",
"repo_id": "website",
"token_count": 2837
} | 1,495 |
---
title: Make PageView.controller nullable
description: >-
PageView.controller is now nullable.
---
## Summary
If a controller isn't provided in the constructor,
the `controller` member is `null`. This makes
`PageView` and its `controller` property consistent with other widgets.
## Migration guide
Before:
```dart
pageView.controller.page
```
After:
```dart
pageView.controller!.page
```
## Timeline
Landed in version: 3.19.0-12.0.pre<br>
In stable release: Not yet
## References
Relevant issues:
* [PageView uses global controller, that is never disposed. (Issue 141119)][]
[PageView uses global controller, that is never disposed. (Issue 141119)]: {{site.repo.flutter}}/issues/141119
| website/src/release/breaking-changes/pageview-controller.md/0 | {
"file_path": "website/src/release/breaking-changes/pageview-controller.md",
"repo_id": "website",
"token_count": 220
} | 1,496 |
---
title: Scrollable AlertDialog (No longer deprecated)
description: AlertDialog should scroll automatically when it overflows.
---
## Summary
{{site.alert.note}}
`AlertDialog.scrollable` is no longer deprecated because there is
no backwards-compatible way to make `AlertDialog` scrollable by default.
Instead, the parameter will remain and you can set `scrollable`
to true if you want a scrollable `AlertDialog`.
{{site.alert.end}}
An `AlertDialog` now scrolls automatically when it overflows.
## Context
Before this change,
when an `AlertDialog` widget's contents were too tall,
the display overflowed, causing the contents to be clipped.
This resulted in the following issues:
* There was no way to view the portion of the content that was clipped.
* Most alert dialogs have buttons beneath the content to prompt users for
actions. If the content overflowed, obscuring the buttons,
users might be unaware of their existence.
## Description of change
The previous approach listed the title and content
widgets consecutively in a `Column` widget.
```dart
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
if (title != null)
Padding(
padding: titlePadding ?? EdgeInsets.fromLTRB(24, 24, 24, content == null ? 20 : 0),
child: DefaultTextStyle(
style: titleTextStyle ?? dialogTheme.titleTextStyle ?? theme.textTheme.title,
child: Semantics(
child: title,
namesRoute: true,
container: true,
),
),
),
if (content != null)
Flexible(
child: Padding(
padding: contentPadding,
child: DefaultTextStyle(
style: contentTextStyle ?? dialogTheme.contentTextStyle ?? theme.textTheme.subhead,
child: content,
),
),
),
// ...
],
);
```
The new approach wraps both widgets in a
`SingleChildScrollView` above the button bar,
making both widgets part of the same scrollable
and exposing the button bar at the bottom of the dialog.
```dart
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
if (title != null || content != null)
SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
if (title != null)
titleWidget,
if (content != null)
contentWidget,
],
),
),
// ...
],
),
```
## Migration guide
You might see the following issues as a result of this change:
**Semantics tests might fail because of the addition of a `SingleChildScrollView`.**
: Manual testing of the `Talkback` and `VoiceOver` features
show that they still exhibit the same (correct)
behavior as before.
**Golden tests might fail.**
: This change might have caused diffs in (previously passing)
golden tests since the `SingleChildScrollView` now nests both the
title and content widgets.
Some Flutter projects have taken to creating semantics tests
by taking goldens of semantics nodes used in Flutter's debug build.
<br>Any semantics golden updates that reflect the scrolling
container addition are expected and these diffs should be safe to accept.
Sample resulting Semantics tree:
```
flutter: ├─SemanticsNode#30 <-- SingleChildScrollView
flutter: │ flags: hasImplicitScrolling
flutter: │ scrollExtentMin: 0.0
flutter: │ scrollPosition: 0.0
flutter: │ scrollExtentMax: 0.0
flutter: │
flutter: ├─SemanticsNode#31 <-- title
flutter: │ flags: namesRoute
flutter: │ label: "Hello"
flutter: │
flutter: └─SemanticsNode#32 <-- contents
flutter: label: "Huge content"
```
**Layout changes might result because of the scroll view.**
: If the dialog was already overflowing,
this change corrects the problem.
This layout change is expected.
<br>A nested `SingleChildScrollView` in `AlertDialog.content`
should work properly if left in the code,
but should be removed if unintended, since
it might cause confusion.
Code before migration:
```dart
AlertDialog(
title: Text(
'Very, very large title that is also scrollable',
textScaleFactor: 5,
),
content: SingleChildScrollView( // won't be scrollable
child: Text('Scrollable content', textScaleFactor: 5),
),
actions: <Widget>[
TextButton(child: Text('Button 1'), onPressed: () {}),
TextButton(child: Text('Button 2'), onPressed: () {}),
],
)
```
Code after migration:
```dart
AlertDialog(
title: Text('Very, very large title', textScaleFactor: 5),
content: Text('Very, very large content', textScaleFactor: 5),
actions: <Widget>[
TextButton(child: Text('Button 1'), onPressed: () {}),
TextButton(child: Text('Button 2'), onPressed: () {}),
],
)
```
## Timeline
Landed in version: 1.16.3<br>
In stable release: 1.17
## References
Design doc:
* [Scrollable `AlertDialog`][]
API documentation:
* [`AlertDialog`][]
Relevant issue:
* [Overflow exceptions with maximum accessibility font size][]
Relevant PRs:
* [Update to `AlertDialog.scrollable`][]
* [Original attempt to implement scrollable `AlertDialog`][]
* [Revert of original attempt to implement scrollable `AlertDialog`][]
[`AlertDialog`]: {{site.api}}/flutter/material/AlertDialog-class.html
[Original attempt to implement scrollable `AlertDialog`]: {{site.repo.flutter}}/pull/43226
[Overflow exceptions with maximum accessibility font size]: {{site.repo.flutter}}/issues/42696
[Revert of original attempt to implement scrollable `AlertDialog`]: {{site.repo.flutter}}/pull/44003
[Scrollable `AlertDialog`]: /go/scrollable-alert-dialog
[Update to `AlertDialog.scrollable`]: {{site.repo.flutter}}/pull/45079
| website/src/release/breaking-changes/scrollable-alert-dialog.md/0 | {
"file_path": "website/src/release/breaking-changes/scrollable-alert-dialog.md",
"repo_id": "website",
"token_count": 2000
} | 1,497 |
---
title: Trackpad gestures can trigger GestureRecognizer
description: >
Trackpad gestures on most platforms now send `PointerPanZoom` sequences and
can trigger pan, drag, and scale `GestureRecognizer` callbacks.
---
## Summary
Trackpad gestures on most platforms now send `PointerPanZoom` sequences and
can trigger pan, drag, and scale `GestureRecognizer` callbacks.
## Context
Scrolling on Flutter Desktop prior to version 3.3.0 used `PointerScrollEvent`
messages to represent discrete scroll deltas. This system worked well for mouse
scroll wheels, but wasn't a good fit for trackpad scrolling. Trackpad scrolling
is expected to cause momentum, which depends not only on the scroll deltas, but
also the timing of when fingers are released from the trackpad.
In addition, trackpad pinching-to-zoom could not be represented.
Three new `PointerEvent`s have been introduced: `PointerPanZoomStartEvent`,
`PointerPanZoomUpdateEvent`, and `PointerPanZoomEndEvent`.
Relevant `GestureRecognizer`s have been updated to register interest in
trackpad gesture sequences, and will emit `onDrag`, `onPan`, and/or
`onScale` callbacks in response to movements
of two or more fingers on the trackpad.
This means both that code designed only for touch interactions might trigger upon
trackpad interaction, and that code designed to handle all desktop scrolling
might now only trigger upon mouse scrolling, and not trackpad scrolling.
## Description of change
The Flutter engine has been updated on all possible platforms to recognize
trackpad gestures and send them to the framework as `PointerPanZoom` events
instead of as `PointerScrollSignal` events. `PointerScrollSignal` events will
still be used to represent scrolling on a mouse wheel.
Depending on the platform and specific trackpad model, the new system might not
be used, if not enough data is provided to the Flutter engine by platform APIs.
This includes on Windows, where trackpad gesture support is dependent on the
trackpad's driver, and the Web platform, where not enough data is provided by
browser APIs, and trackpad scrolling must still
use the old `PointerScrollSignal` system.
Developers should be prepared to receive both types of events and
ensure their apps or packages handle them in the appropriate manner.
`Listener` now has three new callbacks: `onPointerPanZoomStart`,
`onPointerPanZoomUpdate`, and `onPointerPanZoomEnd` which can
be used to observe trackpad scrolling and zooming events.
```dart
void main() => runApp(Foo());
class Foo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Listener(
onPointerSignal: (PointerSignalEvent event) {
if (event is PointerScrollEvent) {
debugPrint('mouse scrolled ${event.scrollDelta}');
}
},
onPointerPanZoomStart: (PointerPanZoomStartEvent event) {
debugPrint('trackpad scroll started');
},
onPointerPanZoomUpdate: (PointerPanZoomUpdateEvent event) {
debugPrint('trackpad scrolled ${event.panDelta}');
},
onPointerPanZoomEnd: (PointerPanZoomEndEvent event) {
debugPrint('trackpad scroll ended');
},
child: Container()
);
}
}
```
`PointerPanZoomUpdateEvent` contains a `pan` field to represent the cumulative
pan of the current gesture, a `panDelta` field to represent the difference in
pan since the last event, a `scale` event to represent the cumulative zoom
of the current gesture, and a `rotation` event to
represent the cumulative rotation (in radians) of the current gesture.
`GestureRecognizer`s now have methods to all the trackpad events from one
continuous trackpad gesture. Calling the `addPointerPanZoom` method on a
`GestureRecognizer` with a `PointerPanZoomStartEvent` will cause the recognizer
to register its interest in that trackpad interaction, and resolve conflicts
between multiple `GestureRecognizer`s that could potentially respond to the
gesture.
The following example shows the proper use of `Listener` and `GestureRecognizer`
to respond to trackpad interactions.
```dart
void main() => runApp(Foo());
class Foo extends StatefulWidget {
late final PanGestureRecognizer recognizer;
@override
void initState() {
super.initState();
recognizer = PanGestureRecognizer()
..onStart = _onPanStart
..onUpdate = _onPanUpdate
..onEnd = _onPanEnd;
}
void _onPanStart(DragStartDetails details) {
debugPrint('onStart');
}
void _onPanUpdate(DragUpdateDetails details) {
debugPrint('onUpdate');
}
void _onPanEnd(DragEndDetails details) {
debugPrint('onEnd');
}
@override
Widget build(BuildContext context) {
return Listener(
onPointerDown: recognizer.addPointer,
onPointerPanZoomStart: recognizer.addPointerPanZoom,
child: Container()
);
}
}
```
When using `GestureDetector`, this is done automatically, so code such as the
following example will issue its gesture update callbacks in response to both
touch and trackpad panning.
```dart
void main() => runApp(Foo());
class Foo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
onPanStart: (details) {
debugPrint('onStart');
},
onPanUpdate: (details) {
debugPrint('onUpdate');
},
onPanEnd: (details) {
debugPrint('onEnd');
}
child: Container()
);
}
}
```
## Migration guide
Migration steps depend on whether you want each gesture interaction in your
app to be usable via a trackpad, or whether it should be restricted to only
touch and mouse usage.
### For gesture interactions suitable for trackpad usage
#### Using `GestureDetector`
No change is needed, `GestureDetector` automatically processes trackpad
gesture events and triggers callbacks if recognized.
#### Using `GestureRecognizer` and `Listener`
Ensure that `onPointerPanZoomStart` is passed through to
each recognizer from the `Listener`.
The `addPointerPanZoom` method of `GestureRecognizer must be called
for it to show interest and start tracking each trackpad gesture.
Code before migration:
```dart
void main() => runApp(Foo());
class Foo extends StatefulWidget {
late final PanGestureRecognizer recognizer;
@override
void initState() {
super.initState();
recognizer = PanGestureRecognizer()
..onStart = _onPanStart
..onUpdate = _onPanUpdate
..onEnd = _onPanEnd;
}
void _onPanStart(DragStartDetails details) {
debugPrint('onStart');
}
void _onPanUpdate(DragUpdateDetails details) {
debugPrint('onUpdate');
}
void _onPanEnd(DragEndDetails details) {
debugPrint('onEnd');
}
@override
Widget build(BuildContext context) {
return Listener(
onPointerDown: recognizer.addPointer,
child: Container()
);
}
}
```
Code after migration:
```dart
void main() => runApp(Foo());
class Foo extends StatefulWidget {
late final PanGestureRecognizer recognizer;
@override
void initState() {
super.initState();
recognizer = PanGestureRecognizer()
..onStart = _onPanStart
..onUpdate = _onPanUpdate
..onEnd = _onPanEnd;
}
void _onPanStart(DragStartDetails details) {
debugPrint('onStart');
}
void _onPanUpdate(DragUpdateDetails details) {
debugPrint('onUpdate');
}
void _onPanEnd(DragEndDetails details) {
debugPrint('onEnd');
}
@override
Widget build(BuildContext context) {
return Listener(
onPointerDown: recognizer.addPointer,
onPointerPanZoomStart: recognizer.addPointerPanZoom,
child: Container()
);
}
}
```
#### Using raw `Listener`
The following code using PointerScrollSignal will no longer be called upon all
desktop scrolling. `PointerPanZoomUpdate` events should be captured to receive
trackpad gesture data.
Code before migration:
```dart
void main() => runApp(Foo());
class Foo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Listener(
onPointerSignal: (PointerSignalEvent event) {
if (event is PointerScrollEvent) {
debugPrint('scroll wheel event');
}
}
child: Container()
);
}
}
```
Code after migration:
```dart
void main() => runApp(Foo());
class Foo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Listener(
onPointerSignal: (PointerSignalEvent event) {
if (event is PointerScrollEvent) {
debugPrint('scroll wheel event');
}
},
onPointerPanZoomUpdate: (PointerPanZoomUpdateEvent event) {
debugPrint('trackpad scroll event');
}
child: Container()
);
}
}
```
Please note: Use of raw `Listener` in this way could
cause conflicts with other gesture interactions as it
doesn't participate in the gesture disambiguation arena.
### For gesture interactions not suitable for trackpad usage
#### Using `GestureDetector`
If using Flutter 3.3.0, `RawGestureDetector` could be used
instead of `GestureDetector` to ensure each `GestureRecognizer` created
by the `GestureDetector` has `supportedDevices` set to
exclude `PointerDeviceKind.trackpad`.
Starting in version 3.4.0, there is a `supportedDevices` parameter
directly on `GestureDetector`.
Code before migration:
```dart
void main() => runApp(Foo());
class Foo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
onPanStart: (details) {
debugPrint('onStart');
},
onPanUpdate: (details) {
debugPrint('onUpdate');
},
onPanEnd: (details) {
debugPrint('onEnd');
}
child: Container()
);
}
}
```
Code after migration (Flutter 3.3.0):
```dart
// Example of code after the change.
void main() => runApp(Foo());
class Foo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RawGestureDetector(
gestures: {
PanGestureRecognizer:
GestureRecognizerFactoryWithHandlers<PanGestureRecognizer>(
() => PanGestureRecognizer(
supportedDevices: {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
PointerDeviceKind.stylus,
PointerDeviceKind.invertedStylus,
// Do not include PointerDeviceKind.trackpad
}
),
(recognizer) {
recognizer
..onStart = (details) {
debugPrint('onStart');
}
..onUpdate = (details) {
debugPrint('onUpdate');
}
..onEnd = (details) {
debugPrint('onEnd');
};
},
),
},
child: Container()
);
}
}
```
Code after migration: (Flutter 3.4.0):
```dart
void main() => runApp(Foo());
class Foo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
supportedDevices: {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
PointerDeviceKind.stylus,
PointerDeviceKind.invertedStylus,
// Do not include PointerDeviceKind.trackpad
},
onPanStart: (details) {
debugPrint('onStart');
},
onPanUpdate: (details) {
debugPrint('onUpdate');
},
onPanEnd: (details) {
debugPrint('onEnd');
}
child: Container()
);
}
}
```
#### Using `RawGestureRecognizer`
Explicitly ensure that `supportedDevices`
doesn't include `PointerDeviceKind.trackpad`.
Code before migration:
```dart
void main() => runApp(Foo());
class Foo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RawGestureDetector(
gestures: {
PanGestureRecognizer:
GestureRecognizerFactoryWithHandlers<PanGestureRecognizer>(
() => PanGestureRecognizer(),
(recognizer) {
recognizer
..onStart = (details) {
debugPrint('onStart');
}
..onUpdate = (details) {
debugPrint('onUpdate');
}
..onEnd = (details) {
debugPrint('onEnd');
};
},
),
},
child: Container()
);
}
}
```
Code after migration:
```dart
// Example of code after the change.
void main() => runApp(Foo());
class Foo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RawGestureDetector(
gestures: {
PanGestureRecognizer:
GestureRecognizerFactoryWithHandlers<PanGestureRecognizer>(
() => PanGestureRecognizer(
supportedDevices: {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
PointerDeviceKind.stylus,
PointerDeviceKind.invertedStylus,
// Do not include PointerDeviceKind.trackpad
}
),
(recognizer) {
recognizer
..onStart = (details) {
debugPrint('onStart');
}
..onUpdate = (details) {
debugPrint('onUpdate');
}
..onEnd = (details) {
debugPrint('onEnd');
};
},
),
},
child: Container()
);
}
}
```
#### Using `GestureRecognizer` and `Listener`
After upgrading to Flutter 3.3.0, there won't be a change in behavior, as
`addPointerPanZoom` must be called on each `GestureRecognizer` to allow
it to track gestures. The following code won't receive pan gesture callbacks
when the trackpad is scrolled:
```dart
void main() => runApp(Foo());
class Foo extends StatefulWidget {
late final PanGestureRecognizer recognizer;
@override
void initState() {
super.initState();
recognizer = PanGestureRecognizer()
..onStart = _onPanStart
..onUpdate = _onPanUpdate
..onEnd = _onPanEnd;
}
void _onPanStart(DragStartDetails details) {
debugPrint('onStart');
}
void _onPanUpdate(DragUpdateDetails details) {
debugPrint('onUpdate');
}
void _onPanEnd(DragEndDetails details) {
debugPrint('onEnd');
}
@override
Widget build(BuildContext context) {
return Listener(
onPointerDown: recognizer.addPointer,
// recognizer.addPointerPanZoom is not called
child: Container()
);
}
}
```
## Timeline
Landed in version: 3.3.0-0.0.pre
In stable release: 3.3.0
## References
API documentation:
* [`GestureDetector`][]
* [`RawGestureDetector`][]
* [`GestureRecognizer`][]
Design document:
* [Flutter Trackpad Gestures][]
Relevant issues:
* [Issue 23604][]
Relevant PRs:
* [Support trackpad gestures in framework][]
* [iPad trackpad gestures][]
* [Linux trackpad gestures][]
* [Mac trackpad gestures][]
* [Win32 trackpad gestures][]
* [ChromeOS/Android trackpad gestures][]
[`GestureDetector`]: {{site.api}}/flutter/widgets/GestureDetector-class.html
[`GestureRecognizer`]: {{site.api}}/flutter/gestures/GestureRecognizer-class.html
[`RawGestureDetector`]: {{site.api}}/flutter/widgets/RawGestureDetector-class.html
[Flutter Trackpad Gestures]: https://docs.google.com/document/d/1oRvebwjpsC3KlxN1gOYnEdxtNpQDYpPtUFAkmTUe-K8
[Issue 23604]: {{site.repo.flutter}}/issues/23604
[Support trackpad gestures in framework]: {{site.repo.flutter}}/pull/89944
[iPad trackpad gestures]: {{site.repo.engine}}/pull/31591
[Linux trackpad gestures]: {{site.repo.engine}}/pull/31592
[Mac trackpad gestures]: {{site.repo.engine}}/pull/31593
[Win32 trackpad gestures]: {{site.repo.engine}}/pull/31594
[ChromeOS/Android trackpad gestures]: {{site.repo.engine}}/pull/34060
| website/src/release/breaking-changes/trackpad-gestures.md/0 | {
"file_path": "website/src/release/breaking-changes/trackpad-gestures.md",
"repo_id": "website",
"token_count": 5830
} | 1,498 |
---
title: Change log for Flutter 1.9.1
short-title: 1.9.1 change log
description: Change log for Flutter 1.9.1 containing a list of all PRs merged for this release.
---
## PRs closed in this release of flutter/flutter
From Fri Jun 21 22:31:55 2019 -0400 to Sun Aug 18 12:22:00 2019 -0700
[28090](https://github.com/flutter/flutter/pull/28090) Ensure that cache dirs and files have appropriate permissions (cla: yes, tool)
[29489](https://github.com/flutter/flutter/pull/29489) Made a few grammatical changes (cla: yes, team)
[32511](https://github.com/flutter/flutter/pull/32511) Rendering errors with root causes in the widget layer should have a reference to the widget (cla: yes, customer: countless, customer: headline, framework)
[32770](https://github.com/flutter/flutter/pull/32770) Dismiss modal with any button press (a: desktop, cla: yes, framework)
[32816](https://github.com/flutter/flutter/pull/32816) Add initial implementation of flutter assemble (cla: yes, tool)
[33140](https://github.com/flutter/flutter/pull/33140) flutter/tests support (cla: yes, team)
[33281](https://github.com/flutter/flutter/pull/33281) Update TextStyle and StrutStyle height docs (a: typography, cla: yes, d: api docs, framework, severe: API break)
[33688](https://github.com/flutter/flutter/pull/33688) Part 1: Skia Gold Testing (a: tests, cla: yes, framework)
[33936](https://github.com/flutter/flutter/pull/33936) New parameter for RawGestureDetector to customize semantics mapping (cla: yes, f: gestures, framework)
[34019](https://github.com/flutter/flutter/pull/34019) Selectable Text (a: text input, cla: yes, customer: amplify, customer: fuchsia, framework, severe: API break)
[34202](https://github.com/flutter/flutter/pull/34202) Remove `_debugWillReattachChildren` assertions from `_TableElement` (cla: yes, customer: payouts, framework)
[34252](https://github.com/flutter/flutter/pull/34252) Integrate dwds into flutter tool for web support (cla: yes, tool, ☸ platform-web)
[34298](https://github.com/flutter/flutter/pull/34298) Preserving SafeArea : Part 2 (cla: yes, customer: solaris, framework, severe: customer critical, waiting for tree to go green)
[34301](https://github.com/flutter/flutter/pull/34301) Make it possible to override the FLUTTER_TEST env variable (a: tests, cla: yes, customer: mulligan (g3), team, tool)
[34515](https://github.com/flutter/flutter/pull/34515) OutlineInputBorder adjusts for borderRadius that is too large (a: text input, cla: yes, f: material design, framework)
[34516](https://github.com/flutter/flutter/pull/34516) [flutter_tool] Fill in Fuchsia version string (cla: yes, tool)
[34573](https://github.com/flutter/flutter/pull/34573) Ensures flutter jar is added to all build types on plugin projects (cla: yes, t: gradle, tool, waiting for tree to go green)
[34597](https://github.com/flutter/flutter/pull/34597) [Material] Update slider gallery demo, including range slider (cla: yes, f: material design, framework)
[34599](https://github.com/flutter/flutter/pull/34599) [Material] ToggleButtons (cla: yes, f: material design, framework, severe: new feature)
[34624](https://github.com/flutter/flutter/pull/34624) Break down flutter doctor validations and results (cla: yes, t: flutter doctor, tool)
[34626](https://github.com/flutter/flutter/pull/34626) AsyncSnapshot.data to throw if error or no data (cla: yes, framework)
[34660](https://github.com/flutter/flutter/pull/34660) Add --target support for Windows and Linux (cla: yes, tool)
[34665](https://github.com/flutter/flutter/pull/34665) Selection handles position is off (a: text input, cla: yes, framework, severe: API break)
[34669](https://github.com/flutter/flutter/pull/34669) Bundle ios dependencies (cla: yes, tool)
[34676](https://github.com/flutter/flutter/pull/34676) Enable selection by default for password text field and expose api to… (a: text input, cla: yes, f: cupertino, f: material design, framework)
[34712](https://github.com/flutter/flutter/pull/34712) Fix FocusTraversalPolicy makes focus lost (a: desktop, cla: yes, framework)
[34723](https://github.com/flutter/flutter/pull/34723) CupertinoTextField vertical alignment (cla: yes, f: cupertino, framework)
[34752](https://github.com/flutter/flutter/pull/34752) [linux] Receives the unmodified characters obtained from GLFW (a: desktop, cla: yes, framework)
[34785](https://github.com/flutter/flutter/pull/34785) Tweak the display name of emulators (cla: yes, tool)
[34794](https://github.com/flutter/flutter/pull/34794) Add `emulatorID` field to devices in daemon (cla: yes, tool)
[34823](https://github.com/flutter/flutter/pull/34823) Introduce image loading performance test. (a: tests, cla: yes, framework)
[34869](https://github.com/flutter/flutter/pull/34869) [Material] Properly call onChangeStart and onChangeEnd in Range Slider (cla: yes, f: material design, framework)
[34870](https://github.com/flutter/flutter/pull/34870) Add test case for Flutter Issue #27677 as a benchmark. (cla: yes, engine, framework, severe: performance)
[34872](https://github.com/flutter/flutter/pull/34872) [Material] Support for hovered, focused, and pressed border color on `OutlineButton`s (cla: yes, f: material design, framework)
[34877](https://github.com/flutter/flutter/pull/34877) More shards (a: tests, cla: yes, team, waiting for tree to go green)
[34885](https://github.com/flutter/flutter/pull/34885) Reland: rename web device (cla: yes, tool)
[34895](https://github.com/flutter/flutter/pull/34895) Remove flutter_tools support for old AOT snapshotting (cla: yes)
[34896](https://github.com/flutter/flutter/pull/34896) Allow multi-root web builds (cla: yes, tool)
[34906](https://github.com/flutter/flutter/pull/34906) Fix unused [applicationIcon] property on [showLicensePage] (cla: yes, f: material design, framework)
[34907](https://github.com/flutter/flutter/pull/34907) Fixed LicensePage to close page before loaded the License causes an error (cla: yes, f: material design, framework, severe: crash)
[34919](https://github.com/flutter/flutter/pull/34919) Remove duplicate error parts (cla: yes, framework, waiting for tree to go green)
[34932](https://github.com/flutter/flutter/pull/34932) Added onChanged property to TextFormField (cla: yes, f: material design, framework)
[34964](https://github.com/flutter/flutter/pull/34964) CupertinoTextField.onTap (cla: yes, f: cupertino)
[35017](https://github.com/flutter/flutter/pull/35017) sync lint list (cla: yes)
[35046](https://github.com/flutter/flutter/pull/35046) Add generated Icon diagram to api docs (cla: yes, d: api docs, d: examples, framework)
[35055](https://github.com/flutter/flutter/pull/35055) enable lint avoid_bool_literals_in_conditional_expressions (cla: yes)
[35056](https://github.com/flutter/flutter/pull/35056) enable lint use_full_hex_values_for_flutter_colors (cla: yes)
[35059](https://github.com/flutter/flutter/pull/35059) prepare for lint update of prefer_final_fields (cla: yes)
[35063](https://github.com/flutter/flutter/pull/35063) add documentation for conic path not supported (a: platform-views, cla: yes, d: api docs, framework, plugin)
[35066](https://github.com/flutter/flutter/pull/35066) Manual engine roll, Update goldens, improved wavy text decoration 0f9e297ad..185087a65f (a: typography, cla: yes, engine)
[35074](https://github.com/flutter/flutter/pull/35074) Attempt to enable tool coverage redux (a: tests, cla: yes, tool)
[35075](https://github.com/flutter/flutter/pull/35075) Allow for customizing SnackBar's content TextStyle in its theme (cla: yes, f: material design, framework)
[35084](https://github.com/flutter/flutter/pull/35084) Move findTargetDevices to DeviceManager (cla: yes, tool)
[35092](https://github.com/flutter/flutter/pull/35092) Add FlutterProjectFactory so that it can be overridden internally. (cla: yes, tool)
[35110](https://github.com/flutter/flutter/pull/35110) Always test semantics (a: accessibility, a: tests, cla: yes, framework, severe: API break)
[35129](https://github.com/flutter/flutter/pull/35129) [Material] Wrap Flutter Gallery's Expansion Panel Slider in padded Container to make room for Value Indicator. (cla: yes, f: material design, framework, severe: regression)
[35130](https://github.com/flutter/flutter/pull/35130) pass new users for release_smoke_tests (a: tests, cla: yes, team)
[35132](https://github.com/flutter/flutter/pull/35132) Reduce allocations by reusing a matrix for transient transforms in _transformRect (cla: yes)
[35136](https://github.com/flutter/flutter/pull/35136) Update Dark Theme disabledColor to White38 (cla: yes, f: material design, framework, severe: API break)
[35143](https://github.com/flutter/flutter/pull/35143) More HttpClientResponse Uint8List fixes (cla: yes)
[35149](https://github.com/flutter/flutter/pull/35149) More `HttpClientResponse implements Stream<Uint8List>` fixes (cla: yes)
[35150](https://github.com/flutter/flutter/pull/35150) Change didUpdateConfig to didUpdateWidget (cla: yes, d: api docs, framework)
[35157](https://github.com/flutter/flutter/pull/35157) Remove skip clause on tools coverage (cla: yes, team)
[35160](https://github.com/flutter/flutter/pull/35160) Move usage flutter create tests into memory filesystem. (a: tests, cla: yes, tool)
[35164](https://github.com/flutter/flutter/pull/35164) Update reassemble doc (cla: yes, customer: product, d: api docs, framework, severe: customer critical)
[35186](https://github.com/flutter/flutter/pull/35186) Make tool coverage collection resilient to sentinel coverage data (cla: yes, tool)
[35188](https://github.com/flutter/flutter/pull/35188) ensure test isolate is paused before collecting coverage (cla: yes, tool)
[35189](https://github.com/flutter/flutter/pull/35189) enable lints prefer_spread_collections and prefer_inlined_adds (cla: yes)
[35192](https://github.com/flutter/flutter/pull/35192) don't block any presubmit on coverage (cla: yes, tool)
[35197](https://github.com/flutter/flutter/pull/35197) [flutter_tool] Update Fuchsia SDK (cla: yes, tool)
[35206](https://github.com/flutter/flutter/pull/35206) Force-upgrade package deps (cla: yes)
[35207](https://github.com/flutter/flutter/pull/35207) refactor out selection handlers (a: text input, cla: yes, customer: amplify, customer: fuchsia, framework)
[35211](https://github.com/flutter/flutter/pull/35211) `child` param doc update in Ink and Ink.image (cla: yes, d: api docs, f: material design, framework)
[35217](https://github.com/flutter/flutter/pull/35217) Add flutter build aar (a: build, cla: yes, tool, waiting for tree to go green)
[35219](https://github.com/flutter/flutter/pull/35219) Text selection menu show/hide cases (a: text input, cla: yes, f: material design, framework)
[35221](https://github.com/flutter/flutter/pull/35221) Twiggle bit to exclude dev and beta from desktop and web (cla: yes, tool)
[35223](https://github.com/flutter/flutter/pull/35223) Navigator pushAndRemoveUntil Fix (cla: yes, customer: mulligan (g3), f: routes, framework, severe: crash, waiting for tree to go green)
[35225](https://github.com/flutter/flutter/pull/35225) add sample code for AnimatedContainer (a: animation, cla: yes, d: api docs, d: examples, framework)
[35231](https://github.com/flutter/flutter/pull/35231) Fix coverage collection (cla: yes, tool)
[35232](https://github.com/flutter/flutter/pull/35232) New benchmark: Gesture semantics (cla: yes, waiting for tree to go green)
[35233](https://github.com/flutter/flutter/pull/35233) Attempt skipping coverage shard if tools did not change (cla: yes)
[35237](https://github.com/flutter/flutter/pull/35237) Revert "Manual engine roll, Update goldens, improved wavy text decoration 0f9e297ad..185087a65f" (cla: yes)
[35242](https://github.com/flutter/flutter/pull/35242) Reland "Manual engine roll, Update goldens, improved wavy text decoration 0f9e297ad..185087a65f"" (cla: yes)
[35245](https://github.com/flutter/flutter/pull/35245) More preparation for HttpClientResponse implements Uint8List (cla: yes)
[35246](https://github.com/flutter/flutter/pull/35246) attempt to not skip coverage on post commit (cla: yes)
[35263](https://github.com/flutter/flutter/pull/35263) remove unnecessary ..toList() (cla: yes)
[35276](https://github.com/flutter/flutter/pull/35276) Revert "[Material] Support for hovered, focused, and pressed border color on `OutlineButton`s" (cla: yes)
[35278](https://github.com/flutter/flutter/pull/35278) Re-land "[Material] Support for hovered, focused, and pressed border color on `OutlineButton`s" (cla: yes)
[35280](https://github.com/flutter/flutter/pull/35280) benchmarkWidgets.semanticsEnabled default false. (cla: yes)
[35282](https://github.com/flutter/flutter/pull/35282) Add Container fallback to Ink build method (cla: yes, f: material design, framework)
[35288](https://github.com/flutter/flutter/pull/35288) Apply coverage skip math correctly (cla: yes)
[35290](https://github.com/flutter/flutter/pull/35290) tests for about page (cla: yes)
[35297](https://github.com/flutter/flutter/pull/35297) Fix the first frame logic in tracing and driver (cla: yes, engine, framework, severe: performance, team)
[35303](https://github.com/flutter/flutter/pull/35303) fix default artifacts to exclude ios and android (cla: yes, tool)
[35307](https://github.com/flutter/flutter/pull/35307) Clean up host_app_ephemeral Profile build settings (a: existing-apps, cla: yes, t: xcode, tool, ⌺ platform-ios)
[35335](https://github.com/flutter/flutter/pull/35335) Using custom exception class for network loading error (a: images, cla: yes, framework)
[35367](https://github.com/flutter/flutter/pull/35367) Add type to StreamChannel in generated test code. (cla: yes, tool)
[35392](https://github.com/flutter/flutter/pull/35392) Add timer checking and Fake http client to testbed (cla: yes, tool)
[35393](https://github.com/flutter/flutter/pull/35393) more ui-as-code (cla: yes, team)
[35406](https://github.com/flutter/flutter/pull/35406) Refactor signal and command line handler from resident runner (cla: yes, team, tool)
[35407](https://github.com/flutter/flutter/pull/35407) Manual engine roll (cla: yes, engine, team)
[35408](https://github.com/flutter/flutter/pull/35408) Remove print (cla: yes)
[35423](https://github.com/flutter/flutter/pull/35423) v1.7.8 hotfixes (cla: yes)
[35424](https://github.com/flutter/flutter/pull/35424) Introduce image_list performance benchmark that runs on jit(debug) build. (a: images, a: tests, cla: yes, framework)
[35464](https://github.com/flutter/flutter/pull/35464) Manual roll of engine 45b66b7...ffba2f6 (cla: yes, team)
[35465](https://github.com/flutter/flutter/pull/35465) Mark update-packages as non-experimental (cla: yes, tool)
[35467](https://github.com/flutter/flutter/pull/35467) Mark update-packages as non-experimental (cla: yes, tool)
[35468](https://github.com/flutter/flutter/pull/35468) Add colorFilterLayer/Widget (a: accessibility, cla: yes, customer: octopod, framework, waiting for tree to go green)
[35477](https://github.com/flutter/flutter/pull/35477) Update macrobenchmarks README and app name (a: tests, cla: yes, team)
[35480](https://github.com/flutter/flutter/pull/35480) Update the help message on precache command for less confusion (cla: yes, tool)
[35481](https://github.com/flutter/flutter/pull/35481) add APK build time benchmarks (cla: yes, tool)
[35482](https://github.com/flutter/flutter/pull/35482) Use the new service protocol message names (cla: yes)
[35487](https://github.com/flutter/flutter/pull/35487) Fix RenderFittedBox when child.size.isEmpty (a: accessibility, cla: yes, framework)
[35491](https://github.com/flutter/flutter/pull/35491) Include tags in SemanticsNode debug properties (cla: yes, framework)
[35492](https://github.com/flutter/flutter/pull/35492) Re-apply 'Add currentSystemFrameTimeStamp to SchedulerBinding' (cla: yes, framework)
[35493](https://github.com/flutter/flutter/pull/35493) Do not use ideographic baseline for RenderPargraph baseline (a: typography, cla: yes, engine, framework)
[35495](https://github.com/flutter/flutter/pull/35495) mark windows and macos chrome dev mode as flaky (cla: yes, team)
[35496](https://github.com/flutter/flutter/pull/35496) [Material] Text scale and wide label fixes for Slider and Range Slider value indicator shape (cla: yes, f: material design)
[35499](https://github.com/flutter/flutter/pull/35499) Added MaterialApp.themeMode to control which theme is used. (cla: yes, f: material design, framework)
[35548](https://github.com/flutter/flutter/pull/35548) Various doc fixes (cla: yes, framework)
[35556](https://github.com/flutter/flutter/pull/35556) ios (iPhone6) and iPhone XS tiles_scroll_perf tests (cla: yes, severe: performance, team, ⌺ platform-ios)
[35560](https://github.com/flutter/flutter/pull/35560) Support for elevation based dark theme overlay color in the Material widget (cla: yes, f: material design, framework)
[35573](https://github.com/flutter/flutter/pull/35573) update packages (cla: yes, team)
[35574](https://github.com/flutter/flutter/pull/35574) Fix semantics for floating pinned sliver app bar (a: accessibility, cla: yes, f: scrolling, framework, waiting for tree to go green)
[35646](https://github.com/flutter/flutter/pull/35646) Prepare for Socket implements Stream<Uint8List> (cla: yes)
[35657](https://github.com/flutter/flutter/pull/35657) Remove paused check for tooling tests (cla: yes, tool)
[35681](https://github.com/flutter/flutter/pull/35681) Disable incremental compiler in dartdevc (cla: yes, tool)
[35684](https://github.com/flutter/flutter/pull/35684) Fix typo in main.dart templates (cla: yes, d: api docs, framework)
[35708](https://github.com/flutter/flutter/pull/35708) disable a test case in xcode_backend.sh (cla: yes, tool)
[35709](https://github.com/flutter/flutter/pull/35709) Remove web, fuchsia, and unsupported devices from all (cla: yes, tool)
[35725](https://github.com/flutter/flutter/pull/35725) Update annotated region findAll implementation to use Iterables directly. (cla: yes, framework)
[35728](https://github.com/flutter/flutter/pull/35728) Added demo projects for splash screen support on Android. (a: existing-apps, cla: yes, team)
[35731](https://github.com/flutter/flutter/pull/35731) Keep LLDB connection to iOS device alive while running from CLI. (cla: yes, tool)
[35743](https://github.com/flutter/flutter/pull/35743) Simple Doc Fixes (cla: yes, d: api docs, framework)
[35745](https://github.com/flutter/flutter/pull/35745) enable lint prefer_if_null_operators (cla: yes, team)
[35749](https://github.com/flutter/flutter/pull/35749) add iOS build benchmarks (cla: yes, team, tool)
[35750](https://github.com/flutter/flutter/pull/35750) use sentence case in error message titles (cla: yes, framework)
[35756](https://github.com/flutter/flutter/pull/35756) Remove @objc inference build setting (cla: yes, t: xcode, tool)
[35762](https://github.com/flutter/flutter/pull/35762) Refactor keymapping for resident_runner (cla: yes)
[35763](https://github.com/flutter/flutter/pull/35763) UIApplicationLaunchOptionsKey -> UIApplication.LaunchOptionsKey (cla: yes, t: xcode, tool, ⌺ platform-ios)
[35765](https://github.com/flutter/flutter/pull/35765) Use public _registerService RPC in flutter_tools (cla: yes, tool)
[35767](https://github.com/flutter/flutter/pull/35767) set targets of zero percent for tools codecoverage (cla: yes, tool)
[35775](https://github.com/flutter/flutter/pull/35775) Add platform_interaction_test_swift to devicelab (a: tests, cla: yes, framework, p: framework, plugin, ⌺ platform-ios)
[35777](https://github.com/flutter/flutter/pull/35777) Fixed logLevel filter bug so that filter now works as expected (cla: yes, team)
[35778](https://github.com/flutter/flutter/pull/35778) Build all example projects in CI build smoke test (a: tests, cla: yes, team)
[35780](https://github.com/flutter/flutter/pull/35780) Remove CoocaPods support from layers example app (a: tests, cla: yes, d: examples, team)
[35785](https://github.com/flutter/flutter/pull/35785) Remove reverseDuration from implicitly animated widgets, since it's ignored. (a: animation, cla: yes, framework, severe: API break)
[35792](https://github.com/flutter/flutter/pull/35792) disable web tests (cla: yes)
[35810](https://github.com/flutter/flutter/pull/35810) SliverFillRemaining accounts for child size when hasScrollBody is false (cla: yes, f: scrolling, framework, waiting for tree to go green)
[35814](https://github.com/flutter/flutter/pull/35814) Roll engine e695a516f..75387dbc1 (8 commits) (cla: yes, team)
[35825](https://github.com/flutter/flutter/pull/35825) Fixed build of example code to use new binary messenger API. (cla: yes, team)
[35828](https://github.com/flutter/flutter/pull/35828) Cleanup widgets/sliver_persistent_header.dart with resolution of dart-lang/sdk#31543 (cla: yes, framework)
[35829](https://github.com/flutter/flutter/pull/35829) iOS 13 scrollbar (cla: yes, f: cupertino, framework)
[35833](https://github.com/flutter/flutter/pull/35833) Disable CocoaPods input and output paths in Xcode build phase for ephemeral add-to-app project (a: existing-apps, cla: yes, tool, ⌺ platform-ios)
[35839](https://github.com/flutter/flutter/pull/35839) use pub run for create test and remove [INFO] logs (cla: yes, tool)
[35846](https://github.com/flutter/flutter/pull/35846) move reload and restart handling into terminal (cla: yes, tool)
[35878](https://github.com/flutter/flutter/pull/35878) Add flag to use root navigator for showModalBottomSheet (cla: yes, f: material design, framework)
[35892](https://github.com/flutter/flutter/pull/35892) Doc fixes (cla: yes, d: api docs, d: examples, framework)
[35906](https://github.com/flutter/flutter/pull/35906) Add anchors to samples (cla: yes, team)
[35913](https://github.com/flutter/flutter/pull/35913) Change focus example to be more canonical (and correct) (cla: yes, framework)
[35919](https://github.com/flutter/flutter/pull/35919) Animation API doc improvments (a: animation, cla: yes, framework, waiting for tree to go green)
[35926](https://github.com/flutter/flutter/pull/35926) Add example showing how to move from one field to the next. (cla: yes, d: api docs, d: examples, framework)
[35932](https://github.com/flutter/flutter/pull/35932) Upgraded framework packages with 'flutter update-packages --force-upgrade'. (cla: yes, framework)
[35941](https://github.com/flutter/flutter/pull/35941) SliverLayoutBuilder (cla: yes, f: scrolling, framework)
[35942](https://github.com/flutter/flutter/pull/35942) Use test instead of test_api package in platform_channel_swift example tests (a: tests, cla: yes, d: examples, team)
[35971](https://github.com/flutter/flutter/pull/35971) [ImgBot] Optimize images (cla: yes, team)
[35979](https://github.com/flutter/flutter/pull/35979) Optimizes gesture recognizer fixes #35658 (cla: yes, f: gestures, framework)
[35991](https://github.com/flutter/flutter/pull/35991) Enable widget load assets in its own package in test (a: tests, cla: yes, tool)
[35996](https://github.com/flutter/flutter/pull/35996) Revert "Keep LLDB connection to iOS device alive while running from CLI." (cla: yes)
[35999](https://github.com/flutter/flutter/pull/35999) Deflake ImageProvider.evict test (a: images, a: tests, cla: yes, team: flakes)
[36006](https://github.com/flutter/flutter/pull/36006) fix linesplitter (cla: yes, team)
[36017](https://github.com/flutter/flutter/pull/36017) Move reporting files to reporting/ (cla: yes, tool)
[36026](https://github.com/flutter/flutter/pull/36026) add the transformPoint and transformRect benchmarks (cla: yes, team)
[36028](https://github.com/flutter/flutter/pull/36028) Fix slider preferred height (cla: yes, f: material design, framework)
[36030](https://github.com/flutter/flutter/pull/36030) [Material] Implement TooltipTheme and Tooltip.textStyle, fix Tooltip debugLabel, update Tooltip defaults (cla: yes, f: material design, framework, severe: API break, severe: new feature)
[36071](https://github.com/flutter/flutter/pull/36071) Revert "Bundle ios dependencies" (cla: yes, team, tool)
[36082](https://github.com/flutter/flutter/pull/36082) Add better handling of JSON-RPC exception (cla: yes, tool)
[36084](https://github.com/flutter/flutter/pull/36084) handle google3 version of pb (cla: yes, tool)
[36087](https://github.com/flutter/flutter/pull/36087) Update visual style of CupertinoSwitch to match iOS 13 (cla: yes, f: cupertino, framework)
[36088](https://github.com/flutter/flutter/pull/36088) Add PopupMenuTheme to enable theming color, shape, elevation, text style of Menu (cla: yes, f: material design, framework)
[36089](https://github.com/flutter/flutter/pull/36089) Fix flaky peer connection (a: tests, cla: yes, framework)
[36090](https://github.com/flutter/flutter/pull/36090) don't require diffs to have a percentage coverage greater (cla: yes, team)
[36093](https://github.com/flutter/flutter/pull/36093) Reland bundle ios deps (cla: yes, team, tool)
[36094](https://github.com/flutter/flutter/pull/36094) Revert "Part 1: Skia Gold Testing" (cla: yes, f: cupertino, f: material design, framework, team)
[36096](https://github.com/flutter/flutter/pull/36096) Revert "Merge branches 'master' and 'master' of github.com:flutter/fl… (cla: yes, tool)
[36097](https://github.com/flutter/flutter/pull/36097) Fix nested scroll view can rebuild without layout (cla: yes, f: scrolling, framework, severe: crash)
[36098](https://github.com/flutter/flutter/pull/36098) Be clearer about errors in customer testing script (cla: yes, team)
[36102](https://github.com/flutter/flutter/pull/36102) Move buildable module test to a module test (cla: yes, team)
[36103](https://github.com/flutter/flutter/pull/36103) Re-land "Part 1: Skia Gold Testing" (a: tests, cla: yes, framework, waiting for tree to go green)
[36105](https://github.com/flutter/flutter/pull/36105) [flutter_tool] Catch a yaml parse failure during project creation (cla: yes, team, tool)
[36106](https://github.com/flutter/flutter/pull/36106) Updated ColorScheme.dark() colors to match the Material Dark theme specification (cla: yes, f: material design, framework, severe: API break)
[36108](https://github.com/flutter/flutter/pull/36108) Move tools tests into a general.shard directory in preparation to changing how we shard tools tests (cla: yes, tool)
[36109](https://github.com/flutter/flutter/pull/36109) Catch exceptions thrown by runChecked* when possible (cla: yes, tool, waiting for tree to go green)
[36122](https://github.com/flutter/flutter/pull/36122) Make sure add-to-app build bundle from outer xcodebuild/gradlew sends analytics (cla: yes, team, tool)
[36123](https://github.com/flutter/flutter/pull/36123) Attempt to re-enable integration_tests-macos (a: tests, cla: yes, team, team: flakes)
[36135](https://github.com/flutter/flutter/pull/36135) add a kIsWeb constant to foundation (cla: yes, framework)
[36138](https://github.com/flutter/flutter/pull/36138) Implement feature flag system for flutter tools (cla: yes, tool)
[36174](https://github.com/flutter/flutter/pull/36174) [cupertino_icons] Add glyph refs for brightness #16102 (cla: yes, f: cupertino, framework)
[36194](https://github.com/flutter/flutter/pull/36194) Keep LLDB connection to iOS device alive while running from CLI. (cla: yes, tool)
[36197](https://github.com/flutter/flutter/pull/36197) Fix windows, exclude widgets from others (cla: yes, team)
[36199](https://github.com/flutter/flutter/pull/36199) Don't try to flutterExit if isolate is still paused (cla: yes, tool)
[36200](https://github.com/flutter/flutter/pull/36200) Refactoring the Android_views tests app to prepare for adding the iOS platform view tests (a: platform-views, a: tests, cla: yes, team)
[36202](https://github.com/flutter/flutter/pull/36202) Add clarifying docs on MaterialButton.colorBrightness (cla: yes, d: api docs, f: material design, framework)
[36208](https://github.com/flutter/flutter/pull/36208) [flutter_tool] Allow analytics without a terminal attached (cla: yes, tool)
[36213](https://github.com/flutter/flutter/pull/36213) Use DeviceManager instead of device to determine if device supports project. (cla: yes, tool)
[36217](https://github.com/flutter/flutter/pull/36217) Split Mouse from Listener (a: desktop, cla: yes, framework, severe: API break, waiting for tree to go green)
[36218](https://github.com/flutter/flutter/pull/36218) release lock in flutter pub context (cla: yes, tool)
[36237](https://github.com/flutter/flutter/pull/36237) Recommend to use the final version of CDN support for the trunk specs repo. (cla: yes, tool)
[36240](https://github.com/flutter/flutter/pull/36240) Rearrange flutter assemble implementation (cla: yes, tool)
[36243](https://github.com/flutter/flutter/pull/36243) Allow semantics labels to be shorter or longer than raw text (a: accessibility, cla: yes, customer: money (g3), framework, waiting for tree to go green)
[36262](https://github.com/flutter/flutter/pull/36262) Prevents infinite loop in Table._computeColumnWidths (cla: yes, framework)
[36270](https://github.com/flutter/flutter/pull/36270) Change Future.done to Future.whenComplete (a: tests, cla: yes, framework, team, waiting for tree to go green)
[36288](https://github.com/flutter/flutter/pull/36288) Throw exception if instantiating IOSDevice on non-mac os platform (cla: yes, tool)
[36289](https://github.com/flutter/flutter/pull/36289) FakeHttpClientResponse improvements (cla: yes, tool)
[36293](https://github.com/flutter/flutter/pull/36293) Revert "Keep LLDB connection to iOS device alive while running from CLI. " (cla: yes, tool)
[36297](https://github.com/flutter/flutter/pull/36297) Add multi-line flag to semantics (a: accessibility, cla: yes, framework, ☸ platform-web)
[36302](https://github.com/flutter/flutter/pull/36302) Issues/30526 gc (cla: yes, framework)
[36303](https://github.com/flutter/flutter/pull/36303) Add sync star benchmark cases (a: accessibility, cla: yes, team)
[36317](https://github.com/flutter/flutter/pull/36317) Disable flaky tests on Windows (cla: yes, f: material design, framework)
[36318](https://github.com/flutter/flutter/pull/36318) Include flutter_runner in precache artifacts. (cla: yes, tool)
[36319](https://github.com/flutter/flutter/pull/36319) Revert "Fix semantics for floating pinned sliver app bar" (cla: yes, framework)
[36327](https://github.com/flutter/flutter/pull/36327) Fix invocations of ideviceinstaller not passing DYLD_LIBRARY_PATH (cla: yes, tool)
[36331](https://github.com/flutter/flutter/pull/36331) Minor fixes to precache help text (attempt #2) (cla: yes, tool)
[36333](https://github.com/flutter/flutter/pull/36333) fix sliver fixed pinned appbar (cla: yes, framework, waiting for tree to go green)
[36334](https://github.com/flutter/flutter/pull/36334) Added a Driver API that waits until frame sync (a: tests, cla: yes, framework)
[36379](https://github.com/flutter/flutter/pull/36379) Add missing test case for Usage (cla: yes, tool)
[36384](https://github.com/flutter/flutter/pull/36384) rename the test app android_views to platform_views (cla: yes, team)
[36391](https://github.com/flutter/flutter/pull/36391) Adds doc example for Listview and pageview (cla: yes, d: api docs, framework)
[36392](https://github.com/flutter/flutter/pull/36392) Increase pattern that matches operation duration in log_test (a: tests, cla: yes, tool, waiting for tree to go green)
[36394](https://github.com/flutter/flutter/pull/36394) Add missing protobuf dependency (cla: yes, tool)
[36396](https://github.com/flutter/flutter/pull/36396) Optimize the transformRect and transformPoint methods in matrix_utils. (cla: yes, framework)
[36399](https://github.com/flutter/flutter/pull/36399) Added ThemeMode support to the Flutter Gallery (cla: yes, d: examples, team, team: gallery)
[36402](https://github.com/flutter/flutter/pull/36402) Teach render objects to reuse engine layers (cla: yes, framework, severe: API break, severe: performance, ☸ platform-web)
[36404](https://github.com/flutter/flutter/pull/36404) Make test back button label deterministic (cla: yes, team)
[36409](https://github.com/flutter/flutter/pull/36409) Add searchFieldLabel to SearchDelegate in order to show a custom hint (cla: yes, f: material design, framework)
[36410](https://github.com/flutter/flutter/pull/36410) Add plumbing for hello world startup test in devicelab (cla: yes, team)
[36411](https://github.com/flutter/flutter/pull/36411) Implement InputDecorationTheme copyWith, ==, hashCode (cla: yes, f: material design, framework, severe: new feature)
[36413](https://github.com/flutter/flutter/pull/36413) Revert "Roll engine f3482700474a..1af19ae67dd1 (4 commits)" (cla: yes, engine)
[36418](https://github.com/flutter/flutter/pull/36418) Add testing to screenshot and printDetails method (cla: yes, tool)
[36421](https://github.com/flutter/flutter/pull/36421) doc : ReorderableListView - added youtube video from WidgetOfTheWeek … (cla: yes, f: material design, framework)
[36428](https://github.com/flutter/flutter/pull/36428) Bump engine version (cla: yes, engine, team)
[36431](https://github.com/flutter/flutter/pull/36431) Re-enable `flutter test` expression evaluation tests (a: tests, cla: yes, tool)
[36434](https://github.com/flutter/flutter/pull/36434) Clean up flutter driver device detection. (cla: yes, tool)
[36460](https://github.com/flutter/flutter/pull/36460) Add images and update examples for top widgets: (cla: yes, d: api docs, d: examples, f: material design, framework)
[36465](https://github.com/flutter/flutter/pull/36465) Use FlutterFeatures to configure web and desktop devices (cla: yes, tool)
[36468](https://github.com/flutter/flutter/pull/36468) Fix test_widgets-windows not running tests (a: tests, cla: yes, framework, team, waiting for tree to go green)
[36471](https://github.com/flutter/flutter/pull/36471) Enable bitcode compilation for AOT (cla: yes)
[36481](https://github.com/flutter/flutter/pull/36481) Remove untested code (cla: yes, tool)
[36482](https://github.com/flutter/flutter/pull/36482) Sped up shader warmup by only drawing on a 100x100 surface (cla: yes, framework)
[36485](https://github.com/flutter/flutter/pull/36485) Add text border docs (a: typography, cla: yes, d: api docs, framework)
[36490](https://github.com/flutter/flutter/pull/36490) [flutter_tool] Send analytics command before the command runs (cla: yes, tool)
[36492](https://github.com/flutter/flutter/pull/36492) Add GitHub CODEOWNERS file to auto-add reviewers by path (cla: yes, team)
[36493](https://github.com/flutter/flutter/pull/36493) Fixes sliver list does not layout firstchild when child reordered (cla: yes, framework)
[36498](https://github.com/flutter/flutter/pull/36498) Clean up host_app_ephemeral_cocoapods Profile build settings (a: existing-apps, cla: yes, t: xcode, tool, ⌺ platform-ios)
[36503](https://github.com/flutter/flutter/pull/36503) Disabling Firebase Test Lab smoke test to unblock autoroller (cla: yes)
[36507](https://github.com/flutter/flutter/pull/36507) Bump engine version (cla: yes, engine, team, tool)
[36510](https://github.com/flutter/flutter/pull/36510) flutter update-packages --force-upgrade (cla: yes, team)
[36512](https://github.com/flutter/flutter/pull/36512) Renamed the Driver API waitUntilFrameSync to waitUntilNoPendingFrame (a: tests, cla: yes, framework)
[36513](https://github.com/flutter/flutter/pull/36513) Fix `flutter pub -v` (cla: yes, tool)
[36545](https://github.com/flutter/flutter/pull/36545) [flutter_tool] Send the local time to analytics with screens and events (cla: yes, tool, work in progress; do not review)
[36546](https://github.com/flutter/flutter/pull/36546) Unskip date_picker_test on Windows as underlying issue 19696 was fixed. (cla: yes, f: material design, framework)
[36548](https://github.com/flutter/flutter/pull/36548) Fix the web builds by reverting version bump of build_modules (cla: yes, tool)
[36549](https://github.com/flutter/flutter/pull/36549) fix number encoding in message codecs for the Web (cla: yes, framework)
[36553](https://github.com/flutter/flutter/pull/36553) Load assets during test from file system instead of manifest. (a: tests, cla: yes, framework)
[36556](https://github.com/flutter/flutter/pull/36556) Fix usage test to use local usage (cla: yes, tool)
[36560](https://github.com/flutter/flutter/pull/36560) [flutter_tools] Add some useful commands to the README.md (cla: yes, tool)
[36564](https://github.com/flutter/flutter/pull/36564) Make sure fx flutter attach can find devices (cla: yes, tool)
[36569](https://github.com/flutter/flutter/pull/36569) Some minor cleanup for flutter_tools (cla: yes, tool)
[36570](https://github.com/flutter/flutter/pull/36570) Some minor fixes to the tool_coverage tool (cla: yes, tool)
[36571](https://github.com/flutter/flutter/pull/36571) Some minor cleanup in devicelab (cla: yes, team)
[36579](https://github.com/flutter/flutter/pull/36579) Add gradient text docs (a: typography, cla: yes, framework)
[36585](https://github.com/flutter/flutter/pull/36585) Place build outputs under dart tool (cla: yes, tool)
[36589](https://github.com/flutter/flutter/pull/36589) Update Localizations: added 24 new locales (reprise) (a: internationalization, cla: yes, f: cupertino, f: material design)
[36595](https://github.com/flutter/flutter/pull/36595) More resident runner tests (cla: yes, tool)
[36598](https://github.com/flutter/flutter/pull/36598) Expose functionality to compile dart to kernel for the VM (cla: yes, tool)
[36618](https://github.com/flutter/flutter/pull/36618) Revert "AsyncSnapshot.data to throw if error or no data" (cla: yes, framework)
[36654](https://github.com/flutter/flutter/pull/36654) Revert "Use FlutterFeatures to configure web and desktop devices" (cla: yes, team, tool)
[36679](https://github.com/flutter/flutter/pull/36679) add line-length to `flutter format` command line (cla: yes, tool)
[36690](https://github.com/flutter/flutter/pull/36690) Updating cirrus fingerprint script to include goldens version (a: tests, cla: yes, framework, waiting for tree to go green)
[36695](https://github.com/flutter/flutter/pull/36695) Android visible password input type support (cla: yes, framework)
[36698](https://github.com/flutter/flutter/pull/36698) fixes iphone force press keyboard select crashes (cla: yes, framework)
[36699](https://github.com/flutter/flutter/pull/36699) Reland: use flutter features for web and desktop (cla: yes, team, tool)
[36717](https://github.com/flutter/flutter/pull/36717) Fix devicelab tests that did not enable web config. (cla: yes, team)
[36722](https://github.com/flutter/flutter/pull/36722) Skip flaky test windows (cla: yes, tool)
[36727](https://github.com/flutter/flutter/pull/36727) Add missing config to create (cla: yes, team, tool)
[36731](https://github.com/flutter/flutter/pull/36731) Revert "Add flutter build aar" (cla: yes, team, tool)
[36732](https://github.com/flutter/flutter/pull/36732) Flutter build aar (a: build, cla: yes, team, tool, waiting for tree to go green)
[36768](https://github.com/flutter/flutter/pull/36768) add an error count field to the Flutter.Error event (cla: yes, framework)
[36773](https://github.com/flutter/flutter/pull/36773) Expose build-dir config option (cla: yes, tool)
[36774](https://github.com/flutter/flutter/pull/36774) Parameterize CoverageCollector with a library name predicate (cla: yes, tool)
[36784](https://github.com/flutter/flutter/pull/36784) [flutter_tool] Improve Windows flutter clean error message (cla: yes, tool)
[36785](https://github.com/flutter/flutter/pull/36785) [flutter_tool] Clean up usage events and custom dimensions (cla: yes, tool)
[36787](https://github.com/flutter/flutter/pull/36787) Check for directory instead of path separator (cla: yes, tool)
[36793](https://github.com/flutter/flutter/pull/36793) Vend Flutter module App.framework as a local CocoaPod pod to be installed by a host app (a: existing-apps, cla: yes, t: xcode, team, tool, ⌺ platform-ios)
[36805](https://github.com/flutter/flutter/pull/36805) Allow flavors and custom build types in host app (a: build, a: existing-apps, cla: yes, t: gradle, team, tool, waiting for tree to go green)
[36832](https://github.com/flutter/flutter/pull/36832) Remove flaky check for analyzer message. (cla: yes, tool)
[36845](https://github.com/flutter/flutter/pull/36845) Improve Windows build failure message (cla: yes, tool, waiting for tree to go green)
[36851](https://github.com/flutter/flutter/pull/36851) Revert "[Material] Implement TooltipTheme and Tooltip.textStyle, fix Tooltip debugLabel, update Tooltip defaults" (cla: yes, f: material design, framework)
[36856](https://github.com/flutter/flutter/pull/36856) [Material] Implement TooltipTheme and Tooltip.textStyle, update Tooltip defaults (cla: yes, f: material design, framework, severe: API break, severe: new feature)
[36857](https://github.com/flutter/flutter/pull/36857) Ensure user-thrown errors have ErrorSummary nodes (cla: yes, framework)
[36860](https://github.com/flutter/flutter/pull/36860) Remove Chain terse parsing (cla: yes, tool)
[36866](https://github.com/flutter/flutter/pull/36866) Tests for `flutter test [some_directory]` (cla: yes, team, tool)
[36867](https://github.com/flutter/flutter/pull/36867) Add reference to StrutStyle from TextStyle (cla: yes, framework)
[36874](https://github.com/flutter/flutter/pull/36874) Adjust phrasing of features (cla: yes, tool)
[36877](https://github.com/flutter/flutter/pull/36877) Revert "Dismiss modal with any button press" (cla: yes, framework)
[36880](https://github.com/flutter/flutter/pull/36880) [Material] Create material Banner component (cla: yes, f: material design, framework)
[36884](https://github.com/flutter/flutter/pull/36884) Unbreak build_runner (cla: yes, team, tool)
[36885](https://github.com/flutter/flutter/pull/36885) Manual roll of flutter/engine@ef99738...72341ed (cla: yes, engine, tool)
[36886](https://github.com/flutter/flutter/pull/36886) Add annotation dependency to plugins (cla: yes, team, tool, waiting for tree to go green)
[36887](https://github.com/flutter/flutter/pull/36887) Fix thumb size calculation (cla: yes, f: cupertino, framework)
[36893](https://github.com/flutter/flutter/pull/36893) Fix minor typos (cla: yes, framework)
[36895](https://github.com/flutter/flutter/pull/36895) Mark splash test flaky until proved stable. (cla: yes, team)
[36901](https://github.com/flutter/flutter/pull/36901) Run Gradle tests on Windows (a: build, cla: yes, team, tool)
[36949](https://github.com/flutter/flutter/pull/36949) Remove stdout related to settings_aar.gradle (a: tests, cla: yes, t: flutter driver, team)
[36955](https://github.com/flutter/flutter/pull/36955) Extract common PlatformView functionality: Painting and Semantics (a: platform-views, cla: yes, framework)
[36956](https://github.com/flutter/flutter/pull/36956) Redo: Modal dismissed by any button (cla: yes, framework, waiting for tree to go green)
[36963](https://github.com/flutter/flutter/pull/36963) Add margins to tooltips (cla: yes, f: material design, framework, severe: new feature)
[36964](https://github.com/flutter/flutter/pull/36964) Interactive size const (cla: yes, f: cupertino, f: material design, framework, severe: API break)
[36966](https://github.com/flutter/flutter/pull/36966) Roll back the AAR build experiment (cla: yes, tool)
[36969](https://github.com/flutter/flutter/pull/36969) devicelab: replace the FLUTTER_ENGINE environment variable with the new local engine flags (cla: yes, team)
[36970](https://github.com/flutter/flutter/pull/36970) Clarify showDuration and waitDuration API docs and test behavior (cla: yes, d: api docs, f: material design, framework)
[36974](https://github.com/flutter/flutter/pull/36974) Multiline Selection Menu Position Bug (a: text input, cla: yes, f: material design, framework)
[36987](https://github.com/flutter/flutter/pull/36987) Flutter assemble for macos take 2! (cla: yes, tool, ⌘ platform-mac)
[36997](https://github.com/flutter/flutter/pull/36997) Added missing png's to demo splash screen project (was caused by global gitignore). (cla: yes, team)
[37026](https://github.com/flutter/flutter/pull/37026) Add support for the Kannada (kn) locale (a: internationalization, cla: yes, f: cupertino, f: material design, team)
[37027](https://github.com/flutter/flutter/pull/37027) Revert "Fix the first frame logic in tracing and driver" (a: tests, cla: yes, d: examples, framework, team, team: gallery, tool)
[37030](https://github.com/flutter/flutter/pull/37030) Mark backdrop_filter_perf test nonflaky (cla: yes, team)
[37033](https://github.com/flutter/flutter/pull/37033) fix debug paint crash when axis direction inverted (cla: yes, framework, severe: crash)
[37036](https://github.com/flutter/flutter/pull/37036) Build number (part after +) is documented as optional, use entire app version if not present (cla: yes, tool)
[37037](https://github.com/flutter/flutter/pull/37037) [flutter_tool] Update Fuchsia SDK (cla: yes, tool)
[37038](https://github.com/flutter/flutter/pull/37038) Update SnackBar to the latest Material specs. (cla: yes, f: material design, framework)
[37042](https://github.com/flutter/flutter/pull/37042) Fix selection menu not showing after clear (a: text input, cla: yes, framework)
[37043](https://github.com/flutter/flutter/pull/37043) Tests for Engine ensuring debug-mode apps are attached on iOS. (cla: yes, team, tool)
[37044](https://github.com/flutter/flutter/pull/37044) [flutter_tool] Make a couple file operations synchronous (cla: yes, tool)
[37048](https://github.com/flutter/flutter/pull/37048) use SizedBox instead of Container for building collapsed selection (a: text input, cla: yes, f: cupertino, framework)
[37049](https://github.com/flutter/flutter/pull/37049) Revert Optimize transformRect (cla: yes, framework, waiting for tree to go green)
[37055](https://github.com/flutter/flutter/pull/37055) Revert "Enable selection by default for password text field and expos… (cla: yes, f: cupertino, f: material design, framework)
[37158](https://github.com/flutter/flutter/pull/37158) Fix Textfields in Semantics Debugger (a: accessibility, cla: yes, framework, waiting for tree to go green)
[37183](https://github.com/flutter/flutter/pull/37183) reland Enable selection by default for password text field and expose… (a: text input, cla: yes, customer: fun (g3), f: cupertino, f: material design)
[37186](https://github.com/flutter/flutter/pull/37186) [flutter_tool] Usage refactor cleanup (cla: yes, tool)
[37187](https://github.com/flutter/flutter/pull/37187) use FlutterError in MultiChildRenderObjectWidget (cla: yes, framework)
[37192](https://github.com/flutter/flutter/pull/37192) Reland "Fix the first frame logic in tracing and driver (#35297)" (cla: yes, engine, framework)
[37194](https://github.com/flutter/flutter/pull/37194) [flutter_tool] More gracefully handle Android sdkmanager failure (cla: yes, tool)
[37196](https://github.com/flutter/flutter/pull/37196) [flutter_tool] Catch ProcessException from 'adb devices' (cla: yes, tool)
[37198](https://github.com/flutter/flutter/pull/37198) [flutter_tool] Re-try sending the first crash report (cla: yes, tool)
[37205](https://github.com/flutter/flutter/pull/37205) add cmx for complex_layout (cla: yes, team)
[37206](https://github.com/flutter/flutter/pull/37206) Test that modules built as AAR contain the right assets and artifacts (a: build, cla: yes, team, waiting for tree to go green, ▣ platform-android)
[37207](https://github.com/flutter/flutter/pull/37207) Update complex_layout.cmx (cla: yes, team)
[37208](https://github.com/flutter/flutter/pull/37208) Roll flutter/engine@09f8bffb9...67319c00b (cla: yes)
[37210](https://github.com/flutter/flutter/pull/37210) do not strip symbols when building profile (cla: yes, team, tool)
[37211](https://github.com/flutter/flutter/pull/37211) Don't enable scroll wheel when scrolling is off (a: desktop, cla: yes, customer: octopod, framework)
[37217](https://github.com/flutter/flutter/pull/37217) hide symbols from spotlight for App.framework (cla: yes, tool, waiting for tree to go green)
[37250](https://github.com/flutter/flutter/pull/37250) Removing Leftover Golden Test Skips (a: tests, cla: yes, framework)
[37254](https://github.com/flutter/flutter/pull/37254) Clamp Scaffold's max body height when extendBody is true (cla: yes, f: material design, framework, severe: crash)
[37259](https://github.com/flutter/flutter/pull/37259) [Material] Add support for hovered, pressed, focused, and selected text color on Chips. (cla: yes, f: material design, framework)
[37266](https://github.com/flutter/flutter/pull/37266) Change the value of kMaxUnsignedSMI for the Web (cla: yes, framework, severe: new feature, waiting for tree to go green, ☸ platform-web)
[37269](https://github.com/flutter/flutter/pull/37269) [Material] FAB refactor - remove unnecessary IconTheme (cla: yes, f: material design, framework)
[37275](https://github.com/flutter/flutter/pull/37275) Optimize the transformRect and transformPoint methods in matrix_utils… (cla: yes, framework)
[37276](https://github.com/flutter/flutter/pull/37276) Make podhelper.rb a template to avoid passing in the module name (a: existing-apps, cla: yes, t: xcode, team, tool, ⌺ platform-ios)
[37295](https://github.com/flutter/flutter/pull/37295) Revert "reland Enable selection by default for password text field and expose…" (a: accessibility, cla: yes, f: cupertino, f: material design, framework, team)
[37314](https://github.com/flutter/flutter/pull/37314) Update dartdoc to 28.4 (cla: yes, team)
[37319](https://github.com/flutter/flutter/pull/37319) resizeToAvoidBottomInset Cupertino without NavBar (cla: yes, f: cupertino, framework)
[37322](https://github.com/flutter/flutter/pull/37322) Add comments to an Android Platform view gesture test case (a: platform-views, cla: yes, framework, severe: crash, waiting for tree to go green)
[37324](https://github.com/flutter/flutter/pull/37324) reland Enable selection by default for password text field and expose… (a: accessibility, cla: yes, f: cupertino, f: material design, framework, team)
[37328](https://github.com/flutter/flutter/pull/37328) Fix some tests now that the isMultiline flag is added to values (a: accessibility, cla: yes, framework, waiting for tree to go green, ☸ platform-web)
[37331](https://github.com/flutter/flutter/pull/37331) [flutter_tool] Add missing toString() (cla: yes, tool)
[37338](https://github.com/flutter/flutter/pull/37338) Update constructor APIs TooltipTheme, ToggleButtonsTheme, PopupMenuTheme (cla: yes, f: material design, framework, severe: API break)
[37341](https://github.com/flutter/flutter/pull/37341) hiding original hero after hero transition (a: animation, cla: yes, framework, severe: API break, severe: new feature)
[37342](https://github.com/flutter/flutter/pull/37342) Fix mouse region crash when using closures (a: desktop, cla: yes, framework, waiting for tree to go green)
[37344](https://github.com/flutter/flutter/pull/37344) Fix mouse region double render (a: desktop, cla: yes, framework, waiting for tree to go green)
[37345](https://github.com/flutter/flutter/pull/37345) [flutter_tool] Include the local timezone in analytics timestamp (cla: yes, tool)
[37351](https://github.com/flutter/flutter/pull/37351) fix errors caught by roll of macOS assemble (cla: yes, tool)
[37355](https://github.com/flutter/flutter/pull/37355) Added ThemeData.from() method to construct a Theme from a ColorScheme (cla: yes, f: material design, framework)
[37365](https://github.com/flutter/flutter/pull/37365) only build macOS kernel in debug mode (cla: yes, tool)
[37378](https://github.com/flutter/flutter/pull/37378) Disable xcode indexing in CI via COMPILER_INDEX_STORE_ENABLE=NO argument (cla: yes, tool, waiting for customer response)
[37403](https://github.com/flutter/flutter/pull/37403) add ontap to textformfield (cla: yes, f: material design, framework)
[37405](https://github.com/flutter/flutter/pull/37405) Add .android/Flutter/flutter.iml to module template. (cla: yes, tool)
[37407](https://github.com/flutter/flutter/pull/37407) Remove multi-arch check in iOS builds (cla: yes, tool)
[37413](https://github.com/flutter/flutter/pull/37413) Revert "Remove multi-arch check in iOS builds" (cla: yes, engine, tool)
[37417](https://github.com/flutter/flutter/pull/37417) Nosuchmethod window (a: tests, cla: yes, framework)
[37422](https://github.com/flutter/flutter/pull/37422) [flutter_tool] Additional flutter manifest yaml validation (cla: yes, tool)
[37425](https://github.com/flutter/flutter/pull/37425) Support for macOS release mode (1 of 3) (cla: yes, tool)
[37436](https://github.com/flutter/flutter/pull/37436) Hide text selection handle after entering text (cla: yes, f: material design, framework)
[37440](https://github.com/flutter/flutter/pull/37440) Print message when HttpException is thrown after running `flutter run` (cla: yes, tool, waiting for tree to go green)
[37442](https://github.com/flutter/flutter/pull/37442) Disable flaky test (a: tests, cla: yes, team)
[37445](https://github.com/flutter/flutter/pull/37445) Switch iOS gen_snapshot from multi-arch binary to multiple binaries (cla: yes, engine, tool)
[37449](https://github.com/flutter/flutter/pull/37449) If xcode_backend.sh script fails or substitute variables are missing, fail the host Xcode build (a: existing-apps, cla: yes, t: xcode, team, tool)
[37457](https://github.com/flutter/flutter/pull/37457) Find the app bundle when the flavor contains underscores (a: build, cla: yes, team, tool, waiting for tree to go green)
[37479](https://github.com/flutter/flutter/pull/37479) Remove bogus code in ContainerParentDataMixin.detach (cla: yes, framework, waiting for tree to go green)
[37489](https://github.com/flutter/flutter/pull/37489) Moved the default BinaryMessenger instance to ServicesBinding (a: tests, cla: yes, customer: espresso, d: examples, framework, severe: API break, t: flutter driver, team)
[37492](https://github.com/flutter/flutter/pull/37492) Drawer edge drag width improvements (cla: yes, f: material design, framework, severe: new feature)
[37497](https://github.com/flutter/flutter/pull/37497) Extract common PlatformView functionality: Gesture and PointerEvent (cla: yes, framework)
[37500](https://github.com/flutter/flutter/pull/37500) Avoid killing Flutter tool process (#37471) (cla: yes, tool)
[37503](https://github.com/flutter/flutter/pull/37503) Quickly fix start up tests (cla: yes, framework)
[37509](https://github.com/flutter/flutter/pull/37509) Use macOS ephemeral directory for Pod env script (cla: yes, tool)
[37512](https://github.com/flutter/flutter/pull/37512) Enable track widget creation on debug builds (cla: yes, tool)
[37514](https://github.com/flutter/flutter/pull/37514) [flutter_tool] Remove unintended analytics screen send (cla: yes, tool)
[37515](https://github.com/flutter/flutter/pull/37515) Upstream web support for IterableProperty<double> (cla: yes, framework, ☸ platform-web)
[37516](https://github.com/flutter/flutter/pull/37516) Kill stale TODO (a: tests, cla: yes, framework, team)
[37521](https://github.com/flutter/flutter/pull/37521) have xcodeSelectPath also catch ArgumentError (cla: yes, tool)
[37524](https://github.com/flutter/flutter/pull/37524) Ensure that tests remove pointers by using addTearDown (a: tests, cla: yes, framework, waiting for tree to go green)
[37556](https://github.com/flutter/flutter/pull/37556) [Material] Make RawChip.selected non-nullable. (cla: yes, f: material design, framework)
[37595](https://github.com/flutter/flutter/pull/37595) Closes #37593 Add flutter_export_environment.sh to gitignore (cla: yes, tool, waiting for tree to go green)
[37624](https://github.com/flutter/flutter/pull/37624) Diagrams for API docs rank 10-20 in most views (cla: yes, d: api docs, d: examples, f: material design, framework, from: study, waiting for tree to go green)
[37631](https://github.com/flutter/flutter/pull/37631) [Material] Create demo for material banner (cla: yes, d: examples, f: material design, team, team: gallery)
[37634](https://github.com/flutter/flutter/pull/37634) [web][upstream] Update diagnostics to support web platform tests (cla: yes, f: material design, framework)
[37636](https://github.com/flutter/flutter/pull/37636) Add CheckboxListTile checkColor (cla: yes, f: material design, framework)
[37637](https://github.com/flutter/flutter/pull/37637) don't call Platform.operatingSystem in RenderView diagnostics (cla: yes, framework, ☸ platform-web)
[37638](https://github.com/flutter/flutter/pull/37638) [web][upstream] Fix debugPrintStack for web platform (cla: yes, framework, ☸ platform-web)
[37647](https://github.com/flutter/flutter/pull/37647) Change priority of gen_snapshot search paths (cla: yes, tool)
[37649](https://github.com/flutter/flutter/pull/37649) Revert "Integrate dwds into flutter tool for web support" (a: accessibility, cla: yes, d: examples, team, team: gallery)
[37650](https://github.com/flutter/flutter/pull/37650) Reland Integrate dwds into flutter tool for web support (a: accessibility, cla: yes, d: examples, team, team: gallery)
[37652](https://github.com/flutter/flutter/pull/37652) Change RenderObject.getTransformTo to include ancestor. (cla: yes, framework, severe: API break)
[37654](https://github.com/flutter/flutter/pull/37654) Add missing library to flutter tools BUILD.gn (cla: yes, tool)
[37658](https://github.com/flutter/flutter/pull/37658) fix windows path for dwds/web builds (cla: yes, tool)
[37661](https://github.com/flutter/flutter/pull/37661) flutter update-packages --force-upgrade (a: accessibility, a: tests, cla: yes, d: examples, framework, team, team: gallery, tool)
[37664](https://github.com/flutter/flutter/pull/37664) Partial macOS assemble revert (cla: yes, tool)
[37703](https://github.com/flutter/flutter/pull/37703) PlatformViewLink, handling creation of the PlatformViewSurface and dispose PlatformViewController (a: platform-views, cla: yes, framework)
[37712](https://github.com/flutter/flutter/pull/37712) [web][upstream] Optimize InactiveElements deactivation (cla: yes, framework, ☸ platform-web)
[37714](https://github.com/flutter/flutter/pull/37714) remove unused script (cla: yes, team)
[37715](https://github.com/flutter/flutter/pull/37715) Fix markdown link format (cla: yes, f: material design, framework)
[37718](https://github.com/flutter/flutter/pull/37718) Adding physicalDepth to MediaQueryData & TestWindow (cla: yes, customer: fuchsia, framework, severe: customer critical, waiting for tree to go green)
[37724](https://github.com/flutter/flutter/pull/37724) iOS 13 scrollbar vibration (cla: yes, f: cupertino, framework)
[37730](https://github.com/flutter/flutter/pull/37730) Revert "remove unused script" (cla: yes, team)
[37731](https://github.com/flutter/flutter/pull/37731) Add metadata to indicate if the host app contains a Flutter module (cla: yes, team, tool)
[37733](https://github.com/flutter/flutter/pull/37733) Support macOS Catalina-style signing certificate names (cla: yes, tool)
[37735](https://github.com/flutter/flutter/pull/37735) Remove unused no-build flag from the flutter run command (cla: yes, tool)
[37738](https://github.com/flutter/flutter/pull/37738) Use relative paths when installing module pods (a: existing-apps, cla: yes, tool, ⌺ platform-ios)
[37740](https://github.com/flutter/flutter/pull/37740) Disable gem documentation generation on Cirrus (cla: yes, team)
[37743](https://github.com/flutter/flutter/pull/37743) Handle thrown maps and rejects from fe server (cla: yes, tool)
[37752](https://github.com/flutter/flutter/pull/37752) Remove dead flag `gradle-dir` in flutter config (cla: yes, tool)
[37760](https://github.com/flutter/flutter/pull/37760) Don't mark system_debug_ios as flaky. (cla: yes, team)
[37790](https://github.com/flutter/flutter/pull/37790) Doc: Image.memory only accepts compressed format (cla: yes, framework, waiting for tree to go green)
[37792](https://github.com/flutter/flutter/pull/37792) Disable the progress bar when downloading the Dart SDK via Invoke-WebRequest (cla: yes, tool)
[37793](https://github.com/flutter/flutter/pull/37793) Add equals and hashCode to Tween (a: animation, cla: yes, framework, waiting for tree to go green)
[37801](https://github.com/flutter/flutter/pull/37801) Fix TextField cursor color documentation (cla: yes, f: material design, framework)
[37806](https://github.com/flutter/flutter/pull/37806) Add COMPILER_INDEX_STORE_ENABLE=NO to macOS build and tests (a: tests, cla: yes, t: xcode, team, tool)
[37809](https://github.com/flutter/flutter/pull/37809) Add autofocus parameter to widgets which use Focus widget internally (cla: yes, f: cupertino, f: material design, framework)
[37811](https://github.com/flutter/flutter/pull/37811) Add flutter_export_environment.sh to the framework tree gitignore (cla: yes, team)
[37812](https://github.com/flutter/flutter/pull/37812) [web][upstream] Don't register exit/saveCompilationTrace for web platform since they are not available (cla: yes, framework, ☸ platform-web)
[37815](https://github.com/flutter/flutter/pull/37815) Restructure resident web runner usage to avoid SDK users that don't support dwds (cla: yes, tool)
[37816](https://github.com/flutter/flutter/pull/37816) update dependencies; add a Web smoke test (a: accessibility, a: tests, cla: yes, d: examples, framework, team, team: gallery)
[37825](https://github.com/flutter/flutter/pull/37825) Automatic focus highlight mode for FocusManager (CQ+1, cla: yes, f: material design, framework)
[37828](https://github.com/flutter/flutter/pull/37828) have android_semantics_testing use adb from ENV provided android sdk (a: accessibility, cla: yes, team)
[37856](https://github.com/flutter/flutter/pull/37856) Remove references to solo flag in flutter test (a: tests, cla: yes, d: api docs, framework)
[37863](https://github.com/flutter/flutter/pull/37863) Expose the timeline event names so they can be used in other systems that do tracing (cla: yes, tool)
[37870](https://github.com/flutter/flutter/pull/37870) remove Header flag from BottomNavigationBar items (cla: yes, f: material design, framework, waiting for tree to go green)
[37871](https://github.com/flutter/flutter/pull/37871) Catch failure to create directory in cache (cla: yes, tool)
[37872](https://github.com/flutter/flutter/pull/37872) Unmark devicelab tests as flaky that are no longer flaky (cla: yes, team)
[37877](https://github.com/flutter/flutter/pull/37877) Adds DefaultTextStyle ancestor to Tooltip Overlay (cla: yes, f: material design, framework)
[37880](https://github.com/flutter/flutter/pull/37880) reduce mac workload (cla: yes)
[37881](https://github.com/flutter/flutter/pull/37881) Remove no-longer-needed scripts (cla: yes, team, waiting for tree to go green)
[37882](https://github.com/flutter/flutter/pull/37882) Add dense property to AboutListTile (cla: yes, f: material design, framework)
[37891](https://github.com/flutter/flutter/pull/37891) Focus debug (a: desktop, cla: yes, framework)
[37895](https://github.com/flutter/flutter/pull/37895) Revert "Add equals and hashCode to Tween" (cla: yes, framework)
[37900](https://github.com/flutter/flutter/pull/37900) Listen to ExtensionEvent instead of TimelineEvent (cla: yes, framework, tool)
[37904](https://github.com/flutter/flutter/pull/37904) test tool scheduling (cla: yes, team)
[37906](https://github.com/flutter/flutter/pull/37906) Always install the ephemeral engine copy instead of fetching from CocoaPods specs (a: existing-apps, cla: yes, team, tool, ⌺ platform-ios)
[37938](https://github.com/flutter/flutter/pull/37938) Revert "Adding physicalDepth to MediaQueryData & TestWindow" (a: tests, cla: yes, framework, waiting for tree to go green)
[37940](https://github.com/flutter/flutter/pull/37940) skip docs shard for changes that don't include packages with docs (cla: yes, team, tool)
[37941](https://github.com/flutter/flutter/pull/37941) Skip widget tests on non framework change (cla: yes, team)
[37955](https://github.com/flutter/flutter/pull/37955) Update shader warm-up for recent Skia changes (cla: yes, framework, severe: performance, severe: regression)
[37958](https://github.com/flutter/flutter/pull/37958) Catch FormatException caused by bad simctl output (cla: yes, tool)
[37964](https://github.com/flutter/flutter/pull/37964) Update documentation for bottom sheets to accurately reflect usage (cla: yes, f: material design, framework)
[37966](https://github.com/flutter/flutter/pull/37966) Remove ephemeral directories during flutter clean (a: existing-apps, cla: yes, tool)
[37971](https://github.com/flutter/flutter/pull/37971) Update dependencies (a: accessibility, cla: yes, d: examples, team, team: gallery)
[37981](https://github.com/flutter/flutter/pull/37981) Give `_runFlutterTest` the ability to validate command output (cla: yes, team)
[37983](https://github.com/flutter/flutter/pull/37983) Revert "Moved the default BinaryMessenger instance to ServicesBinding… (a: accessibility, a: tests, cla: yes, f: cupertino, f: material design, framework, team)
[37984](https://github.com/flutter/flutter/pull/37984) Fix some typos in flutter/dev/bots/README.md (cla: yes, team)
[37994](https://github.com/flutter/flutter/pull/37994) Remove no-constant-update-2018, the underlying issue has been resolved. (cla: yes, tool)
[38101](https://github.com/flutter/flutter/pull/38101) Catch filesystem exception from flutter create (cla: yes, tool)
[38102](https://github.com/flutter/flutter/pull/38102) Fix type error hidden by implicit downcasts (cla: yes, tool)
[38296](https://github.com/flutter/flutter/pull/38296) use common emulator/device list (cla: yes, t: flutter driver, tool, waiting for tree to go green)
[38325](https://github.com/flutter/flutter/pull/38325) refactor `flutter upgrade` to be 2 part, with the second part re-entrant (cla: yes, tool)
[38326](https://github.com/flutter/flutter/pull/38326) Re-enabling post-submit gold tests on mac (a: tests, cla: yes, framework)
[38339](https://github.com/flutter/flutter/pull/38339) [flutter_tool] Flip create language defaults to swift and kotlin (cla: yes, tool)
[38342](https://github.com/flutter/flutter/pull/38342) remove bsdiff from BUILD.gn (cla: yes, tool)
[38348](https://github.com/flutter/flutter/pull/38348) Analyzer fix that wasn't caught in the PR originally (cla: yes, d: examples, f: material design, team, team: gallery)
[38353](https://github.com/flutter/flutter/pull/38353) [flutter_tool] Observatory connection error handling cleanup (cla: yes, tool)
[38441](https://github.com/flutter/flutter/pull/38441) Fix getOffsetToReveal for growthDirection reversed and AxisDirection down or right (cla: yes, framework)
[38462](https://github.com/flutter/flutter/pull/38462) Revert "Roll engine ff49ca1c6e5b..7dfdfc6faeb6 (52 commits)" (cla: yes, engine)
[38463](https://github.com/flutter/flutter/pull/38463) Do not construct arguments to _focusDebug when running in non-debug modes (cla: yes, framework)
[38467](https://github.com/flutter/flutter/pull/38467) [Material] Add splashColor to FAB and FAB ThemeData (cla: yes, f: material design, framework)
[38472](https://github.com/flutter/flutter/pull/38472) [flutter_tool] Fix bug in manifest yaml validation (cla: yes, tool)
[38486](https://github.com/flutter/flutter/pull/38486) Catch errors thrown into the Zone by json_rpc (cla: yes, tool)
[38491](https://github.com/flutter/flutter/pull/38491) Update CONTRIBUTING.md (cla: yes, team)
[38494](https://github.com/flutter/flutter/pull/38494) Navigator change backup (a: tests, cla: yes, framework, ☸ platform-web)
[38495](https://github.com/flutter/flutter/pull/38495) Roll engine ff49ca1c6e5b..be4c8338a6ab (61 commits) (cla: yes, engine)
[38497](https://github.com/flutter/flutter/pull/38497) handle unexpected exit from frontend server (cla: yes, tool)
[38499](https://github.com/flutter/flutter/pull/38499) Update build web compilers and configure libraries (cla: yes, tool)
[38546](https://github.com/flutter/flutter/pull/38546) Re-land 'Adding physicalDepth to MediaQueryData & TestWindow' (a: tests, cla: yes, customer: fuchsia, framework, severe: customer critical)
[38558](https://github.com/flutter/flutter/pull/38558) Fix typos (and a few errors) in the API docs. (cla: yes, framework)
[38564](https://github.com/flutter/flutter/pull/38564) Updating code owners for golden file changes (a: tests, cla: yes, framework, team, will affect goldens)
[38567](https://github.com/flutter/flutter/pull/38567) Add smoke tests to test every commit on a Catalina host. (cla: yes, team)
[38575](https://github.com/flutter/flutter/pull/38575) fix rpc exception for real (cla: yes, tool)
[38579](https://github.com/flutter/flutter/pull/38579) Fix a smoke test. (cla: yes, team)
[38586](https://github.com/flutter/flutter/pull/38586) Don't reload if compilation has errors (cla: yes, tool)
[38587](https://github.com/flutter/flutter/pull/38587) Improve bitcode check (cla: yes, t: xcode, tool, ⌺ platform-ios)
[38593](https://github.com/flutter/flutter/pull/38593) Fix text scale factor for non-content components of Cupertino scaffolds (a: fidelity, cla: yes, f: cupertino, f: material design, framework)
[38603](https://github.com/flutter/flutter/pull/38603) Fix up iOS Add to App tests (a: existing-apps, a: tests, cla: yes, team, ⌺ platform-ios)
[38621](https://github.com/flutter/flutter/pull/38621) [Material] Create theme for Dividers to enable customization of thickness (cla: yes, f: material design, framework)
[38629](https://github.com/flutter/flutter/pull/38629) Handle case of a connected unpaired iOS device (cla: yes, tool)
[38635](https://github.com/flutter/flutter/pull/38635) Toggle buttons docs (cla: yes, d: api docs, f: material design, framework)
[38636](https://github.com/flutter/flutter/pull/38636) Adds the arrowColor option to UserAccountsDrawerHeader (#38608) (cla: yes, f: material design, framework)
[38637](https://github.com/flutter/flutter/pull/38637) [flutter_tool] Throw tool exit on malformed storage url override (cla: yes, tool)
[38639](https://github.com/flutter/flutter/pull/38639) PlatformViewLink. cached surface should be a Widget type (a: platform-views, cla: yes, framework)
[38645](https://github.com/flutter/flutter/pull/38645) Rename iOS arch for macOS release mode (macOS release mode 2 of 3) (cla: yes, tool)
[38651](https://github.com/flutter/flutter/pull/38651) Update the macOS Podfile template platform version (cla: yes, tool)
[38652](https://github.com/flutter/flutter/pull/38652) Kill dead code (cla: yes, team, tool)
[38658](https://github.com/flutter/flutter/pull/38658) Roll back engine to f8e7453f11067b5801a4484283592977d18be242 (cla: yes, engine)
[38662](https://github.com/flutter/flutter/pull/38662) Change from using `defaults` to `plutil` for Plist parsing (cla: yes, tool)
[38686](https://github.com/flutter/flutter/pull/38686) Rename patent file (cla: yes)
[38704](https://github.com/flutter/flutter/pull/38704) Adds canRequestFocus toggle to FocusNode (cla: yes, framework)
[38708](https://github.com/flutter/flutter/pull/38708) Fix Catalina hot reload test by specifying the platform is iOS. (cla: no, team)
[38710](https://github.com/flutter/flutter/pull/38710) PlatformViewLink: Rename CreatePlatformViewController to CreatePlatformViewCallback (a: platform-views, cla: yes, framework)
[38719](https://github.com/flutter/flutter/pull/38719) Fix stages of some iOS devicelab tests (cla: yes, team)
## PRs closed in this release of `flutter/engine`
From Fri Jun 21 22:31:55 2019 -0400 to Sun Aug 18 12:22:00 2019 -0700
[9041](https://github.com/flutter/engine/pull/9041) TextStyle.height property as a multiple of font size instead of multiple of ascent+descent+leading. (affects: text input, cla: yes, prod: API break)
[9075](https://github.com/flutter/engine/pull/9075) IOS Platform view transform/clipping (cla: yes)
[9089](https://github.com/flutter/engine/pull/9089) Wire up custom event loop interop for the GLFW embedder. (cla: yes)
[9206](https://github.com/flutter/engine/pull/9206) Android Embedding Refactor PR31: Integrate platform views with the new embedding and the plugin shim. (cla: yes)
[9329](https://github.com/flutter/engine/pull/9329) Fixed memory leak by way of accidental retain on implicit self (cla: yes)
[9341](https://github.com/flutter/engine/pull/9341) some drive-by docs while I was reading the embedding classes (cla: yes)
[9360](https://github.com/flutter/engine/pull/9360) Simplify loading of app bundles on Android (cla: yes)
[9403](https://github.com/flutter/engine/pull/9403) Remove variants of ParagraphBuilder::AddText that are not used within the engine (cla: yes)
[9419](https://github.com/flutter/engine/pull/9419) Has a binary messenger (cla: yes, prod: API break)
[9423](https://github.com/flutter/engine/pull/9423) Don't hang to a platform view's input connection after it's disposed (cla: yes)
[9424](https://github.com/flutter/engine/pull/9424) Send timings of the first frame without batching (cla: yes)
[9428](https://github.com/flutter/engine/pull/9428) Update README.md for consistency with framework (cla: yes)
[9431](https://github.com/flutter/engine/pull/9431) Generate weak pointers only in the platform thread (cla: yes)
[9436](https://github.com/flutter/engine/pull/9436) Add the functionality to merge and unmerge MessageLoopTaskQueues (cla: yes)
[9439](https://github.com/flutter/engine/pull/9439) Eliminate unused import in FlutterView (cla: yes)
[9446](https://github.com/flutter/engine/pull/9446) Revert "Roll fuchsia/sdk/core/mac-amd64 from Cx51F... to e8sS_..." (cla: yes)
[9449](https://github.com/flutter/engine/pull/9449) Revert "Roll fuchsia/sdk/core/linux-amd64 from udf6w... to jQ8aw..." (cla: yes)
[9450](https://github.com/flutter/engine/pull/9450) Revert "Roll fuchsia/sdk/core/mac-amd64 from Cx51F... to w-3t4..." (cla: yes)
[9452](https://github.com/flutter/engine/pull/9452) Convert RRect.scaleRadii to public method (affects: framework, cla: yes)
[9456](https://github.com/flutter/engine/pull/9456) Made sure that the run_tests script returns the right error code. (cla: yes)
[9458](https://github.com/flutter/engine/pull/9458) Test cleanup geometry_test.dart (affects: tests, cla: yes)
[9459](https://github.com/flutter/engine/pull/9459) Remove unused/unimplemented shell constructor (cla: yes)
[9460](https://github.com/flutter/engine/pull/9460) Fixed logLevel filter bug so that filter now works as expected. (cla: yes)
[9461](https://github.com/flutter/engine/pull/9461) Adds API for retaining intermediate engine layers (cla: yes)
[9462](https://github.com/flutter/engine/pull/9462) Reland Update harfbuzz to 2.5.2 (cla: yes)
[9463](https://github.com/flutter/engine/pull/9463) Removed unused imports in new embedding. (cla: yes)
[9464](https://github.com/flutter/engine/pull/9464) Added shebangs to ios unit test scripts. (cla: yes)
[9466](https://github.com/flutter/engine/pull/9466) Re-enable the Wuffs GIF decoder (cla: yes)
[9467](https://github.com/flutter/engine/pull/9467) ios-unit-tests: Forgot a usage of a variable in our script. (cla: yes)
[9468](https://github.com/flutter/engine/pull/9468) Manually draw remainder curve for wavy decorations (cla: yes)
[9469](https://github.com/flutter/engine/pull/9469) ios-unit-tests: Fixed ocmock system header search paths. (cla: yes)
[9471](https://github.com/flutter/engine/pull/9471) ios-unit-tests: Started using rsync instead of cp -R to copy frameworks. (cla: yes)
[9476](https://github.com/flutter/engine/pull/9476) fix NPE when a touch event is sent to an unknown Android platform view (cla: yes)
[9478](https://github.com/flutter/engine/pull/9478) iOS PlatformView clip path (cla: yes)
[9480](https://github.com/flutter/engine/pull/9480) Revert "IOS Platform view transform/clipping (#9075)" (cla: yes)
[9482](https://github.com/flutter/engine/pull/9482) Re-enable embedder_unittests. (cla: yes)
[9483](https://github.com/flutter/engine/pull/9483) Reland "IOS Platform view transform/clipping (#9075)" and fix the breakage. (cla: yes)
[9485](https://github.com/flutter/engine/pull/9485) Add --observatory-host switch (cla: yes)
[9486](https://github.com/flutter/engine/pull/9486) Rework image & texture management to use concurrent message queues. (cla: yes)
[9489](https://github.com/flutter/engine/pull/9489) Handle ambiguous directionality of final trailing whitespace in mixed bidi text (cla: yes)
[9490](https://github.com/flutter/engine/pull/9490) fix a bug where the platform view's transform is not reset before set frame (cla: yes)
[9491](https://github.com/flutter/engine/pull/9491) Purge caches on low memory on iOS (cla: yes)
[9493](https://github.com/flutter/engine/pull/9493) Run benchmarks on try jobs. (cla: yes)
[9495](https://github.com/flutter/engine/pull/9495) fix build breakage on PlatformViews.mm (cla: yes)
[9501](https://github.com/flutter/engine/pull/9501) [android] External textures must be rescaled to fill the canvas (cla: yes)
[9503](https://github.com/flutter/engine/pull/9503) Improve caching limits for Skia (cla: yes)
[9506](https://github.com/flutter/engine/pull/9506) Synchronize main thread and gpu thread for first render frame (cla: yes)
[9507](https://github.com/flutter/engine/pull/9507) Revert Skia version to d8f79a27b06b5bce7a27f89ce2d43d39f8c058dc (cla: yes)
[9508](https://github.com/flutter/engine/pull/9508) Support image filter on paint (cla: yes)
[9509](https://github.com/flutter/engine/pull/9509) Roll Fuchsia SDK to latest (cla: yes)
[9518](https://github.com/flutter/engine/pull/9518) Bump dart_resource_rev to f8e37558a1c4f54550aa463b88a6a831e3e33cd6 (cla: yes)
[9525](https://github.com/flutter/engine/pull/9525) Android Embedding Refactor PR36: Add splash screen support. (cla: yes)
[9532](https://github.com/flutter/engine/pull/9532) fix FlutterOverlayView doesn't remove from superview in some cases (cla: yes)
[9546](https://github.com/flutter/engine/pull/9546) [all] add fuchsia.{net.NameLookup,posix.socket.Provider} (cla: yes)
[9556](https://github.com/flutter/engine/pull/9556) Minimal integration with the Skia text shaper module (cla: yes)
[9559](https://github.com/flutter/engine/pull/9559) Roll src/third_party/dart b37aa3b036...1eb113ba27 (cla: yes)
[9561](https://github.com/flutter/engine/pull/9561) libtxt: fix reference counting of SkFontStyleSets held by font asset providers (cla: yes)
[9562](https://github.com/flutter/engine/pull/9562) Switched preprocessor logic for exporting symbols for testing. (cla: yes)
[9581](https://github.com/flutter/engine/pull/9581) Revert "Avoid a full screen overlay within virtual displays" (cla: yes)
[9584](https://github.com/flutter/engine/pull/9584) Revert " Roll src/third_party/dart b37aa3b036...1eb113ba27" (cla: yes)
[9585](https://github.com/flutter/engine/pull/9585) Fix a race in the embedder accessibility unit test (cla: yes)
[9588](https://github.com/flutter/engine/pull/9588) Roll src/third_party/dart b37aa3b036...0abff7b2bb (cla: yes)
[9589](https://github.com/flutter/engine/pull/9589) Fixes a plugin overwrite bug in the plugin shim system. (cla: yes)
[9590](https://github.com/flutter/engine/pull/9590) Apply patches that have landed in topaz since we ported the runners to the engine repo (cla: yes)
[9591](https://github.com/flutter/engine/pull/9591) Document various classes in //flutter/shell/common. (cla: yes)
[9593](https://github.com/flutter/engine/pull/9593) [trace clients] Remove fuchsia.tracelink.Registry (cla: yes)
[9608](https://github.com/flutter/engine/pull/9608) Disable failing Mutators tests (cla: yes)
[9613](https://github.com/flutter/engine/pull/9613) Fix uninitialized variables and put tests in flutter namespace. (cla: yes)
[9632](https://github.com/flutter/engine/pull/9632) Added Doxyfile. (cla: yes)
[9633](https://github.com/flutter/engine/pull/9633) Cherry-pick fix for flutter/flutter#35291 (cla: yes)
[9634](https://github.com/flutter/engine/pull/9634) Roll Dart to 67ab3be10d35d994641da167cc806f20a7ffa679 (cla: yes)
[9636](https://github.com/flutter/engine/pull/9636) Added shebangs to ios unit test scripts. (#9464) (cla: yes)
[9637](https://github.com/flutter/engine/pull/9637) Revert "Roll Dart to 67ab3be10d35d994641da167cc806f20a7ffa679 (#9634)" (cla: yes)
[9638](https://github.com/flutter/engine/pull/9638) Reland: Roll Dart to 67ab3be10d35d994641da167cc806f20a7ffa679 (cla: yes)
[9640](https://github.com/flutter/engine/pull/9640) make EmbeddedViewParams a unique ptr (cla: yes)
[9641](https://github.com/flutter/engine/pull/9641) Let pushColorFilter accept all types of ColorFilters (cla: yes)
[9642](https://github.com/flutter/engine/pull/9642) Fix warning about settings unavailable GN arg build_glfw_shell (cla: yes)
[9649](https://github.com/flutter/engine/pull/9649) Roll buildroot to c5a493b25. (cla: yes)
[9651](https://github.com/flutter/engine/pull/9651) Move the mutators stack handling to preroll (cla: yes)
[9652](https://github.com/flutter/engine/pull/9652) Pipeline allows continuations that can produce to front (cla: yes)
[9653](https://github.com/flutter/engine/pull/9653) External view embedder can tell if embedded views have mutated (cla: yes)
[9654](https://github.com/flutter/engine/pull/9654) Begin separating macOS engine from view controller (cla: yes)
[9655](https://github.com/flutter/engine/pull/9655) Allow embedders to add callbacks for responses to platform messages from the framework. (cla: yes)
[9660](https://github.com/flutter/engine/pull/9660) ExternalViewEmbedder can CancelFrame after pre-roll (cla: yes)
[9661](https://github.com/flutter/engine/pull/9661) Raster now returns an enum rather than boolean (cla: yes)
[9663](https://github.com/flutter/engine/pull/9663) Mutators Stack refactoring (cla: yes)
[9667](https://github.com/flutter/engine/pull/9667) iOS platform view opacity (cla: yes)
[9668](https://github.com/flutter/engine/pull/9668) Refactor ColorFilter to have a native wrapper (cla: yes)
[9669](https://github.com/flutter/engine/pull/9669) Improve window documentation (cla: yes)
[9670](https://github.com/flutter/engine/pull/9670) Roll src/third_party/dart 67ab3be10d...43891316ca (cla: yes)
[9672](https://github.com/flutter/engine/pull/9672) Add FLEDartProject for macOS embedding (cla: yes)
[9673](https://github.com/flutter/engine/pull/9673) Revert " Roll src/third_party/dart 67ab3be10d...43891316ca" (cla: yes)
[9675](https://github.com/flutter/engine/pull/9675) Roll src/third_party/dart 67ab3be10d...b5aeaa6796 (cla: yes)
[9685](https://github.com/flutter/engine/pull/9685) fix Picture.toImage return type check and api conform test. (cla: yes)
[9698](https://github.com/flutter/engine/pull/9698) Ensure that platform messages without response handles can be dispatched. (cla: yes)
[9707](https://github.com/flutter/engine/pull/9707) Revert "Revert "Use track-widget-creation transformer included in the… (cla: yes)
[9708](https://github.com/flutter/engine/pull/9708) Roll src/third_party/dart b5aeaa6796...966038ef58 (cla: yes)
[9711](https://github.com/flutter/engine/pull/9711) Revert "Roll src/third_party/dart b5aeaa6796...966038ef58" (cla: yes)
[9713](https://github.com/flutter/engine/pull/9713) Explain why OpacityLayer has an offset field (cla: yes)
[9716](https://github.com/flutter/engine/pull/9716) Roll src/third_party/dart b5aeaa6796..06c3d7ad3a (44 commits) (cla: yes)
[9717](https://github.com/flutter/engine/pull/9717) Fixed logLevel filter bug so that filter now works as expected. (#9460) (cla: yes)
[9721](https://github.com/flutter/engine/pull/9721) Add comments to differentiate two cache paths (cla: yes)
[9722](https://github.com/flutter/engine/pull/9722) Forwards iOS dark mode trait to the Flutter framework (#34441). (cla: yes)
[9723](https://github.com/flutter/engine/pull/9723) Roll src/third_party/dart 06c3d7ad3a..7acecda2cc (12 commits) (cla: yes)
[9724](https://github.com/flutter/engine/pull/9724) Revert "Roll src/third_party/dart 06c3d7ad3a..7acecda2cc (12 commits)")
[9725](https://github.com/flutter/engine/pull/9725) Make the license script compatible with recently changed Dart I/O stream APIs (cla: yes)
[9727](https://github.com/flutter/engine/pull/9727) Add hooks for InputConnection lock and unlocking (cla: yes)
[9728](https://github.com/flutter/engine/pull/9728) Roll src/third_party/dart 06c3d7ad3a...09fc76bc51 (cla: yes)
[9730](https://github.com/flutter/engine/pull/9730) Fix Fuchsia build. (cla: yes)
[9734](https://github.com/flutter/engine/pull/9734) Fix backspace crash on Chinese devices (cla: yes)
[9736](https://github.com/flutter/engine/pull/9736) Build Fuchsia as part of CI presumit (cla: yes)
[9737](https://github.com/flutter/engine/pull/9737) Use libc++ variant of string view and remove the FML variant. (cla: yes)
[9740](https://github.com/flutter/engine/pull/9740) Revert "Improve caching limits for Skia" (cla: yes)
[9741](https://github.com/flutter/engine/pull/9741) Make FLEViewController's view an internal detail (cla: yes)
[9745](https://github.com/flutter/engine/pull/9745) Fix windows test by not attempting to open a directory as a file. (cla: yes)
[9746](https://github.com/flutter/engine/pull/9746) Make all shell unit tests use the OpenGL rasterizer. (cla: yes)
[9747](https://github.com/flutter/engine/pull/9747) Remove get engine (cla: yes)
[9750](https://github.com/flutter/engine/pull/9750) FLEViewController/Engine API changes (cla: yes)
[9758](https://github.com/flutter/engine/pull/9758) Include SkParagraph headers only when the enable-skshaper flag is on (cla: yes)
[9762](https://github.com/flutter/engine/pull/9762) Fall back to a fully qualified path to libapp.so if the library can not be loaded by name (cla: yes)
[9767](https://github.com/flutter/engine/pull/9767) Un-deprecated FlutterViewController's binaryMessenger. (cla: yes)
[9769](https://github.com/flutter/engine/pull/9769) Document //flutter/shell/common/engine. (cla: yes)
[9772](https://github.com/flutter/engine/pull/9772) fix objcdoc generation (cla: yes)
[9781](https://github.com/flutter/engine/pull/9781) SendPlatformMessage allow null message value (cla: yes)
[9787](https://github.com/flutter/engine/pull/9787) Roll src/third_party/dart 09fc76bc51..24725a8559 (43 commits) (cla: yes)
[9789](https://github.com/flutter/engine/pull/9789) fix ColorFilter.matrix constness (cla: yes)
[9791](https://github.com/flutter/engine/pull/9791) Roll Wuffs and buildroot (cla: yes)
[9792](https://github.com/flutter/engine/pull/9792) Update flutter_web to latest (cla: yes)
[9793](https://github.com/flutter/engine/pull/9793) Fix typo in PlaceholderAlignment docs (cla: yes)
[9797](https://github.com/flutter/engine/pull/9797) Remove breaking asserts (cla: yes)
[9799](https://github.com/flutter/engine/pull/9799) Update buildroot to c4df4a7b to pull in MSVC 2017 Update 9 on Windows. (cla: yes)
[9808](https://github.com/flutter/engine/pull/9808) Document FontFeature class (cla: yes)
[9809](https://github.com/flutter/engine/pull/9809) Document //flutter/shell/common/rasterizer (cla: yes)
[9812](https://github.com/flutter/engine/pull/9812) Roll src/third_party/dart 24725a8559..28f95fcd24 (32 commits) (cla: yes)
[9813](https://github.com/flutter/engine/pull/9813) Made Picture::toImage happen on the IO thread with no need for an onscreen surface. (cla: yes)
[9815](https://github.com/flutter/engine/pull/9815) Made the persistent cache's directory a const pointer. (cla: yes)
[9816](https://github.com/flutter/engine/pull/9816) Only release the image data in the unit-test once Skia has accepted ownership of it. (cla: yes)
[9817](https://github.com/flutter/engine/pull/9817) Revert "Roll src/third_party/dart 24725a8559..28f95fcd24 (32 commits)" (cla: yes)
[9818](https://github.com/flutter/engine/pull/9818) Convert run_tests to python, allow running on Mac/Windows and allow filters for tests. (cla: yes)
[9819](https://github.com/flutter/engine/pull/9819) Allow for dynamic thread merging on IOS for embedded view mutations (cla: yes)
[9823](https://github.com/flutter/engine/pull/9823) Roll buildroot to support bitcode enabled builds for iOS (cla: yes)
[9825](https://github.com/flutter/engine/pull/9825) In a single frame codec, release the encoded image buffer after giving it to the decoder (cla: yes)
[9826](https://github.com/flutter/engine/pull/9826) Roll src/third_party/dart 24725a8559..cbaf890f88 (33 commits) (cla: yes)
[9828](https://github.com/flutter/engine/pull/9828) Make the virtual display's window translucent (cla: yes)
[9829](https://github.com/flutter/engine/pull/9829) Revert "Roll src/third_party/dart 24725a8559..cbaf890f88 (33 commits)" (cla: yes)
[9835](https://github.com/flutter/engine/pull/9835) [Windows] Alternative Windows shell platform implementation (affects: desktop, cla: yes, waiting for tree to go green)
[9847](https://github.com/flutter/engine/pull/9847) Started adding the engine hash to frameworks' Info.plist. (cla: yes)
[9849](https://github.com/flutter/engine/pull/9849) Preserve the alpha for VD content by setting a transparent background. (cla: yes)
[9850](https://github.com/flutter/engine/pull/9850) Add multi-line flag to semantics (cla: yes)
[9851](https://github.com/flutter/engine/pull/9851) Add a macro for prefixing embedder.h symbols (cla: yes)
[9852](https://github.com/flutter/engine/pull/9852) Selectively enable tests that work on Windows and file issues for ones that don't. (cla: yes)
[9855](https://github.com/flutter/engine/pull/9855) Fix missing assignment to _allowHeadlessExecution (cla: yes)
[9856](https://github.com/flutter/engine/pull/9856) Disable Fuchsia Debug & Release presubmits and only attempt the Profile unopt variant. (cla: yes)
[9857](https://github.com/flutter/engine/pull/9857) Fix fuchsia license detection (cla: yes)
[9859](https://github.com/flutter/engine/pull/9859) Fix justify for RTL paragraphs. (cla: yes, waiting for tree to go green)
[9866](https://github.com/flutter/engine/pull/9866) Update buildroot to pick up Fuchsia artifact roller. (cla: yes)
[9867](https://github.com/flutter/engine/pull/9867) Fixed error in generated xml Info.plist. (cla: yes)
[9873](https://github.com/flutter/engine/pull/9873) Add clang version to Info.plist (cla: yes)
[9875](https://github.com/flutter/engine/pull/9875) Simplify buildtools (cla: yes)
[9883](https://github.com/flutter/engine/pull/9883) Roll src/third_party/dart 24725a8559..2b3336b51e (108 commits) (cla: yes)
[9890](https://github.com/flutter/engine/pull/9890) Log dlopen errors only in debug mode (cla: yes)
[9893](https://github.com/flutter/engine/pull/9893) Removed logic from FlutterAppDelegate into FlutterPluginAppLifeCycleDelegate (cla: yes)
[9894](https://github.com/flutter/engine/pull/9894) Add the isMultiline semantics flag to values (cla: yes)
[9895](https://github.com/flutter/engine/pull/9895) Android Embedding PR37: Separated FlutterActivity and FlutterFragment via FlutterActivityAndFragmentDelegate (cla: yes)
[9896](https://github.com/flutter/engine/pull/9896) Capture stderr for ninja command (cla: yes)
[9898](https://github.com/flutter/engine/pull/9898) v1.7.8 hotfixes (cla: yes)
[9901](https://github.com/flutter/engine/pull/9901) Handle decompressed images in InstantiateImageCodec (cla: yes)
[9903](https://github.com/flutter/engine/pull/9903) Revert to using fml::StringView instead of std::string_view (cla: yes)
[9905](https://github.com/flutter/engine/pull/9905) Respect EXIF information while decompressing images. (cla: yes)
[9906](https://github.com/flutter/engine/pull/9906) Update libcxx & libcxxabi to HEAD in prep for compiler upgrade. (cla: yes)
[9909](https://github.com/flutter/engine/pull/9909) Roll src/third_party/dart 6bf1f8e280..63120303a7 (4 commits) (cla: yes)
[9919](https://github.com/flutter/engine/pull/9919) Removed unused method. (cla: yes)
[9920](https://github.com/flutter/engine/pull/9920) Fix caching of Locale.toString (cla: yes)
[9922](https://github.com/flutter/engine/pull/9922) Split out lifecycle protocol (cla: yes)
[9923](https://github.com/flutter/engine/pull/9923) Fix failure of the onReportTimings window hook test (cla: yes)
[9924](https://github.com/flutter/engine/pull/9924) Don't try to use unset assets_dir setting (cla: yes)
[9925](https://github.com/flutter/engine/pull/9925) Fix the geometry test to reflect that OffsetBase comparison operators are a partial ordering (cla: yes)
[9927](https://github.com/flutter/engine/pull/9927) Update Buildroot Version (cla: yes)
[9929](https://github.com/flutter/engine/pull/9929) Update the exception thrown for invalid data in the codec test (cla: yes)
[9931](https://github.com/flutter/engine/pull/9931) Fix reentrancy handling in SingleFrameCodec (cla: yes)
[9932](https://github.com/flutter/engine/pull/9932) Exit flutter_tester with an error code on an unhandled exception (cla: yes)
[9933](https://github.com/flutter/engine/pull/9933) Build fuchsia artifacts from the engine (cla: yes)
[9934](https://github.com/flutter/engine/pull/9934) Updates to the engine test runner script (cla: yes)
[9935](https://github.com/flutter/engine/pull/9935) Fix backspace crash on Chinese devices (#9734) (cla: yes)
[9936](https://github.com/flutter/engine/pull/9936) Move development.key from buildroot (cla: yes)
[9937](https://github.com/flutter/engine/pull/9937) [platform view] do not make clipping view and interceptor view clipToBounds (cla: yes)
[9938](https://github.com/flutter/engine/pull/9938) Removed PlatformViewsController if-statements from TextInputPlugin (#34286). (cla: yes)
[9939](https://github.com/flutter/engine/pull/9939) Added hasRenderedFirstFrame() to old FlutterView for Espresso (#36211). (cla: yes)
[9948](https://github.com/flutter/engine/pull/9948) [glfw] Enables replies on binary messenger in glfw embedder (cla: yes)
[9951](https://github.com/flutter/engine/pull/9951) Roll src/third_party/dart 63120303a7...a089199b93 (cla: yes)
[9952](https://github.com/flutter/engine/pull/9952) ios: Fixed the callback for the first frame so that it isn't predicated on having a splash screen. (cla: yes)
[9953](https://github.com/flutter/engine/pull/9953) [macos] Add reply to binary messenger (cla: yes)
[9954](https://github.com/flutter/engine/pull/9954) Add working Robolectric tests (cla: yes)
[9958](https://github.com/flutter/engine/pull/9958) Clean up cirrus.yml file a little (cla: yes)
[9959](https://github.com/flutter/engine/pull/9959) Update Dart engine tests to check for assertion failures only when running in debug mode (cla: yes)
[9961](https://github.com/flutter/engine/pull/9961) Fix return type of assert function in gradient_test (cla: yes)
[9977](https://github.com/flutter/engine/pull/9977) Fix flutter/flutter #34791 (cla: yes, platform-android)
[9987](https://github.com/flutter/engine/pull/9987) Update GN to git_revision:152c5144ceed9592c20f0c8fd55769646077569b (cla: yes)
[9998](https://github.com/flutter/engine/pull/9998) [luci] Reference the right fuchsia CIPD and upload only once (cla: yes)
[9999](https://github.com/flutter/engine/pull/9999) Add support for Android's visible password input type (affects: text input, cla: yes)
[10001](https://github.com/flutter/engine/pull/10001) Roll src/third_party/dart a089199b93..fedd74669a (8 commits) (cla: yes)
[10003](https://github.com/flutter/engine/pull/10003) Declare a copy of the enable_bitcode flag within the Flutter build scripts for use in Fuchsia builds (cla: yes)
[10004](https://github.com/flutter/engine/pull/10004) [fuchsia] Use GatherArtifacts to create the requisite dir structure (cla: yes)
[10007](https://github.com/flutter/engine/pull/10007) Embedding testing app (cla: yes)
[10009](https://github.com/flutter/engine/pull/10009) [macos] Revert check on FlutterCodecs and refactor message function] (cla: yes)
[10010](https://github.com/flutter/engine/pull/10010) Use simarm_x64 when targeting arm (cla: yes)
[10012](https://github.com/flutter/engine/pull/10012) Undelete used method (cla: yes)
[10021](https://github.com/flutter/engine/pull/10021) Added a DartExecutor API for querying # of pending channel callbacks (cla: yes)
[10056](https://github.com/flutter/engine/pull/10056) Update .cirrus.yml (cla: yes)
[10063](https://github.com/flutter/engine/pull/10063) Track clusters and return cluster boundaries in getGlyphPositionForCoordinates (emoji fix) (affects: text input, cla: yes, crash)
[10064](https://github.com/flutter/engine/pull/10064) Disable DartLifecycleTest::ShuttingDownTheVMShutsDownAllIsolates in runtime_unittests. (cla: yes)
[10065](https://github.com/flutter/engine/pull/10065) test scenario_app on CI (cla: yes)
[10066](https://github.com/flutter/engine/pull/10066) Roll src/third_party/dart fedd74669a..9c148623c5 (70 commits) (cla: yes)
[10068](https://github.com/flutter/engine/pull/10068) Fixed memory leak with engine registrars. (cla: yes)
[10069](https://github.com/flutter/engine/pull/10069) Enable consts from environment in DDK for flutter_web (cla: yes)
[10073](https://github.com/flutter/engine/pull/10073) Basic structure for flutter_jit_runner far (cla: yes)
[10074](https://github.com/flutter/engine/pull/10074) Change ParagraphBuilder to replace the parent style's font families with the child style's font families (cla: yes)
[10075](https://github.com/flutter/engine/pull/10075) Change flutter runner target for LUCI (cla: yes)
[10078](https://github.com/flutter/engine/pull/10078) One more luci fix (cla: yes)
[10081](https://github.com/flutter/engine/pull/10081) [fuchsia] Add support for libs in packages (cla: yes)
[10082](https://github.com/flutter/engine/pull/10082) [fuchsia] Add sysroot and clang libs to package (cla: yes)
[10085](https://github.com/flutter/engine/pull/10085) [fuchsia] Use the new far package model (cla: yes)
[10087](https://github.com/flutter/engine/pull/10087) [fuchsia] copy over the cmx file (cla: yes)
[10096](https://github.com/flutter/engine/pull/10096) Roll src/third_party/skia 3ae30cc2e6e0..1cd1ed8976c4 (1 commits) (autoroller: dryrun, cla: yes)
[10097](https://github.com/flutter/engine/pull/10097) Roll src/third_party/skia 1cd1ed8976c4..f564f1515bde (1 commits) (autoroller: dryrun, cla: yes)
[10098](https://github.com/flutter/engine/pull/10098) Roll src/third_party/dart 9c148623c5..82f657d7cb (25 commits) (cla: yes)
[10100](https://github.com/flutter/engine/pull/10100) Roll src/third_party/skia f564f1515bde..fdf4bfe6d389 (1 commits) (autoroller: dryrun, cla: yes)
[10101](https://github.com/flutter/engine/pull/10101) Roll src/third_party/skia fdf4bfe6d389..b3956dc6ba6a (1 commits) (autoroller: dryrun, cla: yes)
[10102](https://github.com/flutter/engine/pull/10102) [fuchsia] Use manifest file to better replicate the existing build (cla: yes)
[10109](https://github.com/flutter/engine/pull/10109) Cache font family lookups that fail to obtain a font collection (cla: yes)
[10114](https://github.com/flutter/engine/pull/10114) Roll src/third_party/dart 82f657d7cb..0c97c31b6e (7 commits) (cla: yes)
[10122](https://github.com/flutter/engine/pull/10122) [fuchsia] Use the patched sdk to generate the flutter jit runner far (cla: yes)
[10127](https://github.com/flutter/engine/pull/10127) Track detailed LibTxt metrics (cla: yes)
[10128](https://github.com/flutter/engine/pull/10128) Started linking the test targets against Flutter. (cla: yes)
[10139](https://github.com/flutter/engine/pull/10139) Roll src/third_party/dart 0c97c31b6e..a2aec5eb06 (22 commits) (cla: yes)
[10140](https://github.com/flutter/engine/pull/10140) Revert "[fuchsia] Use the patched sdk to generate the flutter jit run… (cla: yes)
[10141](https://github.com/flutter/engine/pull/10141) Revert "[macos] Revert check on FlutterCodecs and refactor message fu… (cla: yes)
[10143](https://github.com/flutter/engine/pull/10143) Disable windows tests (cla: yes)
[10144](https://github.com/flutter/engine/pull/10144) [fuchsia] Push CMX to fars and add product mode support (cla: yes)
[10145](https://github.com/flutter/engine/pull/10145) Added integration test that tests that the first frame callback is called (cla: yes)
[10146](https://github.com/flutter/engine/pull/10146) Revert "Disable windows tests" (cla: yes)
[10150](https://github.com/flutter/engine/pull/10150) [fuchsia] Remove extraneous ShapeNodes (cla: yes)
[10151](https://github.com/flutter/engine/pull/10151) [fucshia] fix name to reflect the cmx file (cla: yes)
[10153](https://github.com/flutter/engine/pull/10153) Add gclient_gn_args_file to DEPS (cla: yes)
[10155](https://github.com/flutter/engine/pull/10155) src/third_party/dart a2aec5eb06...86dba81dec (cla: yes)
[10160](https://github.com/flutter/engine/pull/10160) Roll src/third_party/dart 86dba81dec..0ca1582afd (2 commits) (cla: yes)
[10171](https://github.com/flutter/engine/pull/10171) [fuchsia] Add support for aot mode in flutter runner (cla: yes)
[10172](https://github.com/flutter/engine/pull/10172) [dart_runner] Rename dart to dart runner (cla: yes)
[10176](https://github.com/flutter/engine/pull/10176) Add suggested Java changes from flutter roll (cla: yes, platform-android)
[10178](https://github.com/flutter/engine/pull/10178) Removed unnecessary call to find the App.framework. (cla: yes)
[10179](https://github.com/flutter/engine/pull/10179) [dart_runner] dart jit runner and dart jit product runner (cla: yes)
[10183](https://github.com/flutter/engine/pull/10183) [fuchsia] Uncomment publish to CIPD (cla: yes)
[10185](https://github.com/flutter/engine/pull/10185) Add better CIPD docs. (cla: yes)
[10186](https://github.com/flutter/engine/pull/10186) Ensure debug-mode apps are always attached on iOS. (cla: yes)
[10188](https://github.com/flutter/engine/pull/10188) [fuchsia] Artifacts now contain gen_snapshot and gen_snapshot_product (cla: yes)
[10189](https://github.com/flutter/engine/pull/10189) [macos] Reland function refactor (cla: yes)
[10195](https://github.com/flutter/engine/pull/10195) Allow embedder controlled composition of Flutter layers. (cla: yes)
[10226](https://github.com/flutter/engine/pull/10226) Roll src/third_party/dart 0ca1582afd..1e43d65d4a (50 commits) (cla: yes)
[10235](https://github.com/flutter/engine/pull/10235) Deprecate FlutterView#enableTransparentBackground (cla: yes)
[10240](https://github.com/flutter/engine/pull/10240) [fuchsia] Update buildroot to support arm64 (cla: yes)
[10242](https://github.com/flutter/engine/pull/10242) Remove Dead Scenic Clipping Code Path. (cla: yes)
[10246](https://github.com/flutter/engine/pull/10246) [fuchsia] Start building dart_patched_sdk (cla: yes)
[10250](https://github.com/flutter/engine/pull/10250) Android Embedding Refactor 38: Removed AssetManager from DartEntrypoint. (cla: yes)
[10260](https://github.com/flutter/engine/pull/10260) [fuchsia] Add arm64 builds for flutter and dart runner (cla: yes)
[10261](https://github.com/flutter/engine/pull/10261) [fuchsia] Bundle architecture specific gen_snapshots (cla: yes)
[10265](https://github.com/flutter/engine/pull/10265) [dart-roll] Roll dart sdk to 80c4954d4d1d2a257005793d83b601f3ff2997a2 (cla: yes)
[10268](https://github.com/flutter/engine/pull/10268) [fuchsia] Make cirrus build fuchsia artifacts (cla: yes)
[10273](https://github.com/flutter/engine/pull/10273) Remove one last final call to AddPart() (cla: yes)
[10282](https://github.com/flutter/engine/pull/10282) Export FFI from sky_engine. (cla: yes)
[10293](https://github.com/flutter/engine/pull/10293) Add fuchsia.stamp for roller (cla: yes)
[10294](https://github.com/flutter/engine/pull/10294) Roll src/third_party/dart 80c4954d4d..bd049f5b53 (37 commits) (cla: yes)
[10295](https://github.com/flutter/engine/pull/10295) Fix memory overrun in minikin patch (cla: yes, crash)
[10296](https://github.com/flutter/engine/pull/10296) fix CI (cla: yes)
[10297](https://github.com/flutter/engine/pull/10297) Ensure that the SingleFrameCodec stays alive until the ImageDecoder invokes its callback (cla: yes)
[10298](https://github.com/flutter/engine/pull/10298) Fix red build again (cla: yes)
[10303](https://github.com/flutter/engine/pull/10303) Make tree green for real this time, I promise. (cla: yes)
[10309](https://github.com/flutter/engine/pull/10309) [fuchsia] Kernel compiler is now ready (cla: yes)
[10381](https://github.com/flutter/engine/pull/10381) Fix empty composing range on iOS (cla: yes)
[10386](https://github.com/flutter/engine/pull/10386) Don't use DBC for hot-reload on iOS. (cla: yes)
[10403](https://github.com/flutter/engine/pull/10403) [fuchsia] Add kernel compiler target (cla: yes)
[10413](https://github.com/flutter/engine/pull/10413) Pass Android Q insets.systemGestureInsets to Window (cla: yes, platform-android)
[10414](https://github.com/flutter/engine/pull/10414) expose max depth on Window (cla: yes)
[10419](https://github.com/flutter/engine/pull/10419) Make kernel compiler use host toolchain (cla: yes)
[10423](https://github.com/flutter/engine/pull/10423) Fix mac gen_snapshot uploader (cla: yes)
[10424](https://github.com/flutter/engine/pull/10424) Fix deprecation warnings in the Android embedding (cla: yes)
[10430](https://github.com/flutter/engine/pull/10430) Add copy_gen_snapshots.py tool (cla: yes)
[10434](https://github.com/flutter/engine/pull/10434) Reland Skia Caching improvements (cla: yes)
[10437](https://github.com/flutter/engine/pull/10437) Roll src/third_party/dart bd049f5b53...622ec5099f (cla: yes)
[10440](https://github.com/flutter/engine/pull/10440) Revert "Remove one last final call to AddPart()" (cla: yes)
[10475](https://github.com/flutter/engine/pull/10475) Roll src/third_party/dart 622ec5099f...9bb446aae1 (14 commits) (cla: yes)
[10477](https://github.com/flutter/engine/pull/10477) Add #else, #endif condition comments (cla: yes)
[10478](https://github.com/flutter/engine/pull/10478) Migrate Fuchsia runners to SDK tracing API (cla: yes)
[10479](https://github.com/flutter/engine/pull/10479) Delete unused create_macos_gen_snapshot.py script (cla: yes)
[10481](https://github.com/flutter/engine/pull/10481) Android embedding refactor pr40 add static engine cache (cla: yes)
[10484](https://github.com/flutter/engine/pull/10484) Roll src/third_party/dart 9bb446aae1...4bebfebdbc (7 commits). (cla: yes)
[10485](https://github.com/flutter/engine/pull/10485) Remove semi-redundant try-jobs. (cla: yes)
[10629](https://github.com/flutter/engine/pull/10629) Fix engine platformviewscontroller leak (cla: yes)
[10633](https://github.com/flutter/engine/pull/10633) skip flaky tests (cla: yes)
[10634](https://github.com/flutter/engine/pull/10634) Use Fuchsia trace macros when targeting Fuchsia SDK (cla: yes)
[10635](https://github.com/flutter/engine/pull/10635) [fuchsia] CloneChannelFromFD fix for system.cc (cla: yes)
[10636](https://github.com/flutter/engine/pull/10636) Fix threading and re-enable resource cache shell unit-tests. (cla: yes)
[10637](https://github.com/flutter/engine/pull/10637) Document the thread test fixture. (cla: yes)
[10642](https://github.com/flutter/engine/pull/10642) Roll src/third_party/dart 4bebfebdbc..8cd01287b4 (30 commits) (cla: yes)
[10644](https://github.com/flutter/engine/pull/10644) [flutter_runner] Port: Add connectToService, wrapping fdio_ns_connect. (cla: yes)
[10645](https://github.com/flutter/engine/pull/10645) Don't use DBC for hot-reload on iOS. (cla: yes)
[10652](https://github.com/flutter/engine/pull/10652) Allow embedders to control Dart VM lifecycle on engine shutdown. (cla: yes)
[10656](https://github.com/flutter/engine/pull/10656) fix iOS keyboard crash : -[__NSCFString substringWithRange:], range o… (cla: yes)
[10662](https://github.com/flutter/engine/pull/10662) bump local podspec's ios deployment target version from 7.0 to 8.0 (cla: yes)
[10663](https://github.com/flutter/engine/pull/10663) Roll src/third_party/dart 8cd01287b4..574c4a51c6 (35 commits) (cla: yes)
[10667](https://github.com/flutter/engine/pull/10667) Roll buildroot for ANGLE support (cla: yes)
[10671](https://github.com/flutter/engine/pull/10671) Roll src/third_party/dart 574c4a51c6..c262cbd414 (11 commits) (cla: yes)
[10674](https://github.com/flutter/engine/pull/10674) When setting up AOT snapshots from symbol references, make buffer sizes optional. (cla: yes)
[10675](https://github.com/flutter/engine/pull/10675) Improvements to the flutter GDB script (cla: yes)
[10679](https://github.com/flutter/engine/pull/10679) Roll buildroot to pick up EGL library name fix (cla: yes)
[10681](https://github.com/flutter/engine/pull/10681) Roll buildroot back to an earlier version (cla: yes)
[10682](https://github.com/flutter/engine/pull/10682) Roll src/third_party/dart c262cbd414..8740bb5c68 (18 commits) (cla: yes)
[10687](https://github.com/flutter/engine/pull/10687) Roll src/third_party/dart 8740bb5c68..f3139f57b4 (7 commits) (cla: yes)
[10692](https://github.com/flutter/engine/pull/10692) Rolls engine to Android SDK 29 and its corresponding tools (cla: yes)
[10693](https://github.com/flutter/engine/pull/10693) Roll src/third_party/dart f3139f57b4..f29f41f1a5 (3 commits) (cla: yes)
[10694](https://github.com/flutter/engine/pull/10694) Roll buildroot (cla: yes)
[10699](https://github.com/flutter/engine/pull/10699) Roll swiftshader (cla: yes)
[10700](https://github.com/flutter/engine/pull/10700) [fuchsia] Migrate from custom FuchsiaFontManager to SkFontMgr_fuchsia (cla: yes)
[10703](https://github.com/flutter/engine/pull/10703) Test perf overlay gold on Linux (cla: yes)
[10705](https://github.com/flutter/engine/pull/10705) Revert "Remove semi-redundant try-jobs. (#10485)" (cla: yes)
[10717](https://github.com/flutter/engine/pull/10717) Specify which android variant for tests (cla: yes, waiting for tree to go green)
[10719](https://github.com/flutter/engine/pull/10719) Include Maven dependency in files.json (cla: yes)
[10771](https://github.com/flutter/engine/pull/10771) Don't use gradle daemon for building (cla: yes, waiting for tree to go green)
[10773](https://github.com/flutter/engine/pull/10773) Remove use of the deprecated AccessibilityNodeInfo boundsInParent API (cla: yes)
[10774](https://github.com/flutter/engine/pull/10774) Manual roll of Fuchsia clang/linux-amd64 toolchain (cla: yes)
[10776](https://github.com/flutter/engine/pull/10776) rename stub_ui to web_ui (cla: yes)
[10777](https://github.com/flutter/engine/pull/10777) Manually roll Skia to pull in iOS armv7 build failure fix. (cla: yes)
[10778](https://github.com/flutter/engine/pull/10778) Build JARs containing the Android embedding sources and the engine native library (cla: yes)
[10780](https://github.com/flutter/engine/pull/10780) [flutter_runner] Improve frame scheduling (cla: yes)
[10781](https://github.com/flutter/engine/pull/10781) [flutter] Create the compositor context on the GPU task runner. (cla: yes)
[10782](https://github.com/flutter/engine/pull/10782) Update license script to handle ANGLE (cla: yes)
[10783](https://github.com/flutter/engine/pull/10783) Make firebase test more LUCI friendly (cla: yes)
[10784](https://github.com/flutter/engine/pull/10784) Roll buildroot for ANGLE support (cla: yes)
[10786](https://github.com/flutter/engine/pull/10786) Remove 3 semi-redundant try-jobs (cla: yes)
[10787](https://github.com/flutter/engine/pull/10787) Change call to |AddPart| to |AddChild| (cla: yes)
[10788](https://github.com/flutter/engine/pull/10788) Wire up a concurrent message loop backed SkExecutor for Skia. (cla: yes)
[10789](https://github.com/flutter/engine/pull/10789) Revert "Forwards iOS dark mode trait to the Flutter framework.". (cla: yes)
[10791](https://github.com/flutter/engine/pull/10791) Re-lands platform brightness support on iOS (cla: yes)
[10797](https://github.com/flutter/engine/pull/10797) Rename artifacts so they match the Maven convention (cla: yes)
[10799](https://github.com/flutter/engine/pull/10799) Add a test for creating images from bytes. (cla: yes)
[10802](https://github.com/flutter/engine/pull/10802) Roll src/third_party/dart f29f41f1a5..3d9a356f6e (65 commits) (cla: yes)
[10805](https://github.com/flutter/engine/pull/10805) Roll src/third_party/dart 3d9a356f6e..78ce916d82 (7 commits) (cla: yes)
[10808](https://github.com/flutter/engine/pull/10808) Remove flutter_kernel_sdk dart script (cla: yes)
[10809](https://github.com/flutter/engine/pull/10809) [dart:zircon] Porting Cache re-usable handle wait objects (cla: yes)
[10810](https://github.com/flutter/engine/pull/10810) Roll Dart SDK 78ce916d82..15a3bf82cb (cla: yes)
[10811](https://github.com/flutter/engine/pull/10811) Revert "Remove flutter_kernel_sdk dart script" (cla: yes)
[10815](https://github.com/flutter/engine/pull/10815) Return an empty mapping for an empty file asset (cla: yes)
[10816](https://github.com/flutter/engine/pull/10816) Add firstFrameDidRender to FlutterViewController (cla: yes)
[10817](https://github.com/flutter/engine/pull/10817) Roll src/third_party/dart 15a3bf82cb..ffefa124a7 (11 commits) (cla: yes)
[10820](https://github.com/flutter/engine/pull/10820) iOS JIT support and enhancements for scenarios app (cla: yes)
[10821](https://github.com/flutter/engine/pull/10821) Roll src/third_party/dart ffefa124a7..e29d6d0ecb (4 commits) (cla: yes)
[10823](https://github.com/flutter/engine/pull/10823) Expose isolateId for engine (cla: yes)
[10905](https://github.com/flutter/engine/pull/10905) Roll src/third_party/dart e29d6d0ecb..261fd6266b (2 commits) (cla: yes)
[10925](https://github.com/flutter/engine/pull/10925) Roll src/third_party/dart 261fd6266b..9adf3c119e (2 commits) (cla: yes)
[10934](https://github.com/flutter/engine/pull/10934) Roll src/third_party/dart 9adf3c119e..32b70ce2a5 (3 commits) (cla: yes)
[10941](https://github.com/flutter/engine/pull/10941) Report test failures in run_tests.py (cla: yes)
[10946](https://github.com/flutter/engine/pull/10946) Roll src/third_party/dart 32b70ce2a5..896c053803 (1 commits) (cla: yes)
[10949](https://github.com/flutter/engine/pull/10949) Fix iOS references to PostPrerollResult (cla: yes)
[10952](https://github.com/flutter/engine/pull/10952) Change SemanticsNode#children lists to be non-null (cla: yes)
[10955](https://github.com/flutter/engine/pull/10955) Fix format (cla: yes)
[10956](https://github.com/flutter/engine/pull/10956) Increase the license block scan from 5k to 6k (cla: yes)
[10962](https://github.com/flutter/engine/pull/10962) Roll src/third_party/dart 896c053803..b31df28d72 (10 commits) (cla: yes)
[10966](https://github.com/flutter/engine/pull/10966) Roll src/third_party/dart b31df28d72..baebba06af (5 commits) (cla: yes)
[10968](https://github.com/flutter/engine/pull/10968) include zx::clock from new location to fix Fuchsia autoroll. (cla: yes)
[10973](https://github.com/flutter/engine/pull/10973) Roll src/third_party/dart baebba06af..06509e333d (7 commits) (cla: yes)
[10975](https://github.com/flutter/engine/pull/10975) Roll src/third_party/dart 06509e333d..9aea1f3489 (8 commits) (cla: yes)
[10977](https://github.com/flutter/engine/pull/10977) Roll src/third_party/dart 9aea1f3489..b9217efc77 (7 commits) (cla: yes)
[10981](https://github.com/flutter/engine/pull/10981) Roll src/third_party/dart b9217efc77..20407e28db (6 commits) (cla: yes)
[10982](https://github.com/flutter/engine/pull/10982) Revert "Track detailed LibTxt metrics" (cla: yes)
[10983](https://github.com/flutter/engine/pull/10983) Roll src/third_party/dart 20407e28db..45f892df68 (2 commits) (cla: yes)
[10987](https://github.com/flutter/engine/pull/10987) Roll src/third_party/dart 45f892df68..88c43bbcc4 (7 commits) (cla: yes)
[10990](https://github.com/flutter/engine/pull/10990) Roll src/third_party/dart 88c43bbcc4..b173229baa (14 commits) (cla: yes)
[10993](https://github.com/flutter/engine/pull/10993) Roll src/third_party/dart b173229baa..76c99bcd01 (5 commits) (cla: yes)
[10997](https://github.com/flutter/engine/pull/10997) Roll src/third_party/dart 76c99bcd01..c4727fddf4 (10 commits) (cla: yes)
[10999](https://github.com/flutter/engine/pull/10999) Add script for running ios Tests on simulator (cla: yes)
[11001](https://github.com/flutter/engine/pull/11001) Avoid dynamic lookups of the engine library's symbols on Android (cla: yes)
[11002](https://github.com/flutter/engine/pull/11002) Remove a tracing macro with a dangling pointer (cla: yes)
[11003](https://github.com/flutter/engine/pull/11003) Roll src/third_party/dart c4727fddf4..e35e8833ee (1 commits) (cla: yes)
[11004](https://github.com/flutter/engine/pull/11004) Trace RasterCacheResult::Draw (cla: yes)
[11005](https://github.com/flutter/engine/pull/11005) Drop firebase test from Cirrus (cla: yes)
[11006](https://github.com/flutter/engine/pull/11006) On iOS report the preferred frames per second to tools via service protocol. (cla: yes)
[11007](https://github.com/flutter/engine/pull/11007) Update README.md (cla: yes)
[11009](https://github.com/flutter/engine/pull/11009) Revert "Update README.md" (cla: yes)
[11010](https://github.com/flutter/engine/pull/11010) Rename macOS FLE* classes to Flutter* (affects: desktop, cla: yes, platform-macos, waiting for tree to go green)
[11011](https://github.com/flutter/engine/pull/11011) Initialize the engine in the running state to match the animator's default state (cla: yes)
[11012](https://github.com/flutter/engine/pull/11012) Remove the ParagraphImpl class from the text API (cla: yes)
[11013](https://github.com/flutter/engine/pull/11013) Remove ability to override mac_sdk_path in flutter/tools/gn (cla: yes)
[11015](https://github.com/flutter/engine/pull/11015) Remove the output directory prefix from the Android engine JAR filename (cla: yes)
[11016](https://github.com/flutter/engine/pull/11016) Fix gn breakage on Fuchsia macOS host builds (cla: yes)
[11017](https://github.com/flutter/engine/pull/11017) Roll src/third_party/dart e35e8833ee..e35e8833ee (0 commits) (cla: yes)
[11019](https://github.com/flutter/engine/pull/11019) Fix gn breakage on non-Fuchsia macOS host builds (cla: yes)
[11023](https://github.com/flutter/engine/pull/11023) Roll src/third_party/dart e35e8833ee..cae08c6813 (28 commits) (cla: yes)
[11024](https://github.com/flutter/engine/pull/11024) Add _glfw versions of the GLFW desktop libraries (cla: yes)
[11026](https://github.com/flutter/engine/pull/11026) Roll src/third_party/dart cae08c6813..9552646dc4 (3 commits) (cla: yes)
[11027](https://github.com/flutter/engine/pull/11027) Fix first frame logic (cla: yes)
[11029](https://github.com/flutter/engine/pull/11029) Disable a deprecation warning for use of a TaskDescription constructor for older platforms (cla: yes)
[11030](https://github.com/flutter/engine/pull/11030) Roll src/third_party/dart 9552646dc4..cd16fba718 (5 commits) (cla: yes)
[11033](https://github.com/flutter/engine/pull/11033) remove OS version (cla: yes)
[11036](https://github.com/flutter/engine/pull/11036) [fuchsia] Add required trace so files for fuchsia fars (cla: yes)
[11037](https://github.com/flutter/engine/pull/11037) Roll buildroot to pick up recent macOS changes (cla: yes)
[11038](https://github.com/flutter/engine/pull/11038) Make JIT work on iPhone armv7 (cla: yes)
[11039](https://github.com/flutter/engine/pull/11039) Roll src/third_party/dart cd16fba718..306f8e04bb (10 commits) (cla: yes)
[11040](https://github.com/flutter/engine/pull/11040) Hide verbose dart snapshot during run_test.py (cla: yes)
[11043](https://github.com/flutter/engine/pull/11043) Roll Dart back to e35e8833 (cla: yes)
[11044](https://github.com/flutter/engine/pull/11044) Roll src/third_party/dart 306f8e04bb..fecc4c8f2d (4 commits) (cla: yes)
[11046](https://github.com/flutter/engine/pull/11046) Add ccls config files to .gitignore (cla: yes)
[11048](https://github.com/flutter/engine/pull/11048) Roll src/third_party/dart e35e8833ee..2023f09b56 (67 commits) (cla: yes)
[11052](https://github.com/flutter/engine/pull/11052) Remove unused dstColorSpace argument to MakeCrossContextFromPixmap (cla: yes)
[11055](https://github.com/flutter/engine/pull/11055) Roll src/third_party/dart 2023f09b56..a3b579d5c3 (8 commits) (cla: yes)
[11056](https://github.com/flutter/engine/pull/11056) Sort the Skia typefaces in a font style set into a consistent order (cla: yes)
[11060](https://github.com/flutter/engine/pull/11060) Roll src/third_party/dart a3b579d5c3..2a3b844b41 (5 commits) (cla: yes)
[11061](https://github.com/flutter/engine/pull/11061) Roll buildroot to 5a33d6ab to pickup changes to toolchain version tracking. (cla: yes)
[11066](https://github.com/flutter/engine/pull/11066) Roll src/third_party/dart 2a3b844b41..8ab978b6d4 (7 commits) (cla: yes)
[11067](https://github.com/flutter/engine/pull/11067) Minor update to the Robolectric test harness (cla: yes)
[11068](https://github.com/flutter/engine/pull/11068) More updates to the Robolectric test harness (cla: yes)
[11071](https://github.com/flutter/engine/pull/11071) Roll src/third_party/dart 8ab978b6d4..beee442625 (17 commits) (cla: yes)
[11072](https://github.com/flutter/engine/pull/11072) Roll src/third_party/dart beee442625..79e6c74337 (8 commits) (cla: yes)
[11075](https://github.com/flutter/engine/pull/11075) [dynamic_thread_merging] Resubmit only on the frame where the merge (cla: yes)
| website/src/release/release-notes/changelogs/changelog-1.9.1.md/0 | {
"file_path": "website/src/release/release-notes/changelogs/changelog-1.9.1.md",
"repo_id": "website",
"token_count": 41844
} | 1,499 |
---
title: Online courses
description: An index of online courses teaching Flutter development.
---
Learn how to build Flutter apps with these video courses.
Before signing up for a course, verify that it includes
up-to-date information, such as null-safe Dart code.
These courses are listed alphabetically.
To include your course, [submit a PR][]:
* [Flutter & Dart - The Complete Guide, 2023 Edition][]
* [The Complete 2021 Flutter Development Bootcamp Using Dart][] by App Brewery
* [Flutter Crash Course][] by Nick Manning
* [Flutter leicht gemacht 2022 - Zero to Mastery!][] by Max Berktold (German)
* [Flutter Zero to Hero][] by Veli Bacik (Turkish)
* [Flutter Bootcamp][] by Rubens de Melo (Portuguese)
* [Flutter para iniciantes][] by Rubens de Melo (Portuguese)
* [Dart & Flutter - Zero to Mastery 2023 + Clean Architecture][] by Max Berktold & Max Steffen
* [Dart & Flutter - Zero to Mastery 2023 - Keiko Corp. Food Reviews App][] by Marco Napoli
* [Sticky Grouped Headers in Flutter][] by Marco Napoli
* [Flutter University - From Zero to Mastery][] by Fudeo (Italian)
[Flutter & Dart - The Complete Guide, 2023 Edition]: https://www.udemy.com/course/learn-flutter-dart-to-build-ios-android-apps/
[The Complete 2021 Flutter Development Bootcamp Using Dart]: https://www.appbrewery.co/p/flutter-development-bootcamp-with-dart/
[Flutter Crash Course]: https://fluttercrashcourse.com/
[Flutter leicht gemacht 2022 - Zero to Mastery!]: https://www.udemy.com/course/dart-flutter-leicht-gemacht/
[Flutter Zero to Hero]: {{site.yt.playlist}}PL1k5oWAuBhgXdw1BbxVGxxWRmkGB1C11l
[Flutter Bootcamp]: https://flutterbootcamp.com.br
[Flutter para iniciantes]: {{site.yt.playlist}}PLS4cqF1_X2syzBpkoSwtmKoREgnp1MhTn
[Dart & Flutter - Zero to Mastery 2023 + Clean Architecture]: https://www.udemy.com/course/flutter-made-easy-zero-to-mastery/?referralCode=CCBFCD16CC71F359EE3C
[Dart & Flutter - Zero to Mastery 2023 - Keiko Corp. Food Reviews App]: https://academy.zerotomastery.io/courses/2092303/lectures/47623876
[Sticky Grouped Headers in Flutter]: https://academy.droidcon.com/course/sticky-grouped-headers-in-flutter
[Flutter University - From Zero to Mastery]: https://www.fudeo.it/?utm_source=flutter_dev
[submit a PR]: {{site.repo.this}}/pulls
| website/src/resources/courses.md/0 | {
"file_path": "website/src/resources/courses.md",
"repo_id": "website",
"token_count": 743
} | 1,500 |
---
layout: toc
title: Testing & debugging
description: Content covering testing and debugging Flutter apps.
---
| website/src/testing/index.md/0 | {
"file_path": "website/src/testing/index.md",
"repo_id": "website",
"token_count": 27
} | 1,501 |
---
title: Using the Memory view
description: Learn how to use the DevTools memory view.
---
The memory view provides insights into details
of the application's memory allocation and
tools to detect and debug specific issues.
{{site.alert.note}}
This page is up to date for DevTools 2.23.0.
{{site.alert.end}}
For information on how to locate DevTools screens in different IDEs,
check out the [DevTools overview](/tools/devtools/overview).
To better understand the insights found on this page,
the first section explains how Dart manages memory.
If you already understand Dart's memory management,
you can skip to the [Memory view guide](#memory-view-guide).
## Reasons to use the memory view
Use the memory view for preemptive memory optimization or when
your application experiences one of the following conditions:
* Crashes when it runs out of memory
* Slows down
* Causes the device to slow down or become unresponsive
* Shuts down because it exceeded the memory limit, enforced by operating system
* Exceeds memory usage limit
* This limit can vary depending on the type of devices your app targets.
* Suspect a memory leak
## Basic memory concepts
Dart objects created using a class constructor
(for example, by using `MyClass()`) live in a
portion of memory called the _heap_. The memory
in the heap is managed by the Dart VM (virtual machine).
The Dart VM allocates memory for the object at the moment of the object creation,
and releases (or deallocates) the memory when the object
is no longer used (see [Dart garbage collection][]).
[Dart garbage collection]: {{site.medium}}/flutter/flutter-dont-fear-the-garbage-collector-d69b3ff1ca30
### Object types
#### Disposable object
A disposable object is any Dart object that defines a `dispose()` method.
To avoid memory leaks, invoke `dispose` when the object isn't needed anymore.
#### Memory-risky object
A memory-risky object is an object that _might_ cause a memory leak,
if it is not disposed properly or disposed but not GCed.
### Root object, retaining path, and reachability
#### Root object
Every Dart application creates a _root object_ that references,
directly or indirectly, all other objects the application allocates.
#### Reachability
If, at some moment of the application run,
the root object stops referencing an allocated object,
the object becomes _unreachable_,
which is a signal for the garbage collector (GC)
to deallocate the object's memory.
#### Retaining path
The sequence of references from root to an object
is called the object's _retaining_ path,
as it retains the object's memory from the garbage collection.
One object can have many retaining paths.
Objects with at least one retaining path are
called _reachable_ objects.
#### Example
The following example illustrates the concepts:
```dart
class Child{}
class Parent {
Child? child;
}
Parent parent1 = Parent();
void myFunction() {
Child? child = Child();
// The `child` object was allocated in memory.
// It's now retained from garbage collection
// by one retaining path (root …-> myFunction -> child).
Parent? parent2 = Parent()..child = child;
parent1.child = child;
// At this point the `child` object has three retaining paths:
// root …-> myFunction -> child
// root …-> myFunction -> parent2 -> child
// root -> parent1 -> child
child = null;
parent1.child = null;
parent2 = null;
// At this point, the `child` instance is unreachable
// and will eventually be garbage collected.
…
}
```
### Shallow size vs retained size
**Shallow size** includes only the size of the object
and its references, while **retained size** also includes
the size of the retained objects.
The **retained size** of the root object includes
all reachable Dart objects.
In the following example, the size of `myHugeInstance`
isn't part of the parent's or child's shallow sizes,
but is part of their retained sizes:
```dart
class Child{
/// The instance is part of both [parent] and [parent.child]
/// retained sizes.
final myHugeInstance = MyHugeInstance();
}
class Parent {
Child? child;
}
Parent parent = Parent()..child = Child();
```
In DevTools calculations, if an object has more
than one retaining path, its size is assigned as
retained only to the members of the shortest retaining path.
In this example the object `x` has two retaining paths:
```terminal
root -> a -> b -> c -> x
root -> d -> e -> x (shortest retaining path to `x`)
```
Only members of the shortest path (`d` and `e`) will include
`x` into their retaining size.
### Memory leaks happen in Dart?
Garbage collector cannot prevent all types of memory leaks, and developers
still need to watch objects to have leak-free lifecycle.
#### Why can't the garbage collector prevent all leaks?
While the garbage collector takes care of all
unreachable objects, it's the responsibility
of the application to ensure that unneeded objects
are no longer reachable (referenced from the root).
So, if non-needed objects are left referenced
(in a global or static variable,
or as a field of a long-living object),
the garbage collector can't recognize them,
the memory allocation grows progressively,
and the app eventually crashes with an `out-of-memory` error.
#### Why closures require extra attention
One hard-to-catch leak pattern relates to using closures.
In the following code, a reference to the
designed-to-be short-living `myHugeObject` is implicitly
stored in the closure context and passed to `setHandler`.
As a result, `myHugeObject` won't be garbage collected
as long as `handler` is reachable.
```dart
final handler = () => print(myHugeObject.name);
setHandler(handler);
```
#### Why `BuildContext` requires extra attention
An example of a large, short-living object that
might squeeze into a long-living area and thus cause leaks,
is the `context` parameter passed to Flutter's
`build` method.
The following code is leak prone,
as `useHandler` might store the handler
in a long-living area:
```dart
// BAD: DO NOT DO THIS
// This code is leak prone:
@override
Widget build(BuildContext context) {
final handler = () => apply(Theme.of(context));
useHandler(handler);
…
```
#### How to fix leak prone code?
The following code is not leak prone,
because:
1. The closure doesn't use the large and short-living `context` object.
2. The `theme` object (used instead) is long-living. It is created once and
shared between `BuildContext` instances.
```dart
// GOOD
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final handler = () => apply(theme);
useHandler(handler);
…
```
#### General rule for `BuildContext`
In general, use the following rule for a
`BuildContext`: if the closure doesn't outlive
the widget, it's ok to pass the context to the closure.
Stateful widgets require extra attention.
They consist of two classes: the [widget and the
widget state][interactive],
where the widget is short living,
and the state is long living. The build context,
owned by the widget, should never be referenced
from the state's fields, as the state won't be garbage
collected together with the widget, and can significantly outlive it.
[interactive]: /ui/interactivity#creating-a-stateful-widget
### Memory leak vs memory bloat
In a memory leak, an application progressively uses memory,
for example, by repeatedly creating a listener,
but not disposing it.
Memory bloat uses more memory than is necessary for
optimal performance, for example, by using overly large
images or keeping streams open through their lifetime.
Both leaks and bloats, when large,
cause an application to crash with an `out-of-memory` error.
However, leaks are more likely to cause memory issues,
because even a small leak,
if repeated many times, leads to a crash.
## Memory view guide
The DevTools memory view helps you investigate
memory allocations (both in the heap and external),
memory leaks, memory bloat, and more. The view
has the following features:
[**Expandable chart**](#expandable-chart)
: Get a high-level trace of memory allocation,
and view both standard events (like garbage collection)
and custom events (like image allocation).
[**Profile Memory** tab](#profile-memory-tab)
: See current memory allocation listed by class and
memory type.
[**Diff Snapshots** tab](#diff-snapshots-tab)
: Detect and investigate a feature's memory management issues.
[**Trace Instances** tab](#trace-instances-tab)
: Investigate a feature's memory management for
a specified set of classes.
### Expandable chart
The expandable chart provides the following features:
#### Memory anatomy
A timeseries graph visualizes the state of
Flutter memory at successive intervals of time.
Each data point on the chart corresponds to the
timestamp (x-axis) of measured quantities (y-axis)
of the heap. For example, usage, capacity, external,
garbage collection, and resident set size are captured.
![Screenshot of a memory anatomy page](/assets/images/docs/tools/devtools/memory_chart_anatomy.png){:width="100%"}
#### Memory overview chart
The memory overview chart is a timeseries graph
of collected memory statistics. It visually presents
the state of the Dart or Flutter heap and Dart's
or Flutter's native memory over time.
The chart's x-axis is a timeline of events (timeseries).
The data plotted in the y-axis all has a timestamp of
when the data was collected. In other words,
it shows the polled state (capacity, used, external,
RSS (resident set size), and GC (garbage collection))
of the memory every 500 ms. This helps provide a live
appearance on the state of the memory as the application is running.
Clicking the **Legend** button displays the
collected measurements, symbols, and colors
used to display the data.
![Screenshot of a memory anatomy page](/assets/images/docs/tools/devtools/memory_chart_anatomy.png){:width="100%"}
The **Memory Size Scale** y-axis automatically
adjusts to the range of data collected in the
current visible chart range.
The quantities plotted on the y-axis are as follows:
**Dart/Flutter Heap**
: Objects (Dart and Flutter objects) in the heap.
**Dart/Flutter Native**
: Memory that isn't in the Dart/Flutter heap
but is still part of the total memory footprint.
Objects in this memory would be native objects
(for example, from reading a file into memory,
or a decoded image). The native objects are exposed
to the Dart VM from the native OS (such as Android,
Linux, Windows, iOS) using a Dart embedder.
The embedder creates a Dart wrapper with a finalizer,
allowing Dart code to communicate with these native resources.
Flutter has an embedder for Android and iOS.
For more information, see [Command-line and server apps][],
[Dart on the server with Dart Frog][frog],
[Custom Flutter Engine Embedders][],
[Dart web server deployment with Heroku][heroku].
**Timeline**
: The timestamps of all collected memory statistics
and events at a particular point in time (timestamp).
**Raster Cache**
: The size of the Flutter engine's raster cache
layer(s) or picture(s), while performing the
final rendering after compositing.
For more information, see the
[Flutter architectural overview][]
and [DevTools Performance view][].
**Allocated**
: The current capacity of the heap is typically
slightly larger than the total size of all heap objects.
**RSS - Resident Set Size**
: The resident set size displays the amount of memory
for a process.
It doesn't include memory that is swapped out.
It includes memory from shared libraries that are
loaded, as well as all stack and heap memory.
For more information, see [Dart VM internals][].
[Command-line and server apps]: {{site.dart-site}}/server
[Custom Flutter engine embedders]: {{site.repo.flutter}}/wiki/Custom-Flutter-Engine-Embedders
[Dart VM internals]: https://mrale.ph/dartvm/
[DevTools Performance view]: /tools/devtools/performance
[Flutter architectural overview]: /resources/architectural-overview
[frog]: https://dartfrog.vgv.dev/
[heroku]: {{site.yt.watch}}?v=nkTUMVNelXA
### Profile Memory tab
Use the **Profile Memory** tab to see current memory
allocation by class and memory type. For a
deeper analysis in Google Sheets or other tools,
download the data in CSV format.
Toggle **Refresh on GC**, to see allocation in real time.
![Screenshot of the profile tab page](/assets/images/docs/tools/devtools/profile-tab-2.png){:width="100%"}
### Diff Snapshots tab
Use the **Diff Snapshots** tab to investigate a feature's
memory management. Follow the guidance on the tab
to take snapshots before and after interaction
with the application, and diff the snapshots:
![Screenshot of the diff tab page](/assets/images/docs/tools/devtools/diff-tab.png){:width="100%"}
Tap the **Filter classes and packages** button,
to narrow the data:
![Screenshot of the filter options ui](/assets/images/docs/tools/devtools/filter-ui.png)
For a deeper analysis in Google Sheets
or other tools, download the data in CSV format.
### Trace Instances tab
Use the **Trace Instances** tab to investigate what methods
allocate memory for a set of classes during feature execution:
1. Select classes to trace
1. Interact with your app to trigger the code
you are interested in
1. Tap **Refresh**
1. Select a traced class
1. Review the collected data
![Screenshot of a trace tab](/assets/images/docs/tools/devtools/trace-instances-tab.png){:width="100%"}
#### Bottom up vs call tree view
Switch between bottom-up and call tree views
depending on specifics of your tasks.
![Screenshot of a trace allocations](/assets/images/docs/tools/devtools/trace-view.png)
The call tree view shows the method allocations
for each instance. The view is a top-down representation
of the call stack, meaning that a method can be expanded
to show its callees.
The bottom-up view shows the list of different
call stacks that have allocated the instances.
## Other resources
For more information, check out the following resources:
* To learn how to monitor an app's memory usage
and detect memory leaks using DevTools,
check out a guided [Memory View tutorial][memory-tutorial].
* To understand Android memory structure,
check out [Android: Memory allocation among processes][].
[memory-tutorial]: {{site.medium}}/@fluttergems/mastering-dart-flutter-devtools-memory-view-part-7-of-8-e7f5aaf07e15
[Android: Memory allocation among processes]: {{site.android-dev}}/topic/performance/memory-management
| website/src/tools/devtools/memory.md/0 | {
"file_path": "website/src/tools/devtools/memory.md",
"repo_id": "website",
"token_count": 3862
} | 1,502 |
# DevTools 2.10.0 release notes
The 2.10.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).
## Flutter inspector updates
* Added search support to the Widget Tree, and
added a breadcrumb navigator to the Widget Details Tree to
allow for quickly navigating through the tree hierarchy -
[#3525](https://github.com/flutter/devtools/pull/3525)
![inspector search](/tools/devtools/release-notes/images-2.10.0/image1.png "inspector_search")
## CPU profiler updates
* Fix a null reference in the CPU profiler
when loading an offline snapshot -
[#3596](https://github.com/flutter/devtools/pull/3596)
## Debugger updates
* Added support for multi-token file search, and
improved search match prioritization to
rank file name matches over full path matches -
[#3582](https://github.com/flutter/devtools/pull/3582)
* Fix some focus-related issues -
[#3602](https://github.com/flutter/devtools/pull/3602)
## Logging view updates
* Fix a fatal error that occurred when
filtering logs more than once -
[#3588](https://github.com/flutter/devtools/pull/3588)
## Full commit history
To find a complete list of changes since the previous release,
check out
[the diff on GitHub](https://github.com/flutter/devtools/compare/v2.9.2...v2.10.0).
| website/src/tools/devtools/release-notes/release-notes-2.10.0-src.md/0 | {
"file_path": "website/src/tools/devtools/release-notes/release-notes-2.10.0-src.md",
"repo_id": "website",
"token_count": 438
} | 1,503 |
# DevTools 2.17.0 release notes
The 2.17.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).
## Inspector updates
* Added support for manually setting the package directories for your app.
If you've ever loaded the Inspector and noticed that
some of your widgets aren't present in the widget tree, this might
indicate that the package directories for your app
haven't been set or detected properly.
Your package directories determine which widgets
the Inspector considers to be from _your_ application.
If you see an empty Inspector widget tree,
or if you develop widgets across multiple packages,
and want widgets from all these locations to show up in your tree,
check the **Inspector Settings** dialog to ensure that your package
directories are properly configured -
[#4306](https://github.com/flutter/devtools/pull/4306)
![frame_analysis](/tools/devtools/release-notes/images-2.17.0/package_directories.png "package directories")
## Performance updates
* Added a **Frame Analysis** tab to the Performance page.
When analyzing a janky Flutter frame,
this view provides hints for how to diagnose the jank and
detects expensive operations that might have
contributed to the slow frame time.
This view also shows a breakdown of your Flutter frame time
per phase (**Build**, **Layout**, **Paint**, and **Raster**)
to try to guide you in the right direction -
[#4339](https://github.com/flutter/devtools/pull/4339)
![frame_analysis](/tools/devtools/release-notes/images-2.17.0/frame_analysis.png "frame analysis")
## Full commit history
To find a complete list of changes since the previous release,
check out
[the diff on GitHub](https://github.com/flutter/devtools/compare/v2.16.0...v2.17.0).
| website/src/tools/devtools/release-notes/release-notes-2.17.0-src.md/0 | {
"file_path": "website/src/tools/devtools/release-notes/release-notes-2.17.0-src.md",
"repo_id": "website",
"token_count": 512
} | 1,504 |
# DevTools 2.25.0 release notes
The 2.25.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
- Improve DevTools tab bar navigation when the list of tabs is long -
[#5875](https://github.com/flutter/devtools/pull/5875)
- Clear registered service methods between app connections -
[#5960](https://github.com/flutter/devtools/pull/5960)
## Memory updates
- Add legend for class types -
[#5937](https://github.com/flutter/devtools/pull/5937)
- Enable sampling for Memory > Profile -
[#5947](https://github.com/flutter/devtools/pull/5947)
![memory sampling](/tools/devtools/release-notes/images-2.25.0/memory.png "memory_sampling")
## Full commit history
To find a complete list of changes since the previous release,
check out
[the diff on GitHub](https://github.com/flutter/devtools/compare/v2.24.0...v2.25.0).
| website/src/tools/devtools/release-notes/release-notes-2.25.0-src.md/0 | {
"file_path": "website/src/tools/devtools/release-notes/release-notes-2.25.0-src.md",
"repo_id": "website",
"token_count": 316
} | 1,505 |
# DevTools 2.29.0 release notes
The 2.29.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
* Fix a bug with service extension states not
being cleared on app disconnect. - [#6547](https://github.com/flutter/devtools/pull/6547)
* Improved styling of bottom status bar when connected to an app. - [#6525](https://github.com/flutter/devtools/pull/6525)
* Added a workaround to fix copy button functionality in VSCode. - [#6598](https://github.com/flutter/devtools/pull/6598)
## Performance updates
* Added an option in the "Enhance Tracing" menu for tracking platform channel
activity. This is useful for apps with plugins. - [#6515](https://github.com/flutter/devtools/pull/6515)
![Track platform channels setting](/tools/devtools/release-notes/images-2.29.0/track_platform_channels.png "Track platform channels setting")
* Made the Performance screen available when there is no connected app.
Performance data that was previously saved from DevTools can be
reloaded for viewing from this screen. - [#6567](https://github.com/flutter/devtools/pull/6567)
* Added an "Open" button to the Performance controls for
loading data that was previously saved from DevTools. - [#6567](https://github.com/flutter/devtools/pull/6567)
![Open file button on the performance screen](/tools/devtools/release-notes/images-2.29.0/open_file_performance_screen.png "Open file button on the performance screen")
## CPU profiler updates
* Tree guidelines are now always enabled for the
"Bottom Up" and "Call Tree" tabs. - [#6534](https://github.com/flutter/devtools/pull/6534)
* Made the CPU profiler screen available when there is no connected app.
CPU profiles that were previously saved from DevTools can be
reloaded for viewing from this screen. - [#6567](https://github.com/flutter/devtools/pull/6567)
* Added an "Open" button to the CPU profiler controls for loading data that
was previously saved from DevTools. - [#6567](https://github.com/flutter/devtools/pull/6567)
## Network profiler updates
* Network statuses now show with an error color when the request failed. - [#6527](https://github.com/flutter/devtools/pull/6527)
## Full commit history
To find a complete list of changes in this release, check out the
[DevTools git log](https://github.com/flutter/devtools/tree/v2.29.0).
| website/src/tools/devtools/release-notes/release-notes-2.29.0-src.md/0 | {
"file_path": "website/src/tools/devtools/release-notes/release-notes-2.29.0-src.md",
"repo_id": "website",
"token_count": 719
} | 1,506 |
# DevTools 2.9.2 release notes
The 2.9.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
* Take our 2022 DevTools survey! Provide your feedback and help us improve
your development experience. This survey prompt will show up directly in
DevTools sometime in mid-February.
![survey prompt](/tools/devtools/release-notes/images-2.9.2/image1.png "survey_prompt")
*Note*: If you are having issues launching the survey, please make
sure you have upgraded to the latest Flutter stable branch 2.10.
There was a bug in DevTools (fixed in
[#3574](https://github.com/flutter/devtools/pull/3574)) that
prevented the survey from being able to be opened, and unless you
are on Flutter 2.10, this bug will still be present._
* General bug fixes and improvements -
[#3528](https://github.com/flutter/devtools/pull/3528),
[#3531](https://github.com/flutter/devtools/pull/3531),
[#3532](https://github.com/flutter/devtools/pull/3532),
[#3539](https://github.com/flutter/devtools/pull/3539)
## Performance updates
* Added frame numbers to x-axis the Flutter frames chart -
[#3526](https://github.com/flutter/devtools/pull/3526)
![frame numbers](/tools/devtools/release-notes/images-2.9.2/image2.png "frame_numbers")
## Debugger updates
* Fix a bug where the File Explorer in the Debugger did not show contents
after a hot restart -
[#3527](https://github.com/flutter/devtools/pull/3527)
## Full commit history
To find a complete list of changes since the previous release,
check out
[the diff on GitHub](https://github.com/flutter/devtools/compare/v2.9.1...v2.9.2).
| website/src/tools/devtools/release-notes/release-notes-2.9.2-src.md/0 | {
"file_path": "website/src/tools/devtools/release-notes/release-notes-2.9.2-src.md",
"repo_id": "website",
"token_count": 556
} | 1,507 |
---
title: Implicit animations
description: Where to find more information on using implicit animations in Flutter.
---
With Flutter's [animation library][],
you can add motion and create visual effects
for the widgets in your UI.
One part of the library is an assortment of widgets
that manage animations for you.
These widgets are collectively referred to as _implicit animations_,
or _implicitly animated widgets_, deriving their name from the
[`ImplicitlyAnimatedWidget`][] class that they implement.
The following set of resources provide many ways to learn
about implicit animations in Flutter.
## Documentation
[Implicit animations codelab][]
: Jump right into the code!
This codelab uses interactive examples
and step-by-step instructions to teach you
how to use implicit animations.
[`AnimatedContainer` sample][]
: A step-by-step recipe from the [Flutter cookbook][]
for using the [`AnimatedContainer`][]
implicitly animated widget.
[`ImplicitlyAnimatedWidget`][] API page
: All implicit animations extend the `ImplicitlyAnimatedWidget` class.
## Flutter in Focus videos
Flutter in Focus videos feature 5-10 minute tutorials
with real code that cover techniques
that every Flutter dev needs to know from top to bottom.
The following videos cover topics
that are relevant to implicit animations.
<iframe width="560" height="315" src="{{site.yt.embed}}/IVTjpW3W33s" title="Learn about basic Flutter animation with implicit animations" {{site.yt.set}}></iframe>
[Learn about Animation Basics with Implicit Animations]({{site.yt.watch}}/IVTjpW3W33s)
<iframe width="560" height="315" src="{{site.yt.embed}}/6KiPEqzJIKQ" title="Learn about building Custom Implicit Animations with TweenAnimationBuilder" {{site.yt.set}}></iframe>
[Learn about building Custom Implicit Animations with TweenAnimationBuilder]({{site.yt.watch}}/6KiPEqzJIKQ)
## The Boring Show
Watch the Boring Show to follow Google Engineers build apps
from scratch in Flutter. The following episode covers
using implicit animations in a news aggregator app.
<iframe width="560" height="315" src="{{site.yt.embed}}/8ehlWchLVlQ" title="about implicitly animating the Hacker News app" {{site.yt.set}}></iframe>
[Learn about implicitly animating the Hacker News app]({{site.yt.watch}}/8ehlWchLVlQ)
## Widget of the Week videos
A weekly series of short animated videos each showing
the important features of one particular widget.
In about 60 seconds, you'll see real code for each
widget with a demo about how it works.
The following Widget of the Week videos cover
implicitly animated widgets:
{% assign animated-widgets = 'AnimatedOpacity, AnimatedPadding, AnimatedPositioned, AnimatedSwitcher' | split: ", " %}
{% assign animated-urls = 'QZAvjqOqiLY, PY2m0fhGNz4, hC3s2YdtWt8, 2W7POjFb88g' | split: ", " %}
{% for widget in animated-widgets %}
{% assign video-url = animated-urls[forloop.index0] %}
<iframe width="560" height="315" src="{{site.yt.embed}}/{{video-url}}" title="Learn about the {{widget}} Flutter Widget" {{site.yt.set}}></iframe>
[Learn about the {{widget}} Flutter Widget]({{site.yt.watch}}/{{video-url}})
{% endfor -%}
[`AnimatedContainer` sample]: /cookbook/animation/animated-container
[`AnimatedContainer`]: {{site.api}}/flutter/widgets/AnimatedContainer-class.html
[animation library]: {{site.api}}/flutter/animation/animation-library.html
[Flutter cookbook]: /cookbook
[Implicit animations codelab]: /codelabs/implicit-animations
[`ImplicitlyAnimatedWidget`]: {{site.api}}/flutter/widgets/ImplicitlyAnimatedWidget-class.html
| website/src/ui/animations/implicit-animations.md/0 | {
"file_path": "website/src/ui/animations/implicit-animations.md",
"repo_id": "website",
"token_count": 1045
} | 1,508 |
---
title: Drag outside an app
description: How to drag from an app to another app or the operating system.
---
You might want to implement
drag and drop somewhere in your app.
You have a couple potential approaches
that you can take. One directly uses
Flutter widgets and the other uses a package
([super_drag_and_drop][]), available on [pub.dev][].
[pub.dev]: {{site.pub}}
[super_drag_and_drop]: {{site.pub-pkg}}/super_drag_and_drop
## Create draggable widgets within your app
If you want to implement drag and drop within
your application, you can use the [`Draggable`][]
widget. For insight into this approach, see
the [Drag a UI element within an app][] recipe.
An advantage of using `Draggable` and `DragTarget` is
that you can supply Dart code to decide whether to accept a drop.
For more information, check out the
[`Draggable` widget of the week][video] video.
[Drag a UI element within an app]: /cookbook/effects/drag-a-widget
[`Draggable`]: {{site.api}}/flutter/widgets/Draggable-class.html
[`DragTarget`]: {{site.api}}/flutter/widgets/DragTarget-class.html
[local data]: {{site.pub-api}}/super_drag_and_drop/latest/super_drag_and_drop/DragItem/localData.html
[video]: https://youtu.be/q4x2G_9-Mu0?si=T4679e90U2yrloCs
## Implement drag and drop between apps
If you want to implement drag and drop within
your application and _also_ between your
application and another (possibly non-Flutter) app,
check out the [super_drag_and_drop][] package.
To avoid implementing two styles of drag and drop,
one for drags outside of the app and another for
dragging inside the app,
you can supply [local data][] to the package to
perform drags within your app.
Another difference between this approach and
using `Draggable` directly,
is that you must tell the package up front
what data your app accepts because the platform
APIs need a synchronous response, which doesn't
allow an asynchronous response from the framework.
An advantage of using this approach is that it
works across desktop, mobile, _and_ web.
| website/src/ui/interactivity/gestures/drag-outside.md/0 | {
"file_path": "website/src/ui/interactivity/gestures/drag-outside.md",
"repo_id": "website",
"token_count": 591
} | 1,509 |
---
title: Accessibility widgets
short-title: Accessibility
description: A catalog of Flutter's accessibility widgets.
---
{% include docs/catalogpage.html category="Accessibility" %}
| website/src/ui/widgets/accessibility.md/0 | {
"file_path": "website/src/ui/widgets/accessibility.md",
"repo_id": "website",
"token_count": 48
} | 1,510 |