Commit 95fc5ae0 authored by Adam Barth's avatar Adam Barth

[rename fixit] *Component* -> *Widget*

This patch renames StatelessComponent to StatelessWidget and
StatefulComponent to StatefulWidget.

Fixes #2308
parent 892063ac
...@@ -16,7 +16,7 @@ class CardModel { ...@@ -16,7 +16,7 @@ class CardModel {
Key get key => new ObjectKey(this); Key get key => new ObjectKey(this);
} }
class CardCollection extends StatefulComponent { class CardCollection extends StatefulWidget {
CardCollectionState createState() => new CardCollectionState(); CardCollectionState createState() => new CardCollectionState();
} }
......
...@@ -6,7 +6,7 @@ import 'dart:math' as math; ...@@ -6,7 +6,7 @@ import 'dart:math' as math;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ExampleDragTarget extends StatefulComponent { class ExampleDragTarget extends StatefulWidget {
ExampleDragTargetState createState() => new ExampleDragTargetState(); ExampleDragTargetState createState() => new ExampleDragTargetState();
} }
...@@ -39,7 +39,7 @@ class ExampleDragTargetState extends State<ExampleDragTarget> { ...@@ -39,7 +39,7 @@ class ExampleDragTargetState extends State<ExampleDragTarget> {
} }
} }
class Dot extends StatefulComponent { class Dot extends StatefulWidget {
Dot({ Key key, this.color, this.size, this.child, this.tappable: false }) : super(key: key); Dot({ Key key, this.color, this.size, this.child, this.tappable: false }) : super(key: key);
final Color color; final Color color;
final double size; final double size;
...@@ -66,7 +66,7 @@ class DotState extends State<Dot> { ...@@ -66,7 +66,7 @@ class DotState extends State<Dot> {
} }
} }
class ExampleDragSource extends StatelessComponent { class ExampleDragSource extends StatelessWidget {
ExampleDragSource({ ExampleDragSource({
Key key, Key key,
this.color, this.color,
...@@ -162,7 +162,7 @@ class DashOutlineCirclePainter extends CustomPainter { ...@@ -162,7 +162,7 @@ class DashOutlineCirclePainter extends CustomPainter {
bool shouldRepaint(DashOutlineCirclePainter oldPainter) => false; bool shouldRepaint(DashOutlineCirclePainter oldPainter) => false;
} }
class MovableBall extends StatelessComponent { class MovableBall extends StatelessWidget {
MovableBall(this.position, this.ballPosition, this.callback); MovableBall(this.position, this.ballPosition, this.callback);
final int position; final int position;
...@@ -212,7 +212,7 @@ class MovableBall extends StatelessComponent { ...@@ -212,7 +212,7 @@ class MovableBall extends StatelessComponent {
} }
} }
class DragAndDropApp extends StatefulComponent { class DragAndDropApp extends StatefulWidget {
DragAndDropAppState createState() => new DragAndDropAppState(); DragAndDropAppState createState() => new DragAndDropAppState();
} }
......
...@@ -32,7 +32,7 @@ enum WindowSide { ...@@ -32,7 +32,7 @@ enum WindowSide {
bottomRight, bottomRight,
} }
class WindowDecoration extends StatelessComponent { class WindowDecoration extends StatelessWidget {
WindowDecoration({ WindowDecoration({
Key key, Key key,
this.side, this.side,
...@@ -87,7 +87,7 @@ class WindowDecoration extends StatelessComponent { ...@@ -87,7 +87,7 @@ class WindowDecoration extends StatelessComponent {
} }
} }
class Window extends StatefulComponent { class Window extends StatefulWidget {
Window({ Key key, this.child, this.onClose }) : super(key: key); Window({ Key key, this.child, this.onClose }) : super(key: key);
final ChildViewConnection child; final ChildViewConnection child;
...@@ -155,7 +155,7 @@ class _WindowState extends State<Window> { ...@@ -155,7 +155,7 @@ class _WindowState extends State<Window> {
} }
} }
class LauncherItem extends StatelessComponent { class LauncherItem extends StatelessWidget {
LauncherItem({ LauncherItem({
Key key, Key key,
this.url, this.url,
...@@ -175,7 +175,7 @@ class LauncherItem extends StatelessComponent { ...@@ -175,7 +175,7 @@ class LauncherItem extends StatelessComponent {
} }
} }
class Launcher extends StatelessComponent { class Launcher extends StatelessWidget {
Launcher({ Key key, this.items }) : super(key: key); Launcher({ Key key, this.items }) : super(key: key);
final List<Widget> items; final List<Widget> items;
...@@ -188,7 +188,7 @@ class Launcher extends StatelessComponent { ...@@ -188,7 +188,7 @@ class Launcher extends StatelessComponent {
} }
} }
class WindowManager extends StatefulComponent { class WindowManager extends StatefulWidget {
_WindowManagerState createState() => new _WindowManagerState(); _WindowManagerState createState() => new _WindowManagerState();
} }
......
...@@ -52,7 +52,7 @@ class _MarkerPainter extends CustomPainter { ...@@ -52,7 +52,7 @@ class _MarkerPainter extends CustomPainter {
} }
} }
class Marker extends StatelessComponent { class Marker extends StatelessWidget {
Marker({ Marker({
this.type: MarkerType.touch, this.type: MarkerType.touch,
this.position, this.position,
...@@ -82,7 +82,7 @@ class Marker extends StatelessComponent { ...@@ -82,7 +82,7 @@ class Marker extends StatelessComponent {
} }
} }
class OverlayGeometryApp extends StatefulComponent { class OverlayGeometryApp extends StatefulWidget {
OverlayGeometryAppState createState() => new OverlayGeometryAppState(); OverlayGeometryAppState createState() => new OverlayGeometryAppState();
} }
......
...@@ -13,7 +13,7 @@ class CardModel { ...@@ -13,7 +13,7 @@ class CardModel {
Key get key => new ObjectKey(this); Key get key => new ObjectKey(this);
} }
class PageableListApp extends StatefulComponent { class PageableListApp extends StatefulWidget {
PageableListAppState createState() => new PageableListAppState(); PageableListAppState createState() => new PageableListAppState();
} }
......
...@@ -30,7 +30,7 @@ void main() { ...@@ -30,7 +30,7 @@ void main() {
); );
} }
class RawKeyboardDemo extends StatefulComponent { class RawKeyboardDemo extends StatefulWidget {
RawKeyboardDemo({ GlobalKey key }) : super(key: key); RawKeyboardDemo({ GlobalKey key }) : super(key: key);
_HardwareKeyDemoState createState() => new _HardwareKeyDemoState(); _HardwareKeyDemoState createState() => new _HardwareKeyDemoState();
......
...@@ -51,7 +51,7 @@ class PianoKey { ...@@ -51,7 +51,7 @@ class PianoKey {
} }
} }
class PianoApp extends StatelessComponent { class PianoApp extends StatelessWidget {
final List<PianoKey> keys = <PianoKey>[ final List<PianoKey> keys = <PianoKey>[
new PianoKey(Colors.red[500], chimes), new PianoKey(Colors.red[500], chimes),
new PianoKey(Colors.orange[500], chainsaw), new PianoKey(Colors.orange[500], chainsaw),
......
...@@ -46,7 +46,7 @@ class _MyAutoLayoutDelegate extends AutoLayoutDelegate { ...@@ -46,7 +46,7 @@ class _MyAutoLayoutDelegate extends AutoLayoutDelegate {
bool shouldUpdateConstraints(_MyAutoLayoutDelegate oldDelegate) => true; bool shouldUpdateConstraints(_MyAutoLayoutDelegate oldDelegate) => true;
} }
class ColoredBoxes extends StatefulComponent { class ColoredBoxes extends StatefulWidget {
_ColoredBoxesState createState() => new _ColoredBoxesState(); _ColoredBoxesState createState() => new _ColoredBoxesState();
} }
......
...@@ -54,7 +54,7 @@ class _GesturePainter extends CustomPainter { ...@@ -54,7 +54,7 @@ class _GesturePainter extends CustomPainter {
} }
} }
class GestureDemo extends StatefulComponent { class GestureDemo extends StatefulWidget {
_GestureDemoState createState() => new _GestureDemoState(); _GestureDemoState createState() => new _GestureDemoState();
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class AdaptedListItem extends StatelessComponent { class AdaptedListItem extends StatelessWidget {
AdaptedListItem({ Key key, this.name }) : super(key: key); AdaptedListItem({ Key key, this.name }) : super(key: key);
final String name; final String name;
...@@ -26,7 +26,7 @@ class AdaptedListItem extends StatelessComponent { ...@@ -26,7 +26,7 @@ class AdaptedListItem extends StatelessComponent {
} }
} }
class AdaptedGridItem extends StatelessComponent { class AdaptedGridItem extends StatelessWidget {
AdaptedGridItem({ Key key, this.name }) : super(key: key); AdaptedGridItem({ Key key, this.name }) : super(key: key);
final String name; final String name;
...@@ -65,7 +65,7 @@ const double _kListItemExtent = 50.0; ...@@ -65,7 +65,7 @@ const double _kListItemExtent = 50.0;
const double _kMaxTileWidth = 150.0; const double _kMaxTileWidth = 150.0;
const double _kGridViewBreakpoint = 450.0; const double _kGridViewBreakpoint = 450.0;
class AdaptiveContainer extends StatelessComponent { class AdaptiveContainer extends StatelessWidget {
AdaptiveContainer({ Key key, this.names }) : super(key: key); AdaptiveContainer({ Key key, this.names }) : super(key: key);
final List<String> names; final List<String> names;
......
...@@ -16,7 +16,7 @@ RenderBox initCircle() { ...@@ -16,7 +16,7 @@ RenderBox initCircle() {
); );
} }
class SectorApp extends StatefulComponent { class SectorApp extends StatefulWidget {
SectorAppState createState() => new SectorAppState(); SectorAppState createState() => new SectorAppState();
} }
......
...@@ -16,7 +16,7 @@ void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex ...@@ -16,7 +16,7 @@ void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex
} }
// Solid colour, Widget version // Solid colour, Widget version
class Rectangle extends StatelessComponent { class Rectangle extends StatelessWidget {
Rectangle(this.color, { Key key }) : super(key: key); Rectangle(this.color, { Key key }) : super(key: key);
final Color color; final Color color;
Widget build(BuildContext context) { Widget build(BuildContext context) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
class SpinningSquare extends StatefulComponent { class SpinningSquare extends StatefulWidget {
_SpinningSquareState createState() => new _SpinningSquareState(); _SpinningSquareState createState() => new _SpinningSquareState();
} }
......
...@@ -57,7 +57,7 @@ Widget toStyledText(String name, String text) { ...@@ -57,7 +57,7 @@ Widget toStyledText(String name, String text) {
Widget toPlainText(String name, String text) => new Text(name + ":" + text); Widget toPlainText(String name, String text) => new Text(name + ":" + text);
class SpeakerSeparator extends StatelessComponent { class SpeakerSeparator extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Container( return new Container(
constraints: const BoxConstraints.expand(height: 0.0), constraints: const BoxConstraints.expand(height: 0.0),
...@@ -71,7 +71,7 @@ class SpeakerSeparator extends StatelessComponent { ...@@ -71,7 +71,7 @@ class SpeakerSeparator extends StatelessComponent {
} }
} }
class StyledTextDemo extends StatefulComponent { class StyledTextDemo extends StatefulWidget {
_StyledTextDemoState createState() => new _StyledTextDemoState(); _StyledTextDemoState createState() => new _StyledTextDemoState();
} }
......
...@@ -55,7 +55,7 @@ class _ButtonDemo { ...@@ -55,7 +55,7 @@ class _ButtonDemo {
int get hashCode => hashValues(title.hashCode, text.hashCode); int get hashCode => hashValues(title.hashCode, text.hashCode);
} }
class ButtonsDemo extends StatefulComponent { class ButtonsDemo extends StatefulWidget {
_ButtonsDemoState createState() => new _ButtonsDemoState(); _ButtonsDemoState createState() => new _ButtonsDemoState();
} }
......
...@@ -36,7 +36,7 @@ final List<TravelDestination> destinations = <TravelDestination>[ ...@@ -36,7 +36,7 @@ final List<TravelDestination> destinations = <TravelDestination>[
) )
]; ];
class TravelDestinationItem extends StatelessComponent { class TravelDestinationItem extends StatelessWidget {
TravelDestinationItem({ Key key, this.destination }) : super(key: key) { TravelDestinationItem({ Key key, this.destination }) : super(key: key) {
assert(destination != null && destination.isValid); assert(destination != null && destination.isValid);
} }
...@@ -114,7 +114,7 @@ class TravelDestinationItem extends StatelessComponent { ...@@ -114,7 +114,7 @@ class TravelDestinationItem extends StatelessComponent {
} }
} }
class CardsDemo extends StatelessComponent { class CardsDemo extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Scaffold( return new Scaffold(
toolBar: new ToolBar( toolBar: new ToolBar(
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ChipDemo extends StatefulComponent { class ChipDemo extends StatefulWidget {
_ChipDemoState createState() => new _ChipDemoState(); _ChipDemoState createState() => new _ChipDemoState();
} }
......
...@@ -41,7 +41,7 @@ const List<ColorSwatch> colorSwatches = const <ColorSwatch>[ ...@@ -41,7 +41,7 @@ const List<ColorSwatch> colorSwatches = const <ColorSwatch>[
]; ];
class ColorItem extends StatelessComponent { class ColorItem extends StatelessWidget {
ColorItem({ Key key, this.index, this.color, this.prefix: '' }) : super(key: key) { ColorItem({ Key key, this.index, this.color, this.prefix: '' }) : super(key: key) {
assert(index != null); assert(index != null);
assert(color != null); assert(color != null);
...@@ -71,7 +71,7 @@ class ColorItem extends StatelessComponent { ...@@ -71,7 +71,7 @@ class ColorItem extends StatelessComponent {
} }
} }
class ColorSwatchTabView extends StatelessComponent { class ColorSwatchTabView extends StatelessWidget {
ColorSwatchTabView({ Key key, this.swatch }) : super(key: key) { ColorSwatchTabView({ Key key, this.swatch }) : super(key: key) {
assert(swatch != null && swatch.isValid); assert(swatch != null && swatch.isValid);
} }
...@@ -106,7 +106,7 @@ class ColorSwatchTabView extends StatelessComponent { ...@@ -106,7 +106,7 @@ class ColorSwatchTabView extends StatelessComponent {
} }
} }
class ColorsDemo extends StatelessComponent { class ColorsDemo extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new TabBarSelection<ColorSwatch>( return new TabBarSelection<ColorSwatch>(
values: colorSwatches, values: colorSwatches,
......
...@@ -7,7 +7,7 @@ import 'dart:async'; ...@@ -7,7 +7,7 @@ import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
class DatePickerDemo extends StatefulComponent { class DatePickerDemo extends StatefulWidget {
_DatePickerDemoState createState() => new _DatePickerDemoState(); _DatePickerDemoState createState() => new _DatePickerDemoState();
} }
......
...@@ -20,7 +20,7 @@ const String _alertWithTitleText = ...@@ -20,7 +20,7 @@ const String _alertWithTitleText =
"Let Google help apps determine location. This means sending anyonmous location " "Let Google help apps determine location. This means sending anyonmous location "
"data to Google, even when no apps are running."; "data to Google, even when no apps are running.";
class DialogDemoItem extends StatelessComponent { class DialogDemoItem extends StatelessWidget {
DialogDemoItem({ Key key, this.icon, this.color, this.text, this.onPressed }) : super(key: key); DialogDemoItem({ Key key, this.icon, this.color, this.text, this.onPressed }) : super(key: key);
final IconData icon; final IconData icon;
...@@ -53,7 +53,7 @@ class DialogDemoItem extends StatelessComponent { ...@@ -53,7 +53,7 @@ class DialogDemoItem extends StatelessComponent {
} }
} }
class DialogDemo extends StatefulComponent { class DialogDemo extends StatefulWidget {
DialogDemoState createState() => new DialogDemoState(); DialogDemoState createState() => new DialogDemoState();
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class DropDownDemo extends StatefulComponent { class DropDownDemo extends StatefulWidget {
_DropDownDemoState createState() => new _DropDownDemoState(); _DropDownDemoState createState() => new _DropDownDemoState();
} }
......
...@@ -13,7 +13,7 @@ import 'package:vector_math/vector_math_64.dart' as vec; ...@@ -13,7 +13,7 @@ import 'package:vector_math/vector_math_64.dart' as vec;
ImageMap _images; ImageMap _images;
SpriteSheet _sprites; SpriteSheet _sprites;
class FitnessDemo extends StatelessComponent { class FitnessDemo extends StatelessWidget {
FitnessDemo({ Key key }) : super(key: key); FitnessDemo({ Key key }) : super(key: key);
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -26,7 +26,7 @@ class FitnessDemo extends StatelessComponent { ...@@ -26,7 +26,7 @@ class FitnessDemo extends StatelessComponent {
} }
} }
class _FitnessDemoContents extends StatefulComponent { class _FitnessDemoContents extends StatefulWidget {
_FitnessDemoContents({ Key key }) : super(key: key); _FitnessDemoContents({ Key key }) : super(key: key);
_FitnessDemoContentsState createState() => new _FitnessDemoContentsState(); _FitnessDemoContentsState createState() => new _FitnessDemoContentsState();
} }
...@@ -510,7 +510,7 @@ class _JumpingJackPart extends Sprite { ...@@ -510,7 +510,7 @@ class _JumpingJackPart extends Sprite {
} }
} }
class _Fireworks extends StatefulComponent { class _Fireworks extends StatefulWidget {
_Fireworks({ Key key }) : super(key: key); _Fireworks({ Key key }) : super(key: key);
_FireworksState createState() => new _FireworksState(); _FireworksState createState() => new _FireworksState();
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
class _ContactCategory extends StatelessComponent { class _ContactCategory extends StatelessWidget {
_ContactCategory({ Key key, this.icon, this.children }) : super(key: key); _ContactCategory({ Key key, this.icon, this.children }) : super(key: key);
final IconData icon; final IconData icon;
...@@ -33,7 +33,7 @@ class _ContactCategory extends StatelessComponent { ...@@ -33,7 +33,7 @@ class _ContactCategory extends StatelessComponent {
} }
} }
class _ContactItem extends StatelessComponent { class _ContactItem extends StatelessWidget {
_ContactItem({ Key key, this.icon, this.lines }) : super(key: key) { _ContactItem({ Key key, this.icon, this.lines }) : super(key: key) {
assert(lines.length > 1); assert(lines.length > 1);
} }
...@@ -67,7 +67,7 @@ class _ContactItem extends StatelessComponent { ...@@ -67,7 +67,7 @@ class _ContactItem extends StatelessComponent {
} }
} }
class FlexibleSpaceDemo extends StatefulComponent { class FlexibleSpaceDemo extends StatefulWidget {
FlexibleSpaceDemoState createState() => new FlexibleSpaceDemoState(); FlexibleSpaceDemoState createState() => new FlexibleSpaceDemoState();
} }
......
...@@ -15,7 +15,7 @@ enum DismissDialogAction { ...@@ -15,7 +15,7 @@ enum DismissDialogAction {
save, save,
} }
class DateTimeItem extends StatelessComponent { class DateTimeItem extends StatelessWidget {
DateTimeItem({ Key key, DateTime dateTime, this.onChanged }) DateTimeItem({ Key key, DateTime dateTime, this.onChanged })
: date = new DateTime(dateTime.year, dateTime.month, dateTime.day), : date = new DateTime(dateTime.year, dateTime.month, dateTime.day),
time = new TimeOfDay(hour: dateTime.hour, minute: dateTime.minute), time = new TimeOfDay(hour: dateTime.hour, minute: dateTime.minute),
...@@ -92,7 +92,7 @@ class DateTimeItem extends StatelessComponent { ...@@ -92,7 +92,7 @@ class DateTimeItem extends StatelessComponent {
} }
} }
class FullScreenDialogDemo extends StatefulComponent { class FullScreenDialogDemo extends StatefulWidget {
FullScreenDialogDemoState createState() => new FullScreenDialogDemoState(); FullScreenDialogDemoState createState() => new FullScreenDialogDemoState();
} }
......
...@@ -28,7 +28,7 @@ final List<Photo> photos = new List<Photo>.generate(16, (int index) { ...@@ -28,7 +28,7 @@ final List<Photo> photos = new List<Photo>.generate(16, (int index) {
return const Photo(assetName: 'packages/flutter_gallery_assets/kangaroo_valley_safari.png'); return const Photo(assetName: 'packages/flutter_gallery_assets/kangaroo_valley_safari.png');
}); });
class GridDemoPhotoItem extends StatelessComponent { class GridDemoPhotoItem extends StatelessWidget {
GridDemoPhotoItem({ Key key, this.photo, this.tileStyle }) : super(key: key) { GridDemoPhotoItem({ Key key, this.photo, this.tileStyle }) : super(key: key) {
assert(photo != null && photo.isValid); assert(photo != null && photo.isValid);
assert(tileStyle != null); assert(tileStyle != null);
...@@ -128,7 +128,7 @@ class GridListDemoGridDelegate extends FixedColumnCountGridDelegate { ...@@ -128,7 +128,7 @@ class GridListDemoGridDelegate extends FixedColumnCountGridDelegate {
} }
} }
class GridListDemo extends StatefulComponent { class GridListDemo extends StatefulWidget {
GridListDemo({ Key key }) : super(key: key); GridListDemo({ Key key }) : super(key: key);
GridListDemoState createState() => new GridListDemoState(); GridListDemoState createState() => new GridListDemoState();
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class IconsDemo extends StatefulComponent { class IconsDemo extends StatefulWidget {
IconsDemoState createState() => new IconsDemoState(); IconsDemoState createState() => new IconsDemoState();
} }
......
...@@ -25,7 +25,7 @@ class LeaveBehindItem { ...@@ -25,7 +25,7 @@ class LeaveBehindItem {
final String body; final String body;
} }
class LeaveBehindDemo extends StatefulComponent { class LeaveBehindDemo extends StatefulWidget {
LeaveBehindDemo({ Key key }) : super(key: key); LeaveBehindDemo({ Key key }) : super(key: key);
LeaveBehindDemoState createState() => new LeaveBehindDemoState(); LeaveBehindDemoState createState() => new LeaveBehindDemoState();
......
...@@ -10,7 +10,7 @@ enum ListDemoItemSize { ...@@ -10,7 +10,7 @@ enum ListDemoItemSize {
threeLine threeLine
} }
class ListDemo extends StatefulComponent { class ListDemo extends StatefulWidget {
ListDemo({ Key key }) : super(key: key); ListDemo({ Key key }) : super(key: key);
ListDemoState createState() => new ListDemoState(); ListDemoState createState() => new ListDemoState();
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class MenuDemo extends StatefulComponent { class MenuDemo extends StatefulWidget {
MenuDemo({ Key key }) : super(key: key); MenuDemo({ Key key }) : super(key: key);
MenuDemoState createState() => new MenuDemoState(); MenuDemoState createState() => new MenuDemoState();
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ModalBottomSheetDemo extends StatelessComponent { class ModalBottomSheetDemo extends StatelessWidget {
final TextStyle textStyle = new TextStyle( final TextStyle textStyle = new TextStyle(
color: Colors.indigo[400], color: Colors.indigo[400],
fontSize: 24.0, fontSize: 24.0,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PageSelectorDemo extends StatelessComponent { class PageSelectorDemo extends StatelessWidget {
void _handleArrowButtonPress(BuildContext context, int delta) { void _handleArrowButtonPress(BuildContext context, int delta) {
final TabBarSelectionState<IconData> selection = TabBarSelection.of/*<IconData>*/(context); final TabBarSelectionState<IconData> selection = TabBarSelection.of/*<IconData>*/(context);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PersistentBottomSheetDemo extends StatelessComponent { class PersistentBottomSheetDemo extends StatelessWidget {
final TextStyle textStyle = new TextStyle( final TextStyle textStyle = new TextStyle(
color: Colors.indigo[400], color: Colors.indigo[400],
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ProgressIndicatorDemo extends StatefulComponent { class ProgressIndicatorDemo extends StatefulWidget {
_ProgressIndicatorDemoState createState() => new _ProgressIndicatorDemoState(); _ProgressIndicatorDemoState createState() => new _ProgressIndicatorDemoState();
} }
......
...@@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import 'flexible_space_demo.dart'; import 'flexible_space_demo.dart';
class _BarGraphic extends StatelessComponent { class _BarGraphic extends StatelessWidget {
_BarGraphic({ Key key, this.height, this.color, this.leftText, this.rightText: '' }) _BarGraphic({ Key key, this.height, this.color, this.leftText, this.rightText: '' })
: super(key: key) { : super(key: key) {
assert(height != null); assert(height != null);
...@@ -74,7 +74,7 @@ class _FlexibleSpaceGraphic extends _BarGraphic { ...@@ -74,7 +74,7 @@ class _FlexibleSpaceGraphic extends _BarGraphic {
); );
} }
class _TechniqueItem extends StatelessComponent { class _TechniqueItem extends StatelessWidget {
_TechniqueItem({ this.titleText, this.barGraphics, this.builder }); _TechniqueItem({ this.titleText, this.barGraphics, this.builder });
final String titleText; final String titleText;
...@@ -110,7 +110,7 @@ const String _introText = ...@@ -110,7 +110,7 @@ const String _introText =
"it appears behind the device's status bar. When a flexible space Widget is " "it appears behind the device's status bar. When a flexible space Widget is "
"specified it is stacked on top of the ToolBar."; "specified it is stacked on top of the ToolBar.";
class ScrollingTechniquesDemo extends StatelessComponent { class ScrollingTechniquesDemo extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Scaffold( return new Scaffold(
toolBar: new ToolBar(center: new Text('Scrolling Techniques')), toolBar: new ToolBar(center: new Text('Scrolling Techniques')),
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class SliderDemo extends StatefulComponent { class SliderDemo extends StatefulWidget {
_SliderDemoState createState() => new _SliderDemoState(); _SliderDemoState createState() => new _SliderDemoState();
} }
......
...@@ -17,7 +17,7 @@ const String _text2 = ...@@ -17,7 +17,7 @@ const String _text2 =
const String _text3 = const String _text3 =
"By default snackbars automatically disappear after a few seconds "; "By default snackbars automatically disappear after a few seconds ";
class SnackBarDemo extends StatelessComponent { class SnackBarDemo extends StatelessWidget {
SnackBarDemo({ Key key }) : super(key: key); SnackBarDemo({ Key key }) : super(key: key);
Widget buildBody(BuildContext context) { Widget buildBody(BuildContext context) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class TabsDemo extends StatelessComponent { class TabsDemo extends StatelessWidget {
final List<IconData> icons = <IconData>[ final List<IconData> icons = <IconData>[
Icons.event, Icons.event,
Icons.home, Icons.home,
......
...@@ -25,7 +25,7 @@ const String _explanatoryText = ...@@ -25,7 +25,7 @@ const String _explanatoryText =
"with a FloatingActionButton that the Scaffold distinguishes from the others " "with a FloatingActionButton that the Scaffold distinguishes from the others "
"by its key."; "by its key.";
class TabsFabDemo extends StatefulComponent { class TabsFabDemo extends StatefulWidget {
_TabsFabDemoState createState() => new _TabsFabDemoState(); _TabsFabDemoState createState() => new _TabsFabDemoState();
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class TextFieldDemo extends StatefulComponent { class TextFieldDemo extends StatefulWidget {
TextFieldDemo({ Key key }) : super(key: key); TextFieldDemo({ Key key }) : super(key: key);
TextFieldDemoState createState() => new TextFieldDemoState(); TextFieldDemoState createState() => new TextFieldDemoState();
......
...@@ -6,7 +6,7 @@ import 'dart:async'; ...@@ -6,7 +6,7 @@ import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class TimePickerDemo extends StatefulComponent { class TimePickerDemo extends StatefulWidget {
_TimePickerDemoState createState() => new _TimePickerDemoState(); _TimePickerDemoState createState() => new _TimePickerDemoState();
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ToggleControlsDemo extends StatefulComponent { class ToggleControlsDemo extends StatefulWidget {
_ToggleControlsDemoState createState() => new _ToggleControlsDemoState(); _ToggleControlsDemoState createState() => new _ToggleControlsDemoState();
} }
......
...@@ -9,7 +9,7 @@ const String _introText = ...@@ -9,7 +9,7 @@ const String _introText =
"a long press. Tooltip messages are also used by services that make Flutter " "a long press. Tooltip messages are also used by services that make Flutter "
"apps accessible, like screen readers."; "apps accessible, like screen readers.";
class TooltipDemo extends StatelessComponent { class TooltipDemo extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
return new Scaffold( return new Scaffold(
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class TwoLevelListDemo extends StatelessComponent { class TwoLevelListDemo extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Scaffold( return new Scaffold(
toolBar: new ToolBar(center: new Text('Expand/Collapse List Control')), toolBar: new ToolBar(center: new Text('Expand/Collapse List Control')),
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
class TextStyleItem extends StatelessComponent { class TextStyleItem extends StatelessWidget {
TextStyleItem({ Key key, this.name, this.style, this.text }) : super(key: key) { TextStyleItem({ Key key, this.name, this.style, this.text }) : super(key: key) {
assert(name != null); assert(name != null);
assert(style != null); assert(style != null);
...@@ -37,7 +37,7 @@ class TextStyleItem extends StatelessComponent { ...@@ -37,7 +37,7 @@ class TextStyleItem extends StatelessComponent {
} }
} }
class TypographyDemo extends StatelessComponent { class TypographyDemo extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final TextTheme textTheme = Theme.of(context).textTheme; final TextTheme textTheme = Theme.of(context).textTheme;
final List<Widget> styleItems = <Widget>[ final List<Widget> styleItems = <Widget>[
......
...@@ -17,7 +17,7 @@ enum WeatherType { ...@@ -17,7 +17,7 @@ enum WeatherType {
snow snow
} }
class WeatherDemo extends StatefulComponent { class WeatherDemo extends StatefulWidget {
WeatherDemo({ Key key }) : super(key: key); WeatherDemo({ Key key }) : super(key: key);
_WeatherDemoState createState() => new _WeatherDemoState(); _WeatherDemoState createState() => new _WeatherDemoState();
} }
...@@ -125,7 +125,7 @@ class _WeatherDemoState extends State<WeatherDemo> { ...@@ -125,7 +125,7 @@ class _WeatherDemoState extends State<WeatherDemo> {
const double _kWeatherButtonSize = 56.0; const double _kWeatherButtonSize = 56.0;
const double _kWeatherIconSize = 36.0; const double _kWeatherIconSize = 36.0;
class WeatherButton extends StatelessComponent { class WeatherButton extends StatelessWidget {
WeatherButton({ this.icon, this.selected, this.onPressed, Key key }) : super(key: key); WeatherButton({ this.icon, this.selected, this.onPressed, Key key }) : super(key: key);
final String icon; final String icon;
......
...@@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import 'home.dart'; import 'home.dart';
class GalleryApp extends StatefulComponent { class GalleryApp extends StatefulWidget {
GalleryApp({ Key key }) : super(key: key); GalleryApp({ Key key }) : super(key: key);
static GalleryAppState of(BuildContext context) => context.ancestorStateOfType(const TypeMatcher<GalleryAppState>()); static GalleryAppState of(BuildContext context) => context.ancestorStateOfType(const TypeMatcher<GalleryAppState>());
......
...@@ -8,7 +8,7 @@ import 'package:flutter/widgets.dart'; ...@@ -8,7 +8,7 @@ import 'package:flutter/widgets.dart';
import 'app.dart'; import 'app.dart';
class GalleryDrawer extends StatelessComponent { class GalleryDrawer extends StatelessWidget {
GalleryDrawer({ Key key }) : super(key: key); GalleryDrawer({ Key key }) : super(key: key);
void _changeTheme(BuildContext context, bool value) { void _changeTheme(BuildContext context, bool value) {
......
...@@ -39,7 +39,7 @@ import '../demo/two_level_list_demo.dart'; ...@@ -39,7 +39,7 @@ import '../demo/two_level_list_demo.dart';
import '../demo/typography_demo.dart'; import '../demo/typography_demo.dart';
import '../demo/weather_demo.dart'; import '../demo/weather_demo.dart';
class GalleryHome extends StatefulComponent { class GalleryHome extends StatefulWidget {
GalleryHome({ Key key }) : super(key: key); GalleryHome({ Key key }) : super(key: key);
GalleryHomeState createState() => new GalleryHomeState(); GalleryHomeState createState() => new GalleryHomeState();
......
...@@ -7,7 +7,7 @@ import 'package:flutter/widgets.dart'; ...@@ -7,7 +7,7 @@ import 'package:flutter/widgets.dart';
import 'demo.dart'; import 'demo.dart';
class GallerySection extends StatelessComponent { class GallerySection extends StatelessWidget {
GallerySection({ this.title, this.image, this.colors, this.demos }); GallerySection({ this.title, this.image, this.colors, this.demos });
final String title; final String title;
......
...@@ -23,7 +23,7 @@ import 'stock_strings.dart'; ...@@ -23,7 +23,7 @@ import 'stock_strings.dart';
import 'stock_symbol_viewer.dart'; import 'stock_symbol_viewer.dart';
import 'stock_types.dart'; import 'stock_types.dart';
class StocksApp extends StatefulComponent { class StocksApp extends StatefulWidget {
StocksAppState createState() => new StocksAppState(); StocksAppState createState() => new StocksAppState();
} }
......
...@@ -50,7 +50,7 @@ class StockArrowPainter extends CustomPainter { ...@@ -50,7 +50,7 @@ class StockArrowPainter extends CustomPainter {
} }
} }
class StockArrow extends StatelessComponent { class StockArrow extends StatelessWidget {
StockArrow({ Key key, this.percentChange }) : super(key: key); StockArrow({ Key key, this.percentChange }) : super(key: key);
final double percentChange; final double percentChange;
......
...@@ -18,7 +18,7 @@ typedef void ModeUpdater(StockMode mode); ...@@ -18,7 +18,7 @@ typedef void ModeUpdater(StockMode mode);
enum _StockMenuItem { autorefresh, refresh, speedUp, speedDown } enum _StockMenuItem { autorefresh, refresh, speedUp, speedDown }
enum StockHomeTab { market, portfolio } enum StockHomeTab { market, portfolio }
class _NotImplementedDialog extends StatelessComponent { class _NotImplementedDialog extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Dialog( return new Dialog(
title: new Text('Not Implemented'), title: new Text('Not Implemented'),
...@@ -50,7 +50,7 @@ class _NotImplementedDialog extends StatelessComponent { ...@@ -50,7 +50,7 @@ class _NotImplementedDialog extends StatelessComponent {
} }
} }
class StockHome extends StatefulComponent { class StockHome extends StatefulWidget {
const StockHome(this.stocks, this.symbols, this.configuration, this.updater); const StockHome(this.stocks, this.symbols, this.configuration, this.updater);
final Map<String, Stock> stocks; final Map<String, Stock> stocks;
...@@ -355,7 +355,7 @@ class StockHomeState extends State<StockHome> { ...@@ -355,7 +355,7 @@ class StockHomeState extends State<StockHome> {
} }
} }
class _CreateCompanySheet extends StatefulComponent { class _CreateCompanySheet extends StatefulWidget {
_CreateCompanySheetState createState() => new _CreateCompanySheetState(); _CreateCompanySheetState createState() => new _CreateCompanySheetState();
} }
......
...@@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; ...@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
import 'stock_data.dart'; import 'stock_data.dart';
import 'stock_row.dart'; import 'stock_row.dart';
class StockList extends StatelessComponent { class StockList extends StatelessWidget {
StockList({ Key key, this.keySalt, this.stocks, this.onOpen, this.onShow, this.onAction }) : super(key: key); StockList({ Key key, this.keySalt, this.stocks, this.onOpen, this.onShow, this.onAction }) : super(key: key);
final Object keySalt; final Object keySalt;
......
...@@ -30,7 +30,7 @@ class StockRowPartKey extends Key { ...@@ -30,7 +30,7 @@ class StockRowPartKey extends Key {
typedef void StockRowActionCallback(Stock stock, Key arrowKey); typedef void StockRowActionCallback(Stock stock, Key arrowKey);
class StockRow extends StatelessComponent { class StockRow extends StatelessWidget {
StockRow({ StockRow({
Stock stock, Stock stock,
Object keySalt, Object keySalt,
......
...@@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import 'stock_types.dart'; import 'stock_types.dart';
class StockSettings extends StatefulComponent { class StockSettings extends StatefulWidget {
const StockSettings(this.configuration, this.updater); const StockSettings(this.configuration, this.updater);
final StockConfiguration configuration; final StockConfiguration configuration;
......
...@@ -8,7 +8,7 @@ import 'stock_data.dart'; ...@@ -8,7 +8,7 @@ import 'stock_data.dart';
import 'stock_arrow.dart'; import 'stock_arrow.dart';
import 'stock_row.dart'; import 'stock_row.dart';
class StockSymbolView extends StatelessComponent { class StockSymbolView extends StatelessWidget {
StockSymbolView({ this.stock }); StockSymbolView({ this.stock });
final Stock stock; final Stock stock;
...@@ -66,7 +66,7 @@ class StockSymbolView extends StatelessComponent { ...@@ -66,7 +66,7 @@ class StockSymbolView extends StatelessComponent {
} }
} }
class StockSymbolPage extends StatelessComponent { class StockSymbolPage extends StatelessWidget {
StockSymbolPage({ this.stock }); StockSymbolPage({ this.stock });
final Stock stock; final Stock stock;
...@@ -88,7 +88,7 @@ class StockSymbolPage extends StatelessComponent { ...@@ -88,7 +88,7 @@ class StockSymbolPage extends StatelessComponent {
} }
} }
class StockSymbolBottomSheet extends StatelessComponent { class StockSymbolBottomSheet extends StatelessWidget {
StockSymbolBottomSheet({ this.stock }); StockSymbolBottomSheet({ this.stock });
final Stock stock; final Stock stock;
......
...@@ -15,7 +15,7 @@ const double _kCloseProgressThreshold = 0.5; ...@@ -15,7 +15,7 @@ const double _kCloseProgressThreshold = 0.5;
const Color _kTransparent = const Color(0x00000000); const Color _kTransparent = const Color(0x00000000);
const Color _kBarrierColor = Colors.black54; const Color _kBarrierColor = Colors.black54;
class BottomSheet extends StatefulComponent { class BottomSheet extends StatefulWidget {
BottomSheet({ BottomSheet({
Key key, Key key,
this.animationController, this.animationController,
...@@ -117,7 +117,7 @@ class _ModalBottomSheetLayout extends SingleChildLayoutDelegate { ...@@ -117,7 +117,7 @@ class _ModalBottomSheetLayout extends SingleChildLayoutDelegate {
} }
} }
class _ModalBottomSheet<T> extends StatefulComponent { class _ModalBottomSheet<T> extends StatefulWidget {
_ModalBottomSheet({ Key key, this.route }) : super(key: key); _ModalBottomSheet({ Key key, this.route }) : super(key: key);
final _ModalBottomSheetRoute<T> route; final _ModalBottomSheetRoute<T> route;
......
...@@ -39,7 +39,7 @@ class ButtonTheme extends InheritedWidget { ...@@ -39,7 +39,7 @@ class ButtonTheme extends InheritedWidget {
/// ///
/// MaterialButtons whose [onPressed] handler is null will be disabled. To have /// MaterialButtons whose [onPressed] handler is null will be disabled. To have
/// an enabled button, make sure to pass a non-null value for onPressed. /// an enabled button, make sure to pass a non-null value for onPressed.
abstract class MaterialButton extends StatefulComponent { abstract class MaterialButton extends StatefulWidget {
MaterialButton({ MaterialButton({
Key key, Key key,
this.child, this.child,
......
...@@ -11,7 +11,7 @@ const EdgeInsets _kCardMargins = const EdgeInsets.all(4.0); ...@@ -11,7 +11,7 @@ const EdgeInsets _kCardMargins = const EdgeInsets.all(4.0);
/// A material design card /// A material design card
/// ///
/// <https://www.google.com/design/spec/components/cards.html> /// <https://www.google.com/design/spec/components/cards.html>
class Card extends StatelessComponent { class Card extends StatelessWidget {
const Card({ Key key, this.child, this.color }) : super(key: key); const Card({ Key key, this.child, this.color }) : super(key: key);
final Widget child; final Widget child;
......
...@@ -21,7 +21,7 @@ import 'toggleable.dart'; ...@@ -21,7 +21,7 @@ import 'toggleable.dart';
/// the checkbox. /// the checkbox.
/// ///
/// <https://www.google.com/design/spec/components/lists-controls.html#lists-controls-types-of-list-controls> /// <https://www.google.com/design/spec/components/lists-controls.html#lists-controls-types-of-list-controls>
class Checkbox extends StatelessComponent { class Checkbox extends StatelessWidget {
/// Constructs a checkbox /// Constructs a checkbox
/// ///
/// * `value` determines whether the checkbox is checked. /// * `value` determines whether the checkbox is checked.
......
...@@ -21,7 +21,7 @@ const TextStyle _kLabelStyle = const TextStyle( ...@@ -21,7 +21,7 @@ const TextStyle _kLabelStyle = const TextStyle(
textBaseline: TextBaseline.alphabetic textBaseline: TextBaseline.alphabetic
); );
class Chip extends StatelessComponent { class Chip extends StatelessWidget {
const Chip({ const Chip({
Key key, Key key,
this.avatar, this.avatar,
......
...@@ -7,7 +7,7 @@ import 'package:flutter/widgets.dart'; ...@@ -7,7 +7,7 @@ import 'package:flutter/widgets.dart';
import 'constants.dart'; import 'constants.dart';
import 'theme.dart'; import 'theme.dart';
class CircleAvatar extends StatelessComponent { class CircleAvatar extends StatelessWidget {
CircleAvatar({ CircleAvatar({
Key key, Key key,
this.child, this.child,
......
...@@ -17,7 +17,7 @@ import 'typography.dart'; ...@@ -17,7 +17,7 @@ import 'typography.dart';
enum _DatePickerMode { day, year } enum _DatePickerMode { day, year }
class DatePicker extends StatefulComponent { class DatePicker extends StatefulWidget {
DatePicker({ DatePicker({
this.selectedDate, this.selectedDate,
this.onChanged, this.onChanged,
...@@ -105,7 +105,7 @@ class _DatePickerState extends State<DatePicker> { ...@@ -105,7 +105,7 @@ class _DatePickerState extends State<DatePicker> {
} }
// Shows the selected date in large font and toggles between year and day mode // Shows the selected date in large font and toggles between year and day mode
class _DatePickerHeader extends StatelessComponent { class _DatePickerHeader extends StatelessWidget {
_DatePickerHeader({ this.selectedDate, this.mode, this.onModeChanged }) { _DatePickerHeader({ this.selectedDate, this.mode, this.onModeChanged }) {
assert(selectedDate != null); assert(selectedDate != null);
assert(mode != null); assert(mode != null);
...@@ -163,7 +163,7 @@ class _DatePickerHeader extends StatelessComponent { ...@@ -163,7 +163,7 @@ class _DatePickerHeader extends StatelessComponent {
} }
// Fixed height component shows a single month and allows choosing a day // Fixed height component shows a single month and allows choosing a day
class DayPicker extends StatelessComponent { class DayPicker extends StatelessWidget {
DayPicker({ DayPicker({
this.selectedDate, this.selectedDate,
this.currentDate, this.currentDate,
...@@ -269,7 +269,7 @@ class DayPicker extends StatelessComponent { ...@@ -269,7 +269,7 @@ class DayPicker extends StatelessComponent {
} }
} }
class MonthPicker extends StatefulComponent { class MonthPicker extends StatefulWidget {
MonthPicker({ MonthPicker({
Key key, Key key,
this.selectedDate, this.selectedDate,
...@@ -351,7 +351,7 @@ class _MonthPickerState extends State<MonthPicker> { ...@@ -351,7 +351,7 @@ class _MonthPickerState extends State<MonthPicker> {
} }
// Scrollable list of years to allow picking a year // Scrollable list of years to allow picking a year
class YearPicker extends StatefulComponent { class YearPicker extends StatefulWidget {
YearPicker({ YearPicker({
Key key, Key key,
this.selectedDate, this.selectedDate,
......
...@@ -10,7 +10,7 @@ import 'dialog.dart'; ...@@ -10,7 +10,7 @@ import 'dialog.dart';
import 'date_picker.dart'; import 'date_picker.dart';
import 'flat_button.dart'; import 'flat_button.dart';
class _DatePickerDialog extends StatefulComponent { class _DatePickerDialog extends StatefulWidget {
_DatePickerDialog({ _DatePickerDialog({
Key key, Key key,
this.initialDate, this.initialDate,
......
...@@ -16,7 +16,7 @@ typedef Widget DialogBuilder(NavigatorState navigator); ...@@ -16,7 +16,7 @@ typedef Widget DialogBuilder(NavigatorState navigator);
/// A material design dialog /// A material design dialog
/// ///
/// <https://www.google.com/design/spec/components/dialogs.html> /// <https://www.google.com/design/spec/components/dialogs.html>
class Dialog extends StatelessComponent { class Dialog extends StatelessWidget {
Dialog({ Dialog({
Key key, Key key,
this.title, this.title,
......
...@@ -6,7 +6,7 @@ import 'package:flutter/widgets.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter/widgets.dart';
import 'theme.dart'; import 'theme.dart';
class Divider extends StatelessComponent { class Divider extends StatelessWidget {
Divider({ Key key, this.height: 16.0, this.indent: 0.0, this.color }) : super(key: key) { Divider({ Key key, this.height: 16.0, this.indent: 0.0, this.color }) : super(key: key) {
assert(height >= 1.0); assert(height >= 1.0);
} }
......
...@@ -26,7 +26,7 @@ const double _kEdgeDragWidth = 20.0; ...@@ -26,7 +26,7 @@ const double _kEdgeDragWidth = 20.0;
const double _kMinFlingVelocity = 365.0; const double _kMinFlingVelocity = 365.0;
const Duration _kBaseSettleDuration = const Duration(milliseconds: 246); const Duration _kBaseSettleDuration = const Duration(milliseconds: 246);
class Drawer extends StatelessComponent { class Drawer extends StatelessWidget {
Drawer({ Drawer({
Key key, Key key,
this.elevation: 16, this.elevation: 16,
...@@ -47,7 +47,7 @@ class Drawer extends StatelessComponent { ...@@ -47,7 +47,7 @@ class Drawer extends StatelessComponent {
} }
} }
class DrawerController extends StatefulComponent { class DrawerController extends StatefulWidget {
DrawerController({ DrawerController({
GlobalKey key, GlobalKey key,
this.child this.child
......
...@@ -11,7 +11,7 @@ import 'theme.dart'; ...@@ -11,7 +11,7 @@ import 'theme.dart';
// TODO(jackson): This class should usually render the user's // TODO(jackson): This class should usually render the user's
// preferred banner image rather than a solid background // preferred banner image rather than a solid background
class DrawerHeader extends StatelessComponent { class DrawerHeader extends StatelessWidget {
const DrawerHeader({ Key key, this.child }) : super(key: key); const DrawerHeader({ Key key, this.child }) : super(key: key);
final Widget child; final Widget child;
......
...@@ -11,7 +11,7 @@ import 'icons.dart'; ...@@ -11,7 +11,7 @@ import 'icons.dart';
import 'ink_well.dart'; import 'ink_well.dart';
import 'theme.dart'; import 'theme.dart';
class DrawerItem extends StatelessComponent { class DrawerItem extends StatelessWidget {
const DrawerItem({ const DrawerItem({
Key key, Key key,
this.icon, this.icon,
......
...@@ -56,7 +56,7 @@ class _DropDownMenuPainter extends CustomPainter { ...@@ -56,7 +56,7 @@ class _DropDownMenuPainter extends CustomPainter {
} }
} }
class _DropDownMenu<T> extends StatusTransitionComponent { class _DropDownMenu<T> extends StatusTransitionWidget {
_DropDownMenu({ _DropDownMenu({
Key key, Key key,
_DropDownRoute<T> route _DropDownRoute<T> route
...@@ -197,7 +197,7 @@ class _DropDownRoute<T> extends PopupRoute<_DropDownRouteResult<T>> { ...@@ -197,7 +197,7 @@ class _DropDownRoute<T> extends PopupRoute<_DropDownRouteResult<T>> {
} }
} }
class DropDownMenuItem<T> extends StatelessComponent { class DropDownMenuItem<T> extends StatelessWidget {
DropDownMenuItem({ DropDownMenuItem({
Key key, Key key,
this.value, this.value,
...@@ -222,7 +222,7 @@ class DropDownMenuItem<T> extends StatelessComponent { ...@@ -222,7 +222,7 @@ class DropDownMenuItem<T> extends StatelessComponent {
} }
} }
class DropDownButton<T> extends StatefulComponent { class DropDownButton<T> extends StatefulWidget {
DropDownButton({ DropDownButton({
Key key, Key key,
this.items, this.items,
......
...@@ -11,7 +11,7 @@ import 'constants.dart'; ...@@ -11,7 +11,7 @@ import 'constants.dart';
import 'scaffold.dart'; import 'scaffold.dart';
import 'theme.dart'; import 'theme.dart';
class FlexibleSpaceBar extends StatefulComponent { class FlexibleSpaceBar extends StatefulWidget {
FlexibleSpaceBar({ Key key, this.title, this.image }) : super(key: key); FlexibleSpaceBar({ Key key, this.title, this.image }) : super(key: key);
final Widget title; final Widget title;
......
...@@ -33,7 +33,7 @@ const Interval _kChildSegueInterval = const Interval(0.65, 1.0); ...@@ -33,7 +33,7 @@ const Interval _kChildSegueInterval = const Interval(0.65, 1.0);
/// ///
/// See also: /// See also:
/// * https://www.google.com/design/spec/components/buttons-floating-action-button.html /// * https://www.google.com/design/spec/components/buttons-floating-action-button.html
class FloatingActionButton extends StatefulComponent { class FloatingActionButton extends StatefulWidget {
const FloatingActionButton({ const FloatingActionButton({
Key key, Key key,
this.child, this.child,
......
...@@ -6,7 +6,7 @@ import 'package:flutter/widgets.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter/widgets.dart';
/// Creates a [Stack] with the header anchored across the top or a footer across the /// Creates a [Stack] with the header anchored across the top or a footer across the
/// bottom. The [GridTileBar] class can be used to create grid tile headers and footers. /// bottom. The [GridTileBar] class can be used to create grid tile headers and footers.
class GridTile extends StatelessComponent { class GridTile extends StatelessWidget {
GridTile({ Key key, this.header, this.footer, this.child }) : super(key: key) { GridTile({ Key key, this.header, this.footer, this.child }) : super(key: key) {
assert(child != null); assert(child != null);
} }
......
...@@ -15,7 +15,7 @@ import 'typography.dart'; ...@@ -15,7 +15,7 @@ import 'typography.dart';
/// https://www.google.com/design/spec/components/grid-lists.html#grid-lists-specs /// https://www.google.com/design/spec/components/grid-lists.html#grid-lists-specs
/// For a one-line header specify title and to add a second line specify caption. /// For a one-line header specify title and to add a second line specify caption.
/// Use left or right to add an icon. /// Use left or right to add an icon.
class GridTileBar extends StatelessComponent { class GridTileBar extends StatelessWidget {
GridTileBar({ Key key, this.backgroundColor, this.left, this.right, this.title, this.caption }) : super(key: key); GridTileBar({ Key key, this.backgroundColor, this.left, this.right, this.title, this.caption }) : super(key: key);
final Color backgroundColor; final Color backgroundColor;
......
...@@ -22,7 +22,7 @@ import 'theme.dart'; ...@@ -22,7 +22,7 @@ import 'theme.dart';
/// in your project's `flutter.yaml` file. This ensures that the /// in your project's `flutter.yaml` file. This ensures that the
/// MaterialIcons font is included in your application. This font is /// MaterialIcons font is included in your application. This font is
/// used to display the icons. /// used to display the icons.
class Icon extends StatelessComponent { class Icon extends StatelessWidget {
Icon({ Icon({
Key key, Key key,
this.icon, this.icon,
......
...@@ -20,7 +20,7 @@ import 'tooltip.dart'; ...@@ -20,7 +20,7 @@ import 'tooltip.dart';
/// ///
/// If the [onPressed] callback is not specified or null, then the button will /// If the [onPressed] callback is not specified or null, then the button will
/// be disabled, will not react to touch. /// be disabled, will not react to touch.
class IconButton extends StatelessComponent { class IconButton extends StatelessWidget {
const IconButton({ const IconButton({
Key key, Key key,
this.size: 24.0, this.size: 24.0,
......
...@@ -24,7 +24,7 @@ import 'theme.dart'; ...@@ -24,7 +24,7 @@ import 'theme.dart';
/// at the top of its [build] function to call [debugCheckHasMaterial]: /// at the top of its [build] function to call [debugCheckHasMaterial]:
/// ///
/// assert(debugCheckHasMaterial(context)); /// assert(debugCheckHasMaterial(context));
class InkResponse extends StatefulComponent { class InkResponse extends StatefulWidget {
InkResponse({ InkResponse({
Key key, Key key,
this.child, this.child,
......
...@@ -14,7 +14,7 @@ import 'theme.dart'; ...@@ -14,7 +14,7 @@ import 'theme.dart';
export 'package:sky_services/editing/editing.mojom.dart' show KeyboardType; export 'package:sky_services/editing/editing.mojom.dart' show KeyboardType;
/// A material design text input field. /// A material design text input field.
class Input extends StatefulComponent { class Input extends StatefulWidget {
Input({ Input({
Key key, Key key,
this.value: InputValue.empty, this.value: InputValue.empty,
......
...@@ -21,7 +21,7 @@ Map<MaterialListType, double> kListItemExtent = const <MaterialListType, double> ...@@ -21,7 +21,7 @@ Map<MaterialListType, double> kListItemExtent = const <MaterialListType, double>
MaterialListType.threeLine: kThreeLineListItemHeight, MaterialListType.threeLine: kThreeLineListItemHeight,
}; };
class MaterialList extends StatefulComponent { class MaterialList extends StatefulWidget {
MaterialList({ MaterialList({
Key key, Key key,
this.initialScrollOffset, this.initialScrollOffset,
......
...@@ -15,7 +15,7 @@ import 'theme.dart'; ...@@ -15,7 +15,7 @@ import 'theme.dart';
/// isThreeLine: true is specified. If dense: true is specified then the overall /// isThreeLine: true is specified. If dense: true is specified then the overall
/// height of this list item and the size of the DefaultTextStyles that wrap /// height of this list item and the size of the DefaultTextStyles that wrap
/// the [primary] and [secondary] widget are reduced. /// the [primary] and [secondary] widget are reduced.
class ListItem extends StatelessComponent { class ListItem extends StatelessWidget {
ListItem({ ListItem({
Key key, Key key,
this.left, this.left,
......
...@@ -73,7 +73,7 @@ abstract class MaterialInkController { ...@@ -73,7 +73,7 @@ abstract class MaterialInkController {
/// list on the paper, and it's been scrolled), a LayoutChangedNotification must /// list on the paper, and it's been scrolled), a LayoutChangedNotification must
/// be dispatched at the relevant subtree. (This in particular means that /// be dispatched at the relevant subtree. (This in particular means that
/// Transitions should not be placed inside Material.) /// Transitions should not be placed inside Material.)
class Material extends StatefulComponent { class Material extends StatefulWidget {
Material({ Material({
Key key, Key key,
this.child, this.child,
......
...@@ -6,7 +6,7 @@ import 'dart:async'; ...@@ -6,7 +6,7 @@ import 'dart:async';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
class _MaterialPageTransition extends AnimatedComponent { class _MaterialPageTransition extends AnimatedWidget {
_MaterialPageTransition({ _MaterialPageTransition({
Key key, Key key,
Animation<double> animation, Animation<double> animation,
......
...@@ -28,7 +28,7 @@ const double _kMenuVerticalPadding = 8.0; ...@@ -28,7 +28,7 @@ const double _kMenuVerticalPadding = 8.0;
const double _kMenuWidthStep = 56.0; const double _kMenuWidthStep = 56.0;
const double _kMenuScreenPadding = 8.0; const double _kMenuScreenPadding = 8.0;
abstract class PopupMenuEntry<T> extends StatefulComponent { abstract class PopupMenuEntry<T> extends StatefulWidget {
PopupMenuEntry({ Key key }) : super(key: key); PopupMenuEntry({ Key key }) : super(key: key);
double get height; double get height;
...@@ -159,7 +159,7 @@ class _CheckedPopupMenuItemState<T> extends _PopupMenuItemState<CheckedPopupMenu ...@@ -159,7 +159,7 @@ class _CheckedPopupMenuItemState<T> extends _PopupMenuItemState<CheckedPopupMenu
} }
} }
class _PopupMenu<T> extends StatelessComponent { class _PopupMenu<T> extends StatelessWidget {
_PopupMenu({ _PopupMenu({
Key key, Key key,
this.route this.route
...@@ -357,7 +357,7 @@ typedef void PopupMenuItemSelected<T>(T value); ...@@ -357,7 +357,7 @@ typedef void PopupMenuItemSelected<T>(T value);
/// because an item was selected. The value passed to [onSelected] is the value of /// because an item was selected. The value passed to [onSelected] is the value of
/// the selected menu item. If child is null then a standard 'navigation/more_vert' /// the selected menu item. If child is null then a standard 'navigation/more_vert'
/// icon is created. /// icon is created.
class PopupMenuButton<T> extends StatefulComponent { class PopupMenuButton<T> extends StatefulWidget {
PopupMenuButton({ PopupMenuButton({
Key key, Key key,
this.items, this.items,
......
...@@ -14,7 +14,7 @@ const double _kCircularProgressIndicatorStrokeWidth = 4.0; ...@@ -14,7 +14,7 @@ const double _kCircularProgressIndicatorStrokeWidth = 4.0;
// TODO(hansmuller): implement the support for buffer indicator // TODO(hansmuller): implement the support for buffer indicator
abstract class ProgressIndicator extends StatefulComponent { abstract class ProgressIndicator extends StatefulWidget {
ProgressIndicator({ ProgressIndicator({
Key key, Key key,
this.value this.value
......
...@@ -14,7 +14,7 @@ const double _kDiameter = 16.0; ...@@ -14,7 +14,7 @@ const double _kDiameter = 16.0;
const double _kOuterRadius = _kDiameter / 2.0; const double _kOuterRadius = _kDiameter / 2.0;
const double _kInnerRadius = 5.0; const double _kInnerRadius = 5.0;
class Radio<T> extends StatelessComponent { class Radio<T> extends StatelessWidget {
Radio({ Radio({
Key key, Key key,
this.value, this.value,
......
...@@ -107,7 +107,7 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate { ...@@ -107,7 +107,7 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate {
} }
} }
class _FloatingActionButtonTransition extends StatefulComponent { class _FloatingActionButtonTransition extends StatefulWidget {
_FloatingActionButtonTransition({ _FloatingActionButtonTransition({
Key key, Key key,
this.child this.child
...@@ -180,7 +180,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr ...@@ -180,7 +180,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr
/// This class provides APIs for showing drawers, snackbars, and bottom sheets. /// This class provides APIs for showing drawers, snackbars, and bottom sheets.
/// ///
/// See: <https://www.google.com/design/spec/layout/structure.html> /// See: <https://www.google.com/design/spec/layout/structure.html>
class Scaffold extends StatefulComponent { class Scaffold extends StatefulWidget {
Scaffold({ Scaffold({
Key key, Key key,
this.toolBar, this.toolBar,
...@@ -572,7 +572,7 @@ class ScaffoldFeatureController<T extends Widget, U> { ...@@ -572,7 +572,7 @@ class ScaffoldFeatureController<T extends Widget, U> {
final StateSetter setState; final StateSetter setState;
} }
class _PersistentBottomSheet extends StatefulComponent { class _PersistentBottomSheet extends StatefulWidget {
_PersistentBottomSheet({ _PersistentBottomSheet({
Key key, Key key,
this.animationController, this.animationController,
......
...@@ -7,7 +7,7 @@ import 'dart:ui' show Color, Offset; ...@@ -7,7 +7,7 @@ import 'dart:ui' show Color, Offset;
import 'package:flutter/painting.dart'; import 'package:flutter/painting.dart';
// Based on http://www.google.com/design/spec/what-is-material/elevation-shadows.html // Based on http://www.google.com/design/spec/what-is-material/elevation-shadows.html
// Currently, only the elevation values that are bound to one or more components are // Currently, only the elevation values that are bound to one or more widgets are
// defined here. // defined here.
/// Map of elevation offsets used by material design to [BoxShadow] definitions. /// Map of elevation offsets used by material design to [BoxShadow] definitions.
......
...@@ -11,7 +11,7 @@ import 'constants.dart'; ...@@ -11,7 +11,7 @@ import 'constants.dart';
import 'debug.dart'; import 'debug.dart';
import 'theme.dart'; import 'theme.dart';
class Slider extends StatelessComponent { class Slider extends StatelessWidget {
Slider({ Slider({
Key key, Key key,
this.value, this.value,
......
...@@ -37,7 +37,7 @@ const Curve _snackBarFadeCurve = const Interval(0.72, 1.0, curve: Curves.fastOut ...@@ -37,7 +37,7 @@ const Curve _snackBarFadeCurve = const Interval(0.72, 1.0, curve: Curves.fastOut
/// ///
/// See also: /// See also:
/// * https://www.google.com/design/spec/components/snackbars-toasts.html /// * https://www.google.com/design/spec/components/snackbars-toasts.html
class SnackBarAction extends StatelessComponent { class SnackBarAction extends StatelessWidget {
SnackBarAction({Key key, this.label, this.onPressed }) : super(key: key) { SnackBarAction({Key key, this.label, this.onPressed }) : super(key: key) {
assert(label != null); assert(label != null);
assert(onPressed != null); assert(onPressed != null);
...@@ -70,7 +70,7 @@ class SnackBarAction extends StatelessComponent { ...@@ -70,7 +70,7 @@ class SnackBarAction extends StatelessComponent {
/// * [Scaffold.of] and [ScaffoldState.showSnackBar] /// * [Scaffold.of] and [ScaffoldState.showSnackBar]
/// * [SnackBarAction] /// * [SnackBarAction]
/// * https://www.google.com/design/spec/components/snackbars-toasts.html /// * https://www.google.com/design/spec/components/snackbars-toasts.html
class SnackBar extends StatelessComponent { class SnackBar extends StatelessWidget {
SnackBar({ SnackBar({
Key key, Key key,
this.content, this.content,
......
...@@ -13,7 +13,7 @@ import 'shadows.dart'; ...@@ -13,7 +13,7 @@ import 'shadows.dart';
import 'theme.dart'; import 'theme.dart';
import 'toggleable.dart'; import 'toggleable.dart';
class Switch extends StatelessComponent { class Switch extends StatelessWidget {
Switch({ Key key, this.value, this.activeColor, this.onChanged }) Switch({ Key key, this.value, this.activeColor, this.onChanged })
: super(key: key); : super(key: key);
......
...@@ -297,7 +297,7 @@ class TabLabel { ...@@ -297,7 +297,7 @@ class TabLabel {
final TabLabelIconBuilder iconBuilder; final TabLabelIconBuilder iconBuilder;
} }
class _Tab extends StatelessComponent { class _Tab extends StatelessWidget {
_Tab({ _Tab({
Key key, Key key,
this.onSelected, this.onSelected,
...@@ -395,7 +395,7 @@ abstract class TabBarSelectionAnimationListener { ...@@ -395,7 +395,7 @@ abstract class TabBarSelectionAnimationListener {
void handleSelectionDeactivate(); void handleSelectionDeactivate();
} }
class TabBarSelection<T> extends StatefulComponent { class TabBarSelection<T> extends StatefulWidget {
TabBarSelection({ TabBarSelection({
Key key, Key key,
this.value, this.value,
...@@ -969,7 +969,7 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta ...@@ -969,7 +969,7 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta
} }
} }
class TabPageSelector<T> extends StatelessComponent { class TabPageSelector<T> extends StatelessWidget {
const TabPageSelector({ Key key }) : super(key: key); const TabPageSelector({ Key key }) : super(key: key);
Widget _buildTabIndicator(TabBarSelectionState<T> selection, T tab, Animation<double> animation, ColorTween selectedColor, ColorTween previousColor) { Widget _buildTabIndicator(TabBarSelectionState<T> selection, T tab, Animation<double> animation, ColorTween selectedColor, ColorTween previousColor) {
......
...@@ -89,7 +89,7 @@ class TimeOfDay { ...@@ -89,7 +89,7 @@ class TimeOfDay {
enum _TimePickerMode { hour, minute } enum _TimePickerMode { hour, minute }
class TimePicker extends StatefulComponent { class TimePicker extends StatefulWidget {
TimePicker({ TimePicker({
this.selectedTime, this.selectedTime,
this.onChanged this.onChanged
...@@ -141,7 +141,7 @@ class _TimePickerState extends State<TimePicker> { ...@@ -141,7 +141,7 @@ class _TimePickerState extends State<TimePicker> {
} }
// TODO(ianh): Localize! // TODO(ianh): Localize!
class _TimePickerHeader extends StatelessComponent { class _TimePickerHeader extends StatelessWidget {
_TimePickerHeader({ _TimePickerHeader({
this.selectedTime, this.selectedTime,
this.mode, this.mode,
...@@ -312,7 +312,7 @@ class _DialPainter extends CustomPainter { ...@@ -312,7 +312,7 @@ class _DialPainter extends CustomPainter {
} }
} }
class _Dial extends StatefulComponent { class _Dial extends StatefulWidget {
_Dial({ _Dial({
this.selectedTime, this.selectedTime,
this.mode, this.mode,
......
...@@ -10,7 +10,7 @@ import 'dialog.dart'; ...@@ -10,7 +10,7 @@ import 'dialog.dart';
import 'time_picker.dart'; import 'time_picker.dart';
import 'flat_button.dart'; import 'flat_button.dart';
class _TimePickerDialog extends StatefulComponent { class _TimePickerDialog extends StatefulWidget {
_TimePickerDialog({ _TimePickerDialog({
Key key, Key key,
this.initialTime this.initialTime
......
...@@ -11,7 +11,7 @@ import 'material.dart'; ...@@ -11,7 +11,7 @@ import 'material.dart';
import 'theme.dart'; import 'theme.dart';
import 'typography.dart'; import 'typography.dart';
class ToolBar extends StatelessComponent { class ToolBar extends StatelessWidget {
ToolBar({ ToolBar({
Key key, Key key,
this.left, this.left,
......
...@@ -18,7 +18,7 @@ const EdgeInsets _kDefaultTooltipScreenEdgeMargin = const EdgeInsets.all(10.0); ...@@ -18,7 +18,7 @@ const EdgeInsets _kDefaultTooltipScreenEdgeMargin = const EdgeInsets.all(10.0);
const Duration _kDefaultTooltipFadeDuration = const Duration(milliseconds: 200); const Duration _kDefaultTooltipFadeDuration = const Duration(milliseconds: 200);
const Duration _kDefaultTooltipShowDuration = const Duration(seconds: 2); const Duration _kDefaultTooltipShowDuration = const Duration(seconds: 2);
class Tooltip extends StatefulComponent { class Tooltip extends StatefulWidget {
Tooltip({ Tooltip({
Key key, Key key,
this.message, this.message,
...@@ -234,7 +234,7 @@ class _TooltipPositionDelegate extends SingleChildLayoutDelegate { ...@@ -234,7 +234,7 @@ class _TooltipPositionDelegate extends SingleChildLayoutDelegate {
} }
} }
class _TooltipOverlay extends StatelessComponent { class _TooltipOverlay extends StatelessWidget {
_TooltipOverlay({ _TooltipOverlay({
Key key, Key key,
this.message, this.message,
......
...@@ -14,7 +14,7 @@ import 'theme_data.dart'; ...@@ -14,7 +14,7 @@ import 'theme_data.dart';
const Duration _kExpand = const Duration(milliseconds: 200); const Duration _kExpand = const Duration(milliseconds: 200);
class TwoLevelListItem extends StatelessComponent { class TwoLevelListItem extends StatelessWidget {
TwoLevelListItem({ TwoLevelListItem({
Key key, Key key,
this.left, this.left,
...@@ -49,7 +49,7 @@ class TwoLevelListItem extends StatelessComponent { ...@@ -49,7 +49,7 @@ class TwoLevelListItem extends StatelessComponent {
} }
} }
class TwoLevelSublist extends StatefulComponent { class TwoLevelSublist extends StatefulWidget {
TwoLevelSublist({ Key key, this.left, this.center, this.children }) : super(key: key); TwoLevelSublist({ Key key, this.left, this.center, this.children }) : super(key: key);
final Widget left; final Widget left;
...@@ -149,7 +149,7 @@ class _TwoLevelSublistState extends State<TwoLevelSublist> { ...@@ -149,7 +149,7 @@ class _TwoLevelSublistState extends State<TwoLevelSublist> {
} }
} }
class TwoLevelList extends StatelessComponent { class TwoLevelList extends StatelessWidget {
TwoLevelList({ Key key, this.items, this.type: MaterialListType.twoLine }) : super(key: key); TwoLevelList({ Key key, this.items, this.type: MaterialListType.twoLine }) : super(key: key);
final List<Widget> items; final List<Widget> items;
......
...@@ -36,7 +36,7 @@ typedef Widget RouteBuilder(RouteArguments args); ...@@ -36,7 +36,7 @@ typedef Widget RouteBuilder(RouteArguments args);
typedef Future<LocaleQueryData> LocaleChangedCallback(Locale locale); typedef Future<LocaleQueryData> LocaleChangedCallback(Locale locale);
class WidgetsApp extends StatefulComponent { class WidgetsApp extends StatefulWidget {
WidgetsApp({ WidgetsApp({
Key key, Key key,
this.title, this.title,
......
...@@ -191,7 +191,7 @@ class _ResolutionAwareAssetResolver extends _VariantAssetResolver { ...@@ -191,7 +191,7 @@ class _ResolutionAwareAssetResolver extends _VariantAssetResolver {
/// icons/1.5x/heart.png /// icons/1.5x/heart.png
/// icons/2.0x/heart.png /// icons/2.0x/heart.png
/// ``` /// ```
class AssetVendor extends StatefulComponent { class AssetVendor extends StatefulWidget {
AssetVendor({ AssetVendor({
Key key, Key key,
this.bundle, this.bundle,
......
...@@ -888,7 +888,7 @@ class Viewport extends SingleChildRenderObjectWidget { ...@@ -888,7 +888,7 @@ class Viewport extends SingleChildRenderObjectWidget {
// CONTAINER // CONTAINER
/// A convenience widget that combines common painting, positioning, and sizing widgets. /// A convenience widget that combines common painting, positioning, and sizing widgets.
class Container extends StatelessComponent { class Container extends StatelessWidget {
Container({ Container({
Key key, Key key,
this.child, this.child,
...@@ -1090,8 +1090,8 @@ class IndexedStack extends StackRenderObjectWidgetBase { ...@@ -1090,8 +1090,8 @@ class IndexedStack extends StackRenderObjectWidgetBase {
/// Controls where a child of a [Stack] is positioned. /// Controls where a child of a [Stack] is positioned.
/// ///
/// This widget must be a descendant of a [Stack], and the path from this widget /// This widget must be a descendant of a [Stack], and the path from this widget
/// to its enclosing [Stack] must contain only components (e.g., not other /// to its enclosing [Stack] must contain only [StatelessWidget]s or
/// kinds of widgets, like [RenderObjectWidget]s). /// [StatefulWidget]s (not other kinds of widgets, like [RenderObjectWidget]s).
class Positioned extends ParentDataWidget<StackRenderObjectWidgetBase> { class Positioned extends ParentDataWidget<StackRenderObjectWidgetBase> {
Positioned({ Positioned({
Key key, Key key,
...@@ -1426,8 +1426,8 @@ class Column extends Flex { ...@@ -1426,8 +1426,8 @@ class Column extends Flex {
/// ///
/// This widget must be a descendant of a [Flex], [Row], or [Column], and the /// This widget must be a descendant of a [Flex], [Row], or [Column], and the
/// path from this widget to its enclosing [Flex], [Row], or [Column] must /// path from this widget to its enclosing [Flex], [Row], or [Column] must
/// contain only components (e.g., not other kinds of widgets, like /// contain only [StatelessWidget]s or [StatefulWidget]s (not other kinds of
/// [RenderObjectWidget]s). /// widgets, like [RenderObjectWidget]s).
class Flexible extends ParentDataWidget<Flex> { class Flexible extends ParentDataWidget<Flex> {
Flexible({ Key key, this.flex: 1, Widget child }) Flexible({ Key key, this.flex: 1, Widget child })
: super(key: key, child: child); : super(key: key, child: child);
...@@ -1507,7 +1507,7 @@ class DefaultTextStyle extends InheritedWidget { ...@@ -1507,7 +1507,7 @@ class DefaultTextStyle extends InheritedWidget {
/// ///
/// By default, the text will be styled using the closest enclosing /// By default, the text will be styled using the closest enclosing
/// [DefaultTextStyle]. /// [DefaultTextStyle].
class Text extends StatelessComponent { class Text extends StatelessWidget {
Text(this.data, { Key key, this.style }) : super(key: key) { Text(this.data, { Key key, this.style }) : super(key: key) {
assert(data != null); assert(data != null);
} }
...@@ -1666,7 +1666,7 @@ class RawImage extends LeafRenderObjectWidget { ...@@ -1666,7 +1666,7 @@ class RawImage extends LeafRenderObjectWidget {
/// This widget is rarely used directly. Instead, consider using [AssetImage] or /// This widget is rarely used directly. Instead, consider using [AssetImage] or
/// [NetworkImage], depending on whather you wish to display an image from the /// [NetworkImage], depending on whather you wish to display an image from the
/// assert bundle or from the network. /// assert bundle or from the network.
class RawImageResource extends StatefulComponent { class RawImageResource extends StatefulWidget {
RawImageResource({ RawImageResource({
Key key, Key key,
this.image, this.image,
...@@ -1785,7 +1785,7 @@ class _RawImageResourceState extends State<RawImageResource> { ...@@ -1785,7 +1785,7 @@ class _RawImageResourceState extends State<RawImageResource> {
} }
/// Displays an image loaded from the network. /// Displays an image loaded from the network.
class NetworkImage extends StatelessComponent { class NetworkImage extends StatelessWidget {
NetworkImage({ NetworkImage({
Key key, Key key,
this.src, this.src,
...@@ -1910,7 +1910,7 @@ class DefaultAssetBundle extends InheritedWidget { ...@@ -1910,7 +1910,7 @@ class DefaultAssetBundle extends InheritedWidget {
/// This widget lets you customize how images are loaded by supplying your own /// This widget lets you customize how images are loaded by supplying your own
/// image provider. Internally, [NetworkImage] uses an [ImageProvider] that /// image provider. Internally, [NetworkImage] uses an [ImageProvider] that
/// loads the image from the network. /// loads the image from the network.
class AsyncImage extends StatelessComponent { class AsyncImage extends StatelessWidget {
AsyncImage({ AsyncImage({
Key key, Key key,
this.provider, this.provider,
...@@ -2000,7 +2000,7 @@ class AsyncImage extends StatelessComponent { ...@@ -2000,7 +2000,7 @@ class AsyncImage extends StatelessComponent {
/// ///
/// By default, asset image will load the image from the closest enclosing /// By default, asset image will load the image from the closest enclosing
/// [DefaultAssetBundle]. /// [DefaultAssetBundle].
class AssetImage extends StatelessComponent { class AssetImage extends StatelessWidget {
// Don't add asserts here unless absolutely necessary, since it will // Don't add asserts here unless absolutely necessary, since it will
// require removing the const constructor, which is an API change. // require removing the const constructor, which is an API change.
const AssetImage({ const AssetImage({
...@@ -2293,7 +2293,7 @@ class Semantics extends SingleChildRenderObjectWidget { ...@@ -2293,7 +2293,7 @@ class Semantics extends SingleChildRenderObjectWidget {
/// Causes all the semantics of the subtree rooted at this node to be /// Causes all the semantics of the subtree rooted at this node to be
/// merged into one node in the semantics tree. For example, if you /// merged into one node in the semantics tree. For example, if you
/// have a component with a Text node next to a checkbox widget, this /// have a widget with a Text node next to a checkbox widget, this
/// could be used to merge the label from the Text node with the /// could be used to merge the label from the Text node with the
/// "checked" semantic state of the checkbox into a single node that /// "checked" semantic state of the checkbox into a single node that
/// had both the label and the checked state. Otherwise, the label /// had both the label and the checked state. Otherwise, the label
...@@ -2353,7 +2353,7 @@ class MetaData extends SingleChildRenderObjectWidget { ...@@ -2353,7 +2353,7 @@ class MetaData extends SingleChildRenderObjectWidget {
} }
} }
class KeyedSubtree extends StatelessComponent { class KeyedSubtree extends StatelessWidget {
KeyedSubtree({ Key key, this.child }) KeyedSubtree({ Key key, this.child })
: super(key: key); : super(key: key);
...@@ -2363,7 +2363,7 @@ class KeyedSubtree extends StatelessComponent { ...@@ -2363,7 +2363,7 @@ class KeyedSubtree extends StatelessComponent {
} }
/// A platonic widget that invokes a closure to obtain its child widget. /// A platonic widget that invokes a closure to obtain its child widget.
class Builder extends StatelessComponent { class Builder extends StatelessWidget {
Builder({ Key key, this.builder }) : super(key: key); Builder({ Key key, this.builder }) : super(key: key);
/// Called to obtain the child widget. /// Called to obtain the child widget.
...@@ -2377,7 +2377,7 @@ class Builder extends StatelessComponent { ...@@ -2377,7 +2377,7 @@ class Builder extends StatelessComponent {
} }
typedef Widget StatefulWidgetBuilder(BuildContext context, StateSetter setState); typedef Widget StatefulWidgetBuilder(BuildContext context, StateSetter setState);
class StatefulBuilder extends StatefulComponent { class StatefulBuilder extends StatefulWidget {
StatefulBuilder({ Key key, this.builder }) : super(key: key); StatefulBuilder({ Key key, this.builder }) : super(key: key);
final StatefulWidgetBuilder builder; final StatefulWidgetBuilder builder;
_StatefulBuilderState createState() => new _StatefulBuilderState(); _StatefulBuilderState createState() => new _StatefulBuilderState();
......
...@@ -50,7 +50,7 @@ class _CheckedModeBannerPainter extends CustomPainter { ...@@ -50,7 +50,7 @@ class _CheckedModeBannerPainter extends CustomPainter {
/// Displays a banner saying "CHECKED" when running in checked mode. /// Displays a banner saying "CHECKED" when running in checked mode.
/// Does nothing in release mode. /// Does nothing in release mode.
class CheckedModeBanner extends StatelessComponent { class CheckedModeBanner extends StatelessWidget {
CheckedModeBanner({ CheckedModeBanner({
Key key, Key key,
this.child this.child
......
...@@ -9,7 +9,7 @@ import 'framework.dart'; ...@@ -9,7 +9,7 @@ import 'framework.dart';
export 'package:flutter/rendering.dart' show ChildViewConnection; export 'package:flutter/rendering.dart' show ChildViewConnection;
class ChildView extends StatelessComponent { class ChildView extends StatelessWidget {
ChildView({ Key key, this.child }) : super(key: key); ChildView({ Key key, this.child }) : super(key: key);
final ChildViewConnection child; final ChildViewConnection child;
......
...@@ -52,7 +52,7 @@ enum DismissDirection { ...@@ -52,7 +52,7 @@ enum DismissDirection {
/// The [onDimissed] callback runs after Dismissable's size has collapsed to zero. /// The [onDimissed] callback runs after Dismissable's size has collapsed to zero.
/// If the Dismissable is a list item, it must have a key that distinguishes it from /// If the Dismissable is a list item, it must have a key that distinguishes it from
/// the other items and its onDismissed callback must remove the item from the list. /// the other items and its onDismissed callback must remove the item from the list.
class Dismissable extends StatefulComponent { class Dismissable extends StatefulWidget {
Dismissable({ Dismissable({
Key key, Key key,
this.child, this.child,
......
...@@ -35,8 +35,8 @@ enum DragAnchor { ...@@ -35,8 +35,8 @@ enum DragAnchor {
pointer, pointer,
} }
/// Subclass this component to customize the gesture used to start a drag. /// Subclass this widget to customize the gesture used to start a drag.
abstract class DraggableBase<T> extends StatefulComponent { abstract class DraggableBase<T> extends StatefulWidget {
DraggableBase({ DraggableBase({
Key key, Key key,
this.data, this.data,
...@@ -261,7 +261,7 @@ class _DraggableState<T> extends State<DraggableBase<T>> { ...@@ -261,7 +261,7 @@ class _DraggableState<T> extends State<DraggableBase<T>> {
} }
/// Receives data when a [Draggable] widget is dropped. /// Receives data when a [Draggable] widget is dropped.
class DragTarget<T> extends StatefulComponent { class DragTarget<T> extends StatefulWidget {
const DragTarget({ const DragTarget({
Key key, Key key,
this.builder, this.builder,
......
...@@ -10,7 +10,7 @@ import 'media_query.dart'; ...@@ -10,7 +10,7 @@ import 'media_query.dart';
import 'scrollable.dart'; import 'scrollable.dart';
// _noFocusedScope is used by Focus to track the case where none of the Focus // _noFocusedScope is used by Focus to track the case where none of the Focus
// component's subscopes (e.g. dialogs) are focused. This is distinct from the // widget's subscopes (e.g. dialogs) are focused. This is distinct from the
// focused scope being null, which means that we haven't yet decided which scope // focused scope being null, which means that we haven't yet decided which scope
// is focused and whichever is the first scope to ask for focus will get it. // is focused and whichever is the first scope to ask for focus will get it.
final GlobalKey _noFocusedScope = new GlobalKey(); final GlobalKey _noFocusedScope = new GlobalKey();
...@@ -91,7 +91,7 @@ class _FocusScope extends InheritedWidget { ...@@ -91,7 +91,7 @@ class _FocusScope extends InheritedWidget {
/// focused at each level and it hasn't focused any of its enclosed Focus /// focused at each level and it hasn't focused any of its enclosed Focus
/// widgets), then the widget this this global key actually has the focus in the /// widgets), then the widget this this global key actually has the focus in the
/// entire system. /// entire system.
class Focus extends StatefulComponent { class Focus extends StatefulWidget {
Focus({ Focus({
GlobalKey key, GlobalKey key,
this.child this.child
...@@ -205,7 +205,7 @@ class _FocusState extends State<Focus> { ...@@ -205,7 +205,7 @@ class _FocusState extends State<Focus> {
super.dispose(); super.dispose();
} }
GlobalKey _focusedWidget; // when null, the first component to ask if it's focused will get the focus GlobalKey _focusedWidget; // when null, the first widget to ask if it's focused will get the focus
GlobalKey _currentlyRegisteredWidgetRemovalListenerKey; GlobalKey _currentlyRegisteredWidgetRemovalListenerKey;
void _setFocusedWidget(GlobalKey key) { void _setFocusedWidget(GlobalKey key) {
......
...@@ -69,9 +69,9 @@ class ObjectKey extends Key { ...@@ -69,9 +69,9 @@ class ObjectKey extends Key {
typedef void GlobalKeyRemoveListener(GlobalKey key); typedef void GlobalKeyRemoveListener(GlobalKey key);
/// A GlobalKey is one that must be unique across the entire application. It is /// A GlobalKey is one that must be unique across the entire application. It is
/// used by components that need to communicate with other components across the /// used by widgets that need to communicate with other widgets across the
/// application's element tree. /// application's element tree.
abstract class GlobalKey<T extends State<StatefulComponent>> extends Key { abstract class GlobalKey<T extends State<StatefulWidget>> extends Key {
/// Constructs a LabeledGlobalKey, which is a GlobalKey with a label used for debugging. /// Constructs a LabeledGlobalKey, which is a GlobalKey with a label used for debugging.
/// The label is not used for comparing the identity of the key. /// The label is not used for comparing the identity of the key.
factory GlobalKey({ String debugLabel }) => new LabeledGlobalKey<T>(debugLabel); // the label is purely for debugging purposes and is otherwise ignored factory GlobalKey({ String debugLabel }) => new LabeledGlobalKey<T>(debugLabel); // the label is purely for debugging purposes and is otherwise ignored
...@@ -119,8 +119,8 @@ abstract class GlobalKey<T extends State<StatefulComponent>> extends Key { ...@@ -119,8 +119,8 @@ abstract class GlobalKey<T extends State<StatefulComponent>> extends Key {
Widget get currentWidget => _currentElement?.widget; Widget get currentWidget => _currentElement?.widget;
T get currentState { T get currentState {
Element element = _currentElement; Element element = _currentElement;
if (element is StatefulComponentElement) { if (element is StatefulElement) {
StatefulComponentElement statefulElement = element; StatefulElement statefulElement = element;
return statefulElement.state; return statefulElement.state;
} }
return null; return null;
...@@ -179,7 +179,7 @@ abstract class GlobalKey<T extends State<StatefulComponent>> extends Key { ...@@ -179,7 +179,7 @@ abstract class GlobalKey<T extends State<StatefulComponent>> extends Key {
/// Each LabeledGlobalKey instance is a unique key. /// Each LabeledGlobalKey instance is a unique key.
/// The optional label can be used for documentary purposes. It does not affect /// The optional label can be used for documentary purposes. It does not affect
/// the key's identity. /// the key's identity.
class LabeledGlobalKey<T extends State<StatefulComponent>> extends GlobalKey<T> { class LabeledGlobalKey<T extends State<StatefulWidget>> extends GlobalKey<T> {
const LabeledGlobalKey(this._debugLabel) : super.constructor(); const LabeledGlobalKey(this._debugLabel) : super.constructor();
final String _debugLabel; final String _debugLabel;
String toString() => '[GlobalKey ${_debugLabel != null ? _debugLabel : hashCode}]'; String toString() => '[GlobalKey ${_debugLabel != null ? _debugLabel : hashCode}]';
...@@ -241,42 +241,42 @@ abstract class Widget { ...@@ -241,42 +241,42 @@ abstract class Widget {
} }
} }
/// StatelessComponents describe a way to compose other Widgets to form reusable /// StatelessWidgets describe a way to compose other Widgets to form reusable
/// parts, which doesn't depend on anything other than the configuration /// parts, which doesn't depend on anything other than the configuration
/// information in the object itself. (For compositions that can change /// information in the object itself. (For compositions that can change
/// dynamically, e.g. due to having an internal clock-driven state, or depending /// dynamically, e.g. due to having an internal clock-driven state, or depending
/// on some system state, use [StatefulComponent].) /// on some system state, use [StatefulWidget].)
abstract class StatelessComponent extends Widget { abstract class StatelessWidget extends Widget {
const StatelessComponent({ Key key }) : super(key: key); const StatelessWidget({ Key key }) : super(key: key);
/// StatelessComponents always use StatelessComponentElements to represent /// StatelessWidget always use [StatelessElement]s to represent
/// themselves in the Element tree. /// themselves in the Element tree.
StatelessComponentElement createElement() => new StatelessComponentElement(this); StatelessElement createElement() => new StatelessElement(this);
/// Returns another Widget out of which this StatelessComponent is built. /// Returns another Widget out of which this StatelessWidget is built.
/// Typically that Widget will have been configured with further children, /// Typically that Widget will have been configured with further children,
/// such that really this function returns a tree of configuration. /// such that really this function returns a tree of configuration.
/// ///
/// The given build context object contains information about the location in /// The given build context object contains information about the location in
/// the tree at which this component is being built. For example, the context /// the tree at which this widget is being built. For example, the context
/// provides the set of inherited widgets for this location in the tree. /// provides the set of inherited widgets for this location in the tree.
Widget build(BuildContext context); Widget build(BuildContext context);
} }
/// StatefulComponents provide the configuration for /// StatefulWidgets provide the configuration for
/// [StatefulComponentElement]s, which wrap [State]s, which hold mutable state /// [StatefulElement]s, which wrap [State]s, which hold mutable state
/// and can dynamically and spontaneously ask to be rebuilt. /// and can dynamically and spontaneously ask to be rebuilt.
abstract class StatefulComponent extends Widget { abstract class StatefulWidget extends Widget {
const StatefulComponent({ Key key }) : super(key: key); const StatefulWidget({ Key key }) : super(key: key);
/// StatefulComponents always use StatefulComponentElements to represent /// StatefulWidget always use [StatefulElement]s to represent
/// themselves in the Element tree. /// themselves in the Element tree.
StatefulComponentElement createElement() => new StatefulComponentElement(this); StatefulElement createElement() => new StatefulElement(this);
/// Returns an instance of the state to which this StatefulComponent is /// Returns an instance of the state to which this StatefulWidget is
/// related, using this object as the configuration. Subclasses should /// related, using this object as the configuration. Subclasses should
/// override this to return a new instance of the State class associated with /// override this to return a new instance of the State class associated with
/// this StatefulComponent class, like this: /// this StatefulWidget class, like this:
/// ///
/// _MyState createState() => new _MyState(); /// _MyState createState() => new _MyState();
State createState(); State createState();
...@@ -292,10 +292,10 @@ enum _StateLifecycle { ...@@ -292,10 +292,10 @@ enum _StateLifecycle {
/// The signature of setState() methods. /// The signature of setState() methods.
typedef void StateSetter(VoidCallback fn); typedef void StateSetter(VoidCallback fn);
/// The logic and internal state for a [StatefulComponent]. /// The logic and internal state for a [StatefulWidget].
abstract class State<T extends StatefulComponent> { abstract class State<T extends StatefulWidget> {
/// The current configuration (an instance of the corresponding /// The current configuration (an instance of the corresponding
/// StatefulComponent class). /// [StatefulWidget] class).
T get config => _config; T get config => _config;
T _config; T _config;
...@@ -307,7 +307,7 @@ abstract class State<T extends StatefulComponent> { ...@@ -307,7 +307,7 @@ abstract class State<T extends StatefulComponent> {
bool _debugTypesAreRight(Widget widget) => widget is T; bool _debugTypesAreRight(Widget widget) => widget is T;
/// Pointer to the owner Element object /// Pointer to the owner Element object
StatefulComponentElement _element; StatefulElement _element;
/// The context in which this object will be built /// The context in which this object will be built
BuildContext get context => _element; BuildContext get context => _element;
...@@ -335,7 +335,7 @@ abstract class State<T extends StatefulComponent> { ...@@ -335,7 +335,7 @@ abstract class State<T extends StatefulComponent> {
/// setState(() { myState = newValue }); /// setState(() { myState = newValue });
/// ///
/// If you just change the state directly without calling setState(), then the /// If you just change the state directly without calling setState(), then the
/// component will not be scheduled for rebuilding, meaning that its rendering /// widget will not be scheduled for rebuilding, meaning that its rendering
/// will not be updated. /// will not be updated.
void setState(VoidCallback fn) { void setState(VoidCallback fn) {
assert(() { assert(() {
...@@ -376,12 +376,12 @@ abstract class State<T extends StatefulComponent> { ...@@ -376,12 +376,12 @@ abstract class State<T extends StatefulComponent> {
assert(() { _debugLifecycleState = _StateLifecycle.defunct; return true; }); assert(() { _debugLifecycleState = _StateLifecycle.defunct; return true; });
} }
/// Returns another Widget out of which this StatefulComponent is built. /// Returns another Widget out of which this [StatefulWidget] is built.
/// Typically that Widget will have been configured with further children, /// Typically that Widget will have been configured with further children,
/// such that really this function returns a tree of configuration. /// such that really this function returns a tree of configuration.
/// ///
/// The given build context object contains information about the location in /// The given build context object contains information about the location in
/// the tree at which this component is being built. For example, the context /// the tree at which this widget is being built. For example, the context
/// provides the set of inherited widgets for this location in the tree. /// provides the set of inherited widgets for this location in the tree.
Widget build(BuildContext context); Widget build(BuildContext context);
...@@ -410,13 +410,13 @@ abstract class State<T extends StatefulComponent> { ...@@ -410,13 +410,13 @@ abstract class State<T extends StatefulComponent> {
} }
} }
abstract class _ProxyComponent extends Widget { abstract class _ProxyWidget extends Widget {
const _ProxyComponent({ Key key, this.child }) : super(key: key); const _ProxyWidget({ Key key, this.child }) : super(key: key);
final Widget child; final Widget child;
} }
abstract class ParentDataWidget<T extends RenderObjectWidget> extends _ProxyComponent { abstract class ParentDataWidget<T extends RenderObjectWidget> extends _ProxyWidget {
const ParentDataWidget({ Key key, Widget child }) const ParentDataWidget({ Key key, Widget child })
: super(key: key, child: child); : super(key: key, child: child);
...@@ -464,7 +464,7 @@ abstract class ParentDataWidget<T extends RenderObjectWidget> extends _ProxyComp ...@@ -464,7 +464,7 @@ abstract class ParentDataWidget<T extends RenderObjectWidget> extends _ProxyComp
void applyParentData(RenderObject renderObject); void applyParentData(RenderObject renderObject);
} }
abstract class InheritedWidget extends _ProxyComponent { abstract class InheritedWidget extends _ProxyWidget {
const InheritedWidget({ Key key, Widget child }) const InheritedWidget({ Key key, Widget child })
: super(key: key, child: child); : super(key: key, child: child);
...@@ -938,11 +938,11 @@ abstract class Element implements BuildContext { ...@@ -938,11 +938,11 @@ abstract class Element implements BuildContext {
State ancestorStateOfType(TypeMatcher matcher) { State ancestorStateOfType(TypeMatcher matcher) {
Element ancestor = _parent; Element ancestor = _parent;
while (ancestor != null) { while (ancestor != null) {
if (ancestor is StatefulComponentElement && matcher.check(ancestor.state)) if (ancestor is StatefulElement && matcher.check(ancestor.state))
break; break;
ancestor = ancestor._parent; ancestor = ancestor._parent;
} }
StatefulComponentElement statefulAncestor = ancestor; StatefulElement statefulAncestor = ancestor;
return statefulAncestor?.state; return statefulAncestor?.state;
} }
...@@ -1047,7 +1047,7 @@ abstract class BuildableElement extends Element { ...@@ -1047,7 +1047,7 @@ abstract class BuildableElement extends Element {
bool get dirty => _dirty; bool get dirty => _dirty;
bool _dirty = true; bool _dirty = true;
// We let component authors call setState from initState, didUpdateConfig, and // We let widget authors call setState from initState, didUpdateConfig, and
// build even when state is locked because its convenient and a no-op anyway. // build even when state is locked because its convenient and a no-op anyway.
// This flag ensures that this convenience is only allowed on the element // This flag ensures that this convenience is only allowed on the element
// currently undergoing initState, didUpdateConfig, or build. // currently undergoing initState, didUpdateConfig, or build.
...@@ -1065,9 +1065,9 @@ abstract class BuildableElement extends Element { ...@@ -1065,9 +1065,9 @@ abstract class BuildableElement extends Element {
static bool _debugBuilding = false; static bool _debugBuilding = false;
static BuildableElement _debugCurrentBuildTarget; static BuildableElement _debugCurrentBuildTarget;
/// Establishes a scope in which component build functions can run. /// Establishes a scope in which widget build functions can run.
/// ///
/// Inside a build scope, component build functions are allowed to run, but /// Inside a build scope, widget build functions are allowed to run, but
/// State.setState() is forbidden. This mechanism prevents build functions /// State.setState() is forbidden. This mechanism prevents build functions
/// from transitively requiring other build functions to run, potentially /// from transitively requiring other build functions to run, potentially
/// causing infinite loops. /// causing infinite loops.
...@@ -1106,8 +1106,8 @@ abstract class BuildableElement extends Element { ...@@ -1106,8 +1106,8 @@ abstract class BuildableElement extends Element {
/// rebuild in the next frame. /// rebuild in the next frame.
/// ///
/// Since it is inefficient to build an element twice in one frame, /// Since it is inefficient to build an element twice in one frame,
/// applications and components should be structured so as to only mark /// applications and widgets should be structured so as to only mark
/// components dirty during event handlers before the frame begins, not during /// widgets dirty during event handlers before the frame begins, not during
/// the build itself. /// the build itself.
void markNeedsBuild() { void markNeedsBuild() {
assert(_debugLifecycleState != _ElementLifecycle.defunct); assert(_debugLifecycleState != _ElementLifecycle.defunct);
...@@ -1130,7 +1130,7 @@ abstract class BuildableElement extends Element { ...@@ -1130,7 +1130,7 @@ abstract class BuildableElement extends Element {
if (_debugStateLocked && (!_debugAllowIgnoredCallsToMarkNeedsBuild || !dirty)) { if (_debugStateLocked && (!_debugAllowIgnoredCallsToMarkNeedsBuild || !dirty)) {
throw new WidgetError( throw new WidgetError(
'setState() or markNeedsBuild() called during build.\n' 'setState() or markNeedsBuild() called during build.\n'
'This component cannot be marked as needing to build because the framework ' 'This widget cannot be marked as needing to build because the framework '
'is already in the process of building widgets. A widget can be marked as ' 'is already in the process of building widgets. A widget can be marked as '
'needing to be built during the build phase only if one if its ancestors ' 'needing to be built during the build phase only if one if its ancestors '
'is currently building. This exception is allowed because the framework ' 'is currently building. This exception is allowed because the framework '
...@@ -1149,7 +1149,7 @@ abstract class BuildableElement extends Element { ...@@ -1149,7 +1149,7 @@ abstract class BuildableElement extends Element {
} }
/// Called by the binding when scheduleBuild() has been called to mark this /// Called by the binding when scheduleBuild() has been called to mark this
/// element dirty, and, in Components, by update() when the Widget has /// element dirty, and, in components, by update() when the widget has
/// changed. /// changed.
void rebuild() { void rebuild() {
assert(_debugLifecycleState != _ElementLifecycle.initial); assert(_debugLifecycleState != _ElementLifecycle.initial);
...@@ -1195,8 +1195,8 @@ abstract class BuildableElement extends Element { ...@@ -1195,8 +1195,8 @@ abstract class BuildableElement extends Element {
typedef Widget WidgetBuilder(BuildContext context); typedef Widget WidgetBuilder(BuildContext context);
/// Base class for the instantiation of StatelessComponent, StatefulComponent, /// Base class for the instantiation of [StatelessWidget], [StatefulWidget],
/// and ProxyComponent widgets. /// and [_ProxyWidget] widgets.
abstract class ComponentElement extends BuildableElement { abstract class ComponentElement extends BuildableElement {
ComponentElement(Widget widget) : super(widget); ComponentElement(Widget widget) : super(widget);
...@@ -1215,8 +1215,8 @@ abstract class ComponentElement extends BuildableElement { ...@@ -1215,8 +1215,8 @@ abstract class ComponentElement extends BuildableElement {
rebuild(); rebuild();
} }
/// Reinvokes the build() method of the StatelessComponent object (for /// Reinvokes the build() method of the [StatelessWidget] object (for
/// stateless components) or the State object (for stateful components) and /// stateless widgets) or the [State] object (for stateful widgets) and
/// then updates the widget tree. /// then updates the widget tree.
/// ///
/// Called automatically during mount() to generate the first build, and by /// Called automatically during mount() to generate the first build, and by
...@@ -1270,15 +1270,15 @@ abstract class ComponentElement extends BuildableElement { ...@@ -1270,15 +1270,15 @@ abstract class ComponentElement extends BuildableElement {
} }
} }
/// Instantiation of StatelessComponent widgets. /// Instantiation of [StatelessWidget]s.
class StatelessComponentElement extends ComponentElement { class StatelessElement extends ComponentElement {
StatelessComponentElement(StatelessComponent widget) : super(widget) { StatelessElement(StatelessWidget widget) : super(widget) {
_builder = widget.build; _builder = widget.build;
} }
StatelessComponent get widget => super.widget; StatelessWidget get widget => super.widget;
void update(StatelessComponent newWidget) { void update(StatelessWidget newWidget) {
super.update(newWidget); super.update(newWidget);
assert(widget == newWidget); assert(widget == newWidget);
_builder = widget.build; _builder = widget.build;
...@@ -1287,9 +1287,9 @@ class StatelessComponentElement extends ComponentElement { ...@@ -1287,9 +1287,9 @@ class StatelessComponentElement extends ComponentElement {
} }
} }
/// Instantiation of StatefulComponent widgets. /// Instantiation of [StatefulWidget]s.
class StatefulComponentElement extends ComponentElement { class StatefulElement extends ComponentElement {
StatefulComponentElement(StatefulComponent widget) StatefulElement(StatefulWidget widget)
: _state = widget.createState(), super(widget) { : _state = widget.createState(), super(widget) {
assert(_state._debugTypesAreRight(widget)); assert(_state._debugTypesAreRight(widget));
assert(_state._element == null); assert(_state._element == null);
...@@ -1301,8 +1301,8 @@ class StatefulComponentElement extends ComponentElement { ...@@ -1301,8 +1301,8 @@ class StatefulComponentElement extends ComponentElement {
assert(_state._debugLifecycleState == _StateLifecycle.created); assert(_state._debugLifecycleState == _StateLifecycle.created);
} }
State<StatefulComponent> get state => _state; State<StatefulWidget> get state => _state;
State<StatefulComponent> _state; State<StatefulWidget> _state;
void _firstBuild() { void _firstBuild() {
assert(_state._debugLifecycleState == _StateLifecycle.created); assert(_state._debugLifecycleState == _StateLifecycle.created);
...@@ -1325,10 +1325,10 @@ class StatefulComponentElement extends ComponentElement { ...@@ -1325,10 +1325,10 @@ class StatefulComponentElement extends ComponentElement {
super._firstBuild(); super._firstBuild();
} }
void update(StatefulComponent newWidget) { void update(StatefulWidget newWidget) {
super.update(newWidget); super.update(newWidget);
assert(widget == newWidget); assert(widget == newWidget);
StatefulComponent oldConfig = _state._config; StatefulWidget oldConfig = _state._config;
// Notice that we mark ourselves as dirty before calling didUpdateConfig to // Notice that we mark ourselves as dirty before calling didUpdateConfig to
// let authors call setState from within didUpdateConfig without triggering // let authors call setState from within didUpdateConfig without triggering
// asserts. // asserts.
...@@ -1378,16 +1378,16 @@ class StatefulComponentElement extends ComponentElement { ...@@ -1378,16 +1378,16 @@ class StatefulComponentElement extends ComponentElement {
} }
abstract class _ProxyElement extends ComponentElement { abstract class _ProxyElement extends ComponentElement {
_ProxyElement(_ProxyComponent widget) : super(widget) { _ProxyElement(_ProxyWidget widget) : super(widget) {
_builder = _build; _builder = _build;
} }
_ProxyComponent get widget => super.widget; _ProxyWidget get widget => super.widget;
Widget _build(BuildContext context) => widget.child; Widget _build(BuildContext context) => widget.child;
void update(_ProxyComponent newWidget) { void update(_ProxyWidget newWidget) {
_ProxyComponent oldWidget = widget; _ProxyWidget oldWidget = widget;
assert(widget != null); assert(widget != null);
assert(widget != newWidget); assert(widget != newWidget);
super.update(newWidget); super.update(newWidget);
...@@ -1397,7 +1397,7 @@ abstract class _ProxyElement extends ComponentElement { ...@@ -1397,7 +1397,7 @@ abstract class _ProxyElement extends ComponentElement {
rebuild(); rebuild();
} }
void notifyDescendants(_ProxyComponent oldWidget); void notifyDescendants(_ProxyWidget oldWidget);
} }
class ParentDataElement<T extends RenderObjectWidget> extends _ProxyElement { class ParentDataElement<T extends RenderObjectWidget> extends _ProxyElement {
......
...@@ -39,7 +39,7 @@ typedef GestureRecognizer GestureRecognizerFactory(GestureRecognizer recognizer) ...@@ -39,7 +39,7 @@ typedef GestureRecognizer GestureRecognizerFactory(GestureRecognizer recognizer)
/// [excludeFromSemantics] to true. /// [excludeFromSemantics] to true.
/// ///
/// See http://flutter.io/gestures/ for additional information. /// See http://flutter.io/gestures/ for additional information.
class GestureDetector extends StatelessComponent { class GestureDetector extends StatelessWidget {
GestureDetector({ GestureDetector({
Key key, Key key,
this.child, this.child,
...@@ -235,7 +235,7 @@ class GestureDetector extends StatelessComponent { ...@@ -235,7 +235,7 @@ class GestureDetector extends StatelessComponent {
/// For common gestures, use a [GestureRecognizer]. /// For common gestures, use a [GestureRecognizer].
/// RawGestureDetector is useful primarily when developing your /// RawGestureDetector is useful primarily when developing your
/// own gesture recognizers. /// own gesture recognizers.
class RawGestureDetector extends StatefulComponent { class RawGestureDetector extends StatefulWidget {
RawGestureDetector({ RawGestureDetector({
Key key, Key key,
this.child, this.child,
......
...@@ -46,7 +46,7 @@ class _GridPaperPainter extends CustomPainter { ...@@ -46,7 +46,7 @@ class _GridPaperPainter extends CustomPainter {
/// Draws a rectalinear grid of 1px width lines at the specified color and interval. /// Draws a rectalinear grid of 1px width lines at the specified color and interval.
/// Useful with a Stack for visualizing your layout along a grid. /// Useful with a Stack for visualizing your layout along a grid.
class GridPaper extends StatelessComponent { class GridPaper extends StatelessWidget {
GridPaper({ GridPaper({
Key key, Key key,
this.color: const Color(0x7FC3E8F3), this.color: const Color(0x7FC3E8F3),
......
...@@ -14,7 +14,7 @@ import 'pages.dart'; ...@@ -14,7 +14,7 @@ import 'pages.dart';
import 'transitions.dart'; import 'transitions.dart';
// Heroes are the parts of an application's screen-to-screen transitions where a // Heroes are the parts of an application's screen-to-screen transitions where a
// component from one screen shifts to a position on the other. For example, // widget from one screen shifts to a position on the other. For example,
// album art from a list of albums growing to become the centerpiece of the // album art from a list of albums growing to become the centerpiece of the
// album's details view. In this context, a screen is a navigator ModalRoute. // album's details view. In this context, a screen is a navigator ModalRoute.
...@@ -76,7 +76,7 @@ abstract class HeroHandle { ...@@ -76,7 +76,7 @@ abstract class HeroHandle {
_HeroManifest _takeChild(Rect animationArea, Animation<double> currentAnimation); _HeroManifest _takeChild(Rect animationArea, Animation<double> currentAnimation);
} }
class Hero extends StatefulComponent { class Hero extends StatefulWidget {
Hero({ Hero({
Key key, Key key,
this.tag, this.tag,
...@@ -104,7 +104,7 @@ class Hero extends StatefulComponent { ...@@ -104,7 +104,7 @@ class Hero extends StatefulComponent {
Map<Object, Map<Key, HeroState>> heroes = <Object, Map<Key, HeroState>>{}; Map<Object, Map<Key, HeroState>> heroes = <Object, Map<Key, HeroState>>{};
void visitor(Element element) { void visitor(Element element) {
if (element.widget is Hero) { if (element.widget is Hero) {
StatefulComponentElement hero = element; StatefulElement hero = element;
Hero heroWidget = element.widget; Hero heroWidget = element.widget;
Object tag = heroWidget.tag; Object tag = heroWidget.tag;
assert(tag != null); assert(tag != null);
......
...@@ -50,9 +50,9 @@ class Matrix4Tween extends Tween<Matrix4> { ...@@ -50,9 +50,9 @@ class Matrix4Tween extends Tween<Matrix4> {
} }
} }
/// An abstract widget for building components that gradually change their /// An abstract widget for building widgets that gradually change their
/// values over a period of time. /// values over a period of time.
abstract class AnimatedWidgetBase extends StatefulComponent { abstract class AnimatedWidgetBase extends StatefulWidget {
AnimatedWidgetBase({ AnimatedWidgetBase({
Key key, Key key,
this.curve: Curves.linear, this.curve: Curves.linear,
......
...@@ -123,7 +123,7 @@ class MimicOverlayEntry { ...@@ -123,7 +123,7 @@ class MimicOverlayEntry {
} }
/// A widget that copies the appearance of another widget. /// A widget that copies the appearance of another widget.
class Mimic extends StatelessComponent { class Mimic extends StatelessWidget {
Mimic({ Key key, this.original }) : super(key: key); Mimic({ Key key, this.original }) : super(key: key);
/// A handle to the widget that this widget should copy. /// A handle to the widget that this widget should copy.
...@@ -140,7 +140,7 @@ class Mimic extends StatelessComponent { ...@@ -140,7 +140,7 @@ class Mimic extends StatelessComponent {
/// ///
/// This widget's State, [MimicableState], contains an API for initiating the /// This widget's State, [MimicableState], contains an API for initiating the
/// mimic operation. /// mimic operation.
class Mimicable extends StatefulComponent { class Mimicable extends StatefulWidget {
Mimicable({ Key key, this.child }) : super(key: key); Mimicable({ Key key, this.child }) : super(key: key);
final Widget child; final Widget child;
......
...@@ -190,8 +190,8 @@ class _MixedViewportElement extends RenderObjectElement { ...@@ -190,8 +190,8 @@ class _MixedViewportElement extends RenderObjectElement {
renderObject.markNeedsLayout(); renderObject.markNeedsLayout();
} else { } else {
// We have to reinvoke our builders because they might return new data. // We have to reinvoke our builders because they might return new data.
// Consider a stateful component that owns us. The builder it gives us // Consider a stateful widget that owns us. The builder it gives us
// includes some of the state from that component. The component calls // includes some of the state from that widget. The widget calls
// setState() on itself. It rebuilds. Part of that involves rebuilding // setState() on itself. It rebuilds. Part of that involves rebuilding
// us, but now what? If we don't reinvoke the builders. then they will // us, but now what? If we don't reinvoke the builders. then they will
// not be rebuilt, and so the new state won't be used. Therefore, we use // not be rebuilt, and so the new state won't be used. Therefore, we use
......
...@@ -9,7 +9,7 @@ import 'navigator.dart'; ...@@ -9,7 +9,7 @@ import 'navigator.dart';
import 'transitions.dart'; import 'transitions.dart';
/// Prevents the user from interacting with widgets behind itself. /// Prevents the user from interacting with widgets behind itself.
class ModalBarrier extends StatelessComponent { class ModalBarrier extends StatelessWidget {
ModalBarrier({ ModalBarrier({
Key key, Key key,
this.color, this.color,
...@@ -45,7 +45,7 @@ class ModalBarrier extends StatelessComponent { ...@@ -45,7 +45,7 @@ class ModalBarrier extends StatelessComponent {
} }
/// Prevents the user from interacting with widgets behind itself. /// Prevents the user from interacting with widgets behind itself.
class AnimatedModalBarrier extends AnimatedComponent { class AnimatedModalBarrier extends AnimatedWidget {
AnimatedModalBarrier({ AnimatedModalBarrier({
Key key, Key key,
Animation<Color> color, Animation<Color> color,
......
...@@ -135,7 +135,7 @@ class NavigatorObserver { ...@@ -135,7 +135,7 @@ class NavigatorObserver {
/// the navigator visually transition from one page to another by the widgets /// the navigator visually transition from one page to another by the widgets
/// around in the overlay. Similarly, the navigator can be used to show a dialog /// around in the overlay. Similarly, the navigator can be used to show a dialog
/// by positioning the dialog widget above the current page. /// by positioning the dialog widget above the current page.
class Navigator extends StatefulComponent { class Navigator extends StatefulWidget {
Navigator({ Navigator({
Key key, Key key,
this.initialRoute, this.initialRoute,
......
...@@ -12,7 +12,7 @@ abstract class Notification { ...@@ -12,7 +12,7 @@ abstract class Notification {
/// Start bubbling this notification at the given build context. /// Start bubbling this notification at the given build context.
void dispatch(BuildContext target) { void dispatch(BuildContext target) {
target.visitAncestorElements((Element element) { target.visitAncestorElements((Element element) {
if (element is StatelessComponentElement && if (element is StatelessElement &&
element.widget is NotificationListener<dynamic>) { element.widget is NotificationListener<dynamic>) {
final NotificationListener<dynamic> widget = element.widget; final NotificationListener<dynamic> widget = element.widget;
if (widget._dispatch(this)) // that function checks the type dynamically if (widget._dispatch(this)) // that function checks the type dynamically
...@@ -24,7 +24,7 @@ abstract class Notification { ...@@ -24,7 +24,7 @@ abstract class Notification {
} }
/// Listens for [Notification]s bubbling up the tree. /// Listens for [Notification]s bubbling up the tree.
class NotificationListener<T extends Notification> extends StatelessComponent { class NotificationListener<T extends Notification> extends StatelessWidget {
NotificationListener({ NotificationListener({
Key key, Key key,
this.child, this.child,
......
...@@ -49,7 +49,7 @@ class OverlayEntry { ...@@ -49,7 +49,7 @@ class OverlayEntry {
String toString() => '$runtimeType@$hashCode(opaque: $opaque)'; String toString() => '$runtimeType@$hashCode(opaque: $opaque)';
} }
class _OverlayEntry extends StatefulComponent { class _OverlayEntry extends StatefulWidget {
_OverlayEntry(OverlayEntry entry) : entry = entry, super(key: entry._key); _OverlayEntry(OverlayEntry entry) : entry = entry, super(key: entry._key);
final OverlayEntry entry; final OverlayEntry entry;
_OverlayEntryState createState() => new _OverlayEntryState(); _OverlayEntryState createState() => new _OverlayEntryState();
...@@ -59,7 +59,7 @@ class _OverlayEntryState extends State<_OverlayEntry> { ...@@ -59,7 +59,7 @@ class _OverlayEntryState extends State<_OverlayEntry> {
} }
/// A [Stack] of entries that can be managed independently. /// A [Stack] of entries that can be managed independently.
class Overlay extends StatefulComponent { class Overlay extends StatefulWidget {
Overlay({ Overlay({
Key key, Key key,
this.initialEntries: const <OverlayEntry>[] this.initialEntries: const <OverlayEntry>[]
......
...@@ -82,7 +82,7 @@ class PageStorageBucket { ...@@ -82,7 +82,7 @@ class PageStorageBucket {
} }
/// Establishes a page storage bucket for this widget subtree. /// Establishes a page storage bucket for this widget subtree.
class PageStorage extends StatelessComponent { class PageStorage extends StatelessWidget {
PageStorage({ PageStorage({
Key key, Key key,
this.child, this.child,
......
...@@ -6,7 +6,7 @@ import 'basic.dart'; ...@@ -6,7 +6,7 @@ import 'basic.dart';
import 'framework.dart'; import 'framework.dart';
/// A widget whose child can be mutated. /// A widget whose child can be mutated.
class Placeholder extends StatefulComponent { class Placeholder extends StatefulWidget {
Placeholder({ Key key }) : super(key: key); Placeholder({ Key key }) : super(key: key);
PlaceholderState createState() => new PlaceholderState(); PlaceholderState createState() => new PlaceholderState();
......
...@@ -9,7 +9,7 @@ import 'package:sky_services/sky/input_event.mojom.dart' as mojom; ...@@ -9,7 +9,7 @@ import 'package:sky_services/sky/input_event.mojom.dart' as mojom;
import 'basic.dart'; import 'basic.dart';
import 'framework.dart'; import 'framework.dart';
class RawKeyboardListener extends StatefulComponent { class RawKeyboardListener extends StatefulWidget {
RawKeyboardListener({ RawKeyboardListener({
Key key, Key key,
this.focused: false, this.focused: false,
......
...@@ -336,7 +336,7 @@ class _ModalScopeStatus extends InheritedWidget { ...@@ -336,7 +336,7 @@ class _ModalScopeStatus extends InheritedWidget {
} }
} }
class _ModalScope extends StatefulComponent { class _ModalScope extends StatefulWidget {
_ModalScope({ _ModalScope({
Key key, Key key,
this.route this.route
......
...@@ -34,7 +34,7 @@ typedef double SnapOffsetCallback(double scrollOffset, Size containerSize); ...@@ -34,7 +34,7 @@ typedef double SnapOffsetCallback(double scrollOffset, Size containerSize);
/// ///
/// Widgets that subclass [Scrollable] typically use state objects that subclass /// Widgets that subclass [Scrollable] typically use state objects that subclass
/// [ScrollableState]. /// [ScrollableState].
abstract class Scrollable extends StatefulComponent { abstract class Scrollable extends StatefulWidget {
Scrollable({ Scrollable({
Key key, Key key,
this.initialScrollOffset, this.initialScrollOffset,
...@@ -604,7 +604,7 @@ class ScrollNotification extends Notification { ...@@ -604,7 +604,7 @@ class ScrollNotification extends Notification {
final double scrollOffset; final double scrollOffset;
} }
/// A simple scrollable widget that has a single child. Use this component if /// A simple scrollable widget that has a single child. Use this widget if
/// you are not worried about offscreen widgets consuming resources. /// you are not worried about offscreen widgets consuming resources.
class ScrollableViewport extends Scrollable { class ScrollableViewport extends Scrollable {
ScrollableViewport({ ScrollableViewport({
...@@ -668,7 +668,7 @@ class _ScrollableViewportState extends ScrollableState<ScrollableViewport> { ...@@ -668,7 +668,7 @@ class _ScrollableViewportState extends ScrollableState<ScrollableViewport> {
/// A mashup of [ScrollableViewport] and [BlockBody]. Useful when you have a small, /// A mashup of [ScrollableViewport] and [BlockBody]. Useful when you have a small,
/// fixed number of children that you wish to arrange in a block layout and that /// fixed number of children that you wish to arrange in a block layout and that
/// might exceed the height of its container (and therefore need to scroll). /// might exceed the height of its container (and therefore need to scroll).
class Block extends StatelessComponent { class Block extends StatelessWidget {
Block({ Block({
Key key, Key key,
this.children: const <Widget>[], this.children: const <Widget>[],
......
...@@ -15,7 +15,7 @@ import 'gesture_detector.dart'; ...@@ -15,7 +15,7 @@ import 'gesture_detector.dart';
/// ///
/// This widget is useful for understand how an app presents itself to /// This widget is useful for understand how an app presents itself to
/// accessibility technology. /// accessibility technology.
class SemanticsDebugger extends StatefulComponent { class SemanticsDebugger extends StatefulWidget {
const SemanticsDebugger({ Key key, this.child }) : super(key: key); const SemanticsDebugger({ Key key, this.child }) : super(key: key);
final Widget child; final Widget child;
......
...@@ -5,16 +5,16 @@ ...@@ -5,16 +5,16 @@
import 'basic.dart'; import 'basic.dart';
import 'framework.dart'; import 'framework.dart';
/// A component that rebuilds when the given animation changes status. /// A widget that rebuilds when the given animation changes status.
abstract class StatusTransitionComponent extends StatefulComponent { abstract class StatusTransitionWidget extends StatefulWidget {
StatusTransitionComponent({ StatusTransitionWidget({
Key key, Key key,
this.animation this.animation
}) : super(key: key) { }) : super(key: key) {
assert(animation != null); assert(animation != null);
} }
/// The animation to which this component is listening. /// The animation to which this widget is listening.
final Animation<double> animation; final Animation<double> animation;
Widget build(BuildContext context); Widget build(BuildContext context);
...@@ -22,13 +22,13 @@ abstract class StatusTransitionComponent extends StatefulComponent { ...@@ -22,13 +22,13 @@ abstract class StatusTransitionComponent extends StatefulComponent {
_StatusTransitionState createState() => new _StatusTransitionState(); _StatusTransitionState createState() => new _StatusTransitionState();
} }
class _StatusTransitionState extends State<StatusTransitionComponent> { class _StatusTransitionState extends State<StatusTransitionWidget> {
void initState() { void initState() {
super.initState(); super.initState();
config.animation.addStatusListener(_animationStatusChanged); config.animation.addStatusListener(_animationStatusChanged);
} }
void didUpdateConfig(StatusTransitionComponent oldConfig) { void didUpdateConfig(StatusTransitionWidget oldConfig) {
if (config.animation != oldConfig.animation) { if (config.animation != oldConfig.animation) {
oldConfig.animation.removeStatusListener(_animationStatusChanged); oldConfig.animation.removeStatusListener(_animationStatusChanged);
config.animation.addStatusListener(_animationStatusChanged); config.animation.addStatusListener(_animationStatusChanged);
......
...@@ -6,7 +6,7 @@ import 'package:flutter/services.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
/// Controls the description of this app in the operating system. /// Controls the description of this app in the operating system.
class Title extends StatelessComponent { class Title extends StatelessWidget {
Title({ Title({
Key key, Key key,
this.title, this.title,
......
...@@ -12,22 +12,22 @@ import 'framework.dart'; ...@@ -12,22 +12,22 @@ import 'framework.dart';
export 'package:flutter/animation.dart' show AnimationDirection; export 'package:flutter/animation.dart' show AnimationDirection;
export 'package:flutter/rendering.dart' show RelativeRect; export 'package:flutter/rendering.dart' show RelativeRect;
/// A component that rebuilds when the given animation changes value. /// A widget that rebuilds when the given animation changes value.
/// ///
/// AnimatedComponent is most useful for stateless animated widgets. To use /// AnimatedWidget is most useful for stateless animated widgets. To use
/// AnimatedComponent, simply subclass it and implement the build function. /// AnimatedWidget, simply subclass it and implement the build function.
/// ///
/// For more complex case involving additional state, consider using /// For more complex case involving additional state, consider using
/// [AnimatedBuilder]. /// [AnimatedBuilder].
abstract class AnimatedComponent extends StatefulComponent { abstract class AnimatedWidget extends StatefulWidget {
AnimatedComponent({ AnimatedWidget({
Key key, Key key,
this.animation this.animation
}) : super(key: key) { }) : super(key: key) {
assert(animation != null); assert(animation != null);
} }
/// The animation to which this component is listening. /// The animation to which this widget is listening.
final Animation<Object> animation; final Animation<Object> animation;
/// Override this function to build widgets that depend on the current value /// Override this function to build widgets that depend on the current value
...@@ -35,7 +35,7 @@ abstract class AnimatedComponent extends StatefulComponent { ...@@ -35,7 +35,7 @@ abstract class AnimatedComponent extends StatefulComponent {
Widget build(BuildContext context); Widget build(BuildContext context);
/// Subclasses typically do not override this method. /// Subclasses typically do not override this method.
_AnimatedComponentState createState() => new _AnimatedComponentState(); _AnimatedState createState() => new _AnimatedState();
void debugFillDescription(List<String> description) { void debugFillDescription(List<String> description) {
super.debugFillDescription(description); super.debugFillDescription(description);
...@@ -43,13 +43,13 @@ abstract class AnimatedComponent extends StatefulComponent { ...@@ -43,13 +43,13 @@ abstract class AnimatedComponent extends StatefulComponent {
} }
} }
class _AnimatedComponentState extends State<AnimatedComponent> { class _AnimatedState extends State<AnimatedWidget> {
void initState() { void initState() {
super.initState(); super.initState();
config.animation.addListener(_handleTick); config.animation.addListener(_handleTick);
} }
void didUpdateConfig(AnimatedComponent oldConfig) { void didUpdateConfig(AnimatedWidget oldConfig) {
if (config.animation != oldConfig.animation) { if (config.animation != oldConfig.animation) {
oldConfig.animation.removeListener(_handleTick); oldConfig.animation.removeListener(_handleTick);
config.animation.addListener(_handleTick); config.animation.addListener(_handleTick);
...@@ -73,7 +73,7 @@ class _AnimatedComponentState extends State<AnimatedComponent> { ...@@ -73,7 +73,7 @@ class _AnimatedComponentState extends State<AnimatedComponent> {
} }
/// Animates the position of a widget relative to its normal position. /// Animates the position of a widget relative to its normal position.
class SlideTransition extends AnimatedComponent { class SlideTransition extends AnimatedWidget {
SlideTransition({ SlideTransition({
Key key, Key key,
Animation<FractionalOffset> position, Animation<FractionalOffset> position,
...@@ -109,7 +109,7 @@ class SlideTransition extends AnimatedComponent { ...@@ -109,7 +109,7 @@ class SlideTransition extends AnimatedComponent {
} }
/// Animates the scale of transformed widget. /// Animates the scale of transformed widget.
class ScaleTransition extends AnimatedComponent { class ScaleTransition extends AnimatedWidget {
ScaleTransition({ ScaleTransition({
Key key, Key key,
Animation<double> scale, Animation<double> scale,
...@@ -145,7 +145,7 @@ class ScaleTransition extends AnimatedComponent { ...@@ -145,7 +145,7 @@ class ScaleTransition extends AnimatedComponent {
} }
/// Animates the rotation of a widget. /// Animates the rotation of a widget.
class RotationTransition extends AnimatedComponent { class RotationTransition extends AnimatedWidget {
RotationTransition({ RotationTransition({
Key key, Key key,
Animation<double> turns, Animation<double> turns,
...@@ -172,7 +172,7 @@ class RotationTransition extends AnimatedComponent { ...@@ -172,7 +172,7 @@ class RotationTransition extends AnimatedComponent {
} }
/// Animates a widget's width or height. /// Animates a widget's width or height.
class SizeTransition extends AnimatedComponent { class SizeTransition extends AnimatedWidget {
SizeTransition({ SizeTransition({
Key key, Key key,
this.axis: Axis.vertical, this.axis: Axis.vertical,
...@@ -209,7 +209,7 @@ class SizeTransition extends AnimatedComponent { ...@@ -209,7 +209,7 @@ class SizeTransition extends AnimatedComponent {
} }
/// Animates the opacity of a widget. /// Animates the opacity of a widget.
class FadeTransition extends AnimatedComponent { class FadeTransition extends AnimatedWidget {
FadeTransition({ FadeTransition({
Key key, Key key,
Animation<double> opacity, Animation<double> opacity,
...@@ -248,7 +248,7 @@ class RelativeRectTween extends Tween<RelativeRect> { ...@@ -248,7 +248,7 @@ class RelativeRectTween extends Tween<RelativeRect> {
/// position to and end position over the lifetime of the animation. /// position to and end position over the lifetime of the animation.
/// ///
/// Only works if it's the child of a [Stack]. /// Only works if it's the child of a [Stack].
class PositionedTransition extends AnimatedComponent { class PositionedTransition extends AnimatedWidget {
PositionedTransition({ PositionedTransition({
Key key, Key key,
Animation<RelativeRect> rect, Animation<RelativeRect> rect,
...@@ -278,7 +278,7 @@ typedef Widget TransitionBuilder(BuildContext context, Widget child); ...@@ -278,7 +278,7 @@ typedef Widget TransitionBuilder(BuildContext context, Widget child);
/// A general-purpose widget for building animations. /// A general-purpose widget for building animations.
/// ///
/// AnimatedBuilder is useful for more complex components that wish to include /// AnimatedBuilder is useful for more complex widgets that wish to include
/// an animation as part of a larger build function. To use AnimatedBuilder, /// an animation as part of a larger build function. To use AnimatedBuilder,
/// simply construct the widget and pass it a builder function. /// simply construct the widget and pass it a builder function.
/// ///
...@@ -294,8 +294,8 @@ typedef Widget TransitionBuilder(BuildContext context, Widget child); ...@@ -294,8 +294,8 @@ typedef Widget TransitionBuilder(BuildContext context, Widget child);
/// performance significantly in some cases and is therefore a good practice. /// performance significantly in some cases and is therefore a good practice.
/// ///
/// For simple cases without additional state, consider using /// For simple cases without additional state, consider using
/// [AnimatedComponent]. /// [AnimatedWidget].
class AnimatedBuilder extends AnimatedComponent { class AnimatedBuilder extends AnimatedWidget {
AnimatedBuilder({ AnimatedBuilder({
Key key, Key key,
Animation<Object> animation, Animation<Object> animation,
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
import 'framework.dart'; import 'framework.dart';
/// A widget that has exactly one inflated instance in the tree. /// A widget that has exactly one inflated instance in the tree.
abstract class UniqueComponent<T extends State> extends StatefulComponent { abstract class UniqueWidget<T extends State> extends StatefulWidget {
UniqueComponent({ GlobalKey key }) : super(key: key) { UniqueWidget({ GlobalKey key }) : super(key: key) {
assert(key != null); assert(key != null);
} }
......
...@@ -44,7 +44,7 @@ export 'src/widgets/semantics_debugger.dart'; ...@@ -44,7 +44,7 @@ export 'src/widgets/semantics_debugger.dart';
export 'src/widgets/status_transitions.dart'; export 'src/widgets/status_transitions.dart';
export 'src/widgets/title.dart'; export 'src/widgets/title.dart';
export 'src/widgets/transitions.dart'; export 'src/widgets/transitions.dart';
export 'src/widgets/unique_component.dart'; export 'src/widgets/unique_widget.dart';
export 'src/widgets/virtual_viewport.dart'; export 'src/widgets/virtual_viewport.dart';
export 'package:vector_math/vector_math_64.dart' show Matrix4; export 'package:vector_math/vector_math_64.dart' show Matrix4;
...@@ -9,7 +9,7 @@ import 'package:test/test.dart'; ...@@ -9,7 +9,7 @@ import 'package:test/test.dart';
import 'test_widgets.dart'; import 'test_widgets.dart';
class ProbeWidget extends StatefulComponent { class ProbeWidget extends StatefulWidget {
ProbeWidgetState createState() => new ProbeWidgetState(); ProbeWidgetState createState() => new ProbeWidgetState();
} }
...@@ -32,7 +32,7 @@ class ProbeWidgetState extends State<ProbeWidget> { ...@@ -32,7 +32,7 @@ class ProbeWidgetState extends State<ProbeWidget> {
} }
} }
class BadWidget extends StatelessComponent { class BadWidget extends StatelessWidget {
BadWidget(this.parentState); BadWidget(this.parentState);
final State parentState; final State parentState;
...@@ -43,7 +43,7 @@ class BadWidget extends StatelessComponent { ...@@ -43,7 +43,7 @@ class BadWidget extends StatelessComponent {
} }
} }
class BadWidgetParent extends StatefulComponent { class BadWidgetParent extends StatefulWidget {
BadWidgetParentState createState() => new BadWidgetParentState(); BadWidgetParentState createState() => new BadWidgetParentState();
} }
...@@ -53,7 +53,7 @@ class BadWidgetParentState extends State<BadWidgetParent> { ...@@ -53,7 +53,7 @@ class BadWidgetParentState extends State<BadWidgetParent> {
} }
} }
class BadDisposeWidget extends StatefulComponent { class BadDisposeWidget extends StatefulWidget {
BadDisposeWidgetState createState() => new BadDisposeWidgetState(); BadDisposeWidgetState createState() => new BadDisposeWidgetState();
} }
...@@ -98,17 +98,17 @@ void main() { ...@@ -98,17 +98,17 @@ void main() {
expect(ProbeWidgetState.buildCount, equals(1)); expect(ProbeWidgetState.buildCount, equals(1));
tester.pumpWidget(new ProbeWidget()); tester.pumpWidget(new ProbeWidget());
expect(ProbeWidgetState.buildCount, equals(2)); expect(ProbeWidgetState.buildCount, equals(2));
tester.pumpWidget(new FlipComponent( tester.pumpWidget(new FlipWidget(
key: flipKey, key: flipKey,
left: new Container(), left: new Container(),
right: new ProbeWidget() right: new ProbeWidget()
)); ));
expect(ProbeWidgetState.buildCount, equals(2)); expect(ProbeWidgetState.buildCount, equals(2));
FlipComponentState flipState1 = flipKey.currentState; FlipWidgetState flipState1 = flipKey.currentState;
flipState1.flip(); flipState1.flip();
tester.pump(); tester.pump();
expect(ProbeWidgetState.buildCount, equals(3)); expect(ProbeWidgetState.buildCount, equals(3));
FlipComponentState flipState2 = flipKey.currentState; FlipWidgetState flipState2 = flipKey.currentState;
flipState2.flip(); flipState2.flip();
tester.pump(); tester.pump();
expect(ProbeWidgetState.buildCount, equals(3)); expect(ProbeWidgetState.buildCount, equals(3));
......
...@@ -105,8 +105,8 @@ void dismissItem(WidgetTester tester, int item, { DismissDirection gestureDirect ...@@ -105,8 +105,8 @@ void dismissItem(WidgetTester tester, int item, { DismissDirection gestureDirect
tester.pumpWidget(widgetBuilder()); // rebuild after the callback removes the entry tester.pumpWidget(widgetBuilder()); // rebuild after the callback removes the entry
} }
class Test1215DismissableComponent extends StatelessComponent { class Test1215DismissableWidget extends StatelessWidget {
Test1215DismissableComponent(this.text); Test1215DismissableWidget(this.text);
final String text; final String text;
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Dismissable( return new Dismissable(
...@@ -270,8 +270,8 @@ void main() { ...@@ -270,8 +270,8 @@ void main() {
}); });
}); });
// This one is for a case where dssmissing a component above a previously // This one is for a case where dssmissing a widget above a previously
// dismissed component threw an exception, which was documented at the // dismissed widget threw an exception, which was documented at the
// now-obsolete URL https://github.com/flutter/engine/issues/1215 (the URL // now-obsolete URL https://github.com/flutter/engine/issues/1215 (the URL
// died in the migration to the new repo). Don't copy this test; it doesn't // died in the migration to the new repo). Don't copy this test; it doesn't
// actually remove the dismissed widget, which is a violation of the // actually remove the dismissed widget, which is a violation of the
...@@ -284,8 +284,8 @@ void main() { ...@@ -284,8 +284,8 @@ void main() {
height: 1000.0, height: 1000.0,
child: new Column( child: new Column(
children: <Widget>[ children: <Widget>[
new Test1215DismissableComponent('1'), new Test1215DismissableWidget('1'),
new Test1215DismissableComponent('2') new Test1215DismissableWidget('2')
] ]
) )
) )
......
...@@ -13,7 +13,7 @@ class Item { ...@@ -13,7 +13,7 @@ class Item {
} }
List<Item> items = <Item>[new Item(), new Item()]; List<Item> items = <Item>[new Item(), new Item()];
class StatefulLeaf extends StatefulComponent { class StatefulLeaf extends StatefulWidget {
StatefulLeaf({ GlobalKey key }) : super(key: key); StatefulLeaf({ GlobalKey key }) : super(key: key);
StatefulLeafState createState() => new StatefulLeafState(); StatefulLeafState createState() => new StatefulLeafState();
} }
...@@ -23,7 +23,7 @@ class StatefulLeafState extends State<StatefulLeaf> { ...@@ -23,7 +23,7 @@ class StatefulLeafState extends State<StatefulLeaf> {
Widget build(BuildContext context) => new Text('leaf'); Widget build(BuildContext context) => new Text('leaf');
} }
class KeyedWrapper extends StatelessComponent { class KeyedWrapper extends StatelessWidget {
KeyedWrapper(this.key1, this.key2); KeyedWrapper(this.key1, this.key2);
Key key1, key2; Key key1, key2;
Widget build(BuildContext context) { Widget build(BuildContext context) {
......
...@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
class TestFocusable extends StatelessComponent { class TestFocusable extends StatelessWidget {
TestFocusable({ TestFocusable({
GlobalKey key, GlobalKey key,
this.no, this.no,
......
...@@ -8,11 +8,11 @@ import 'package:test/test.dart'; ...@@ -8,11 +8,11 @@ import 'package:test/test.dart';
List<String> ancestors = <String>[]; List<String> ancestors = <String>[];
class TestComponent extends StatefulComponent { class TestWidget extends StatefulWidget {
TestComponentState createState() => new TestComponentState(); TestWidgetState createState() => new TestWidgetState();
} }
class TestComponentState extends State<TestComponent> { class TestWidgetState extends State<TestWidget> {
void initState() { void initState() {
super.initState(); super.initState();
context.visitAncestorElements((Element element) { context.visitAncestorElements((Element element) {
...@@ -27,7 +27,7 @@ class TestComponentState extends State<TestComponent> { ...@@ -27,7 +27,7 @@ class TestComponentState extends State<TestComponent> {
void main() { void main() {
test('initState() is called when we are in the tree', () { test('initState() is called when we are in the tree', () {
testWidgets((WidgetTester tester) { testWidgets((WidgetTester tester) {
tester.pumpWidget(new Container(child: new TestComponent())); tester.pumpWidget(new Container(child: new TestWidget()));
expect(ancestors, equals(<String>['Container', 'RenderObjectToWidgetAdapter<RenderBox>'])); expect(ancestors, equals(<String>['Container', 'RenderObjectToWidgetAdapter<RenderBox>']));
}); });
}); });
......
...@@ -17,7 +17,7 @@ void main() { ...@@ -17,7 +17,7 @@ void main() {
// so if our widget is 100 pixels tall, it should fit exactly 6 times. // so if our widget is 100 pixels tall, it should fit exactly 6 times.
Widget builder() { Widget builder() {
return new FlipComponent( return new FlipWidget(
left: new MixedViewport( left: new MixedViewport(
builder: (BuildContext context, int i) { builder: (BuildContext context, int i) {
callbackTracker.add(i); callbackTracker.add(i);
...@@ -35,19 +35,19 @@ void main() { ...@@ -35,19 +35,19 @@ void main() {
tester.pumpWidget(builder()); tester.pumpWidget(builder());
StatefulComponentElement element = tester.findElement((Element element) => element.widget is FlipComponent); StatefulElement element = tester.findElement((Element element) => element.widget is FlipWidget);
FlipComponentState testComponent = element.state; FlipWidgetState testWidget = element.state;
expect(callbackTracker, equals([0, 1, 2, 3, 4, 5])); expect(callbackTracker, equals([0, 1, 2, 3, 4, 5]));
callbackTracker.clear(); callbackTracker.clear();
testComponent.flip(); testWidget.flip();
tester.pump(); tester.pump();
expect(callbackTracker, equals([])); expect(callbackTracker, equals([]));
callbackTracker.clear(); callbackTracker.clear();
testComponent.flip(); testWidget.flip();
tester.pump(); tester.pump();
expect(callbackTracker, equals([0, 1, 2, 3, 4, 5])); expect(callbackTracker, equals([0, 1, 2, 3, 4, 5]));
...@@ -75,7 +75,7 @@ void main() { ...@@ -75,7 +75,7 @@ void main() {
}; };
Widget builder() { Widget builder() {
return new FlipComponent( return new FlipWidget(
left: new MixedViewport( left: new MixedViewport(
builder: itemBuilder, builder: itemBuilder,
startOffset: offset startOffset: offset
...@@ -123,7 +123,7 @@ void main() { ...@@ -123,7 +123,7 @@ void main() {
}; };
Widget builder() { Widget builder() {
return new FlipComponent( return new FlipWidget(
left: new MixedViewport( left: new MixedViewport(
builder: itemBuilder, builder: itemBuilder,
startOffset: offset, startOffset: offset,
......
...@@ -62,8 +62,8 @@ void main() { ...@@ -62,8 +62,8 @@ void main() {
test('ModalBarrier pops the Navigator when dismissed', () { test('ModalBarrier pops the Navigator when dismissed', () {
testWidgets((WidgetTester tester) { testWidgets((WidgetTester tester) {
final Map<String, RouteBuilder> routes = <String, RouteBuilder>{ final Map<String, RouteBuilder> routes = <String, RouteBuilder>{
'/': (RouteArguments args) => new FirstComponent(), '/': (RouteArguments args) => new FirstWidget(),
'/modal': (RouteArguments args) => new SecondComponent(), '/modal': (RouteArguments args) => new SecondWidget(),
}; };
tester.pumpWidget(new MaterialApp(routes: routes)); tester.pumpWidget(new MaterialApp(routes: routes));
...@@ -87,7 +87,7 @@ void main() { ...@@ -87,7 +87,7 @@ void main() {
}); });
} }
class FirstComponent extends StatelessComponent { class FirstWidget extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new GestureDetector( return new GestureDetector(
onTap: () { onTap: () {
...@@ -100,7 +100,7 @@ class FirstComponent extends StatelessComponent { ...@@ -100,7 +100,7 @@ class FirstComponent extends StatelessComponent {
} }
} }
class SecondComponent extends StatelessComponent { class SecondWidget extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new ModalBarrier( return new ModalBarrier(
key: const ValueKey<String>('barrier'), key: const ValueKey<String>('barrier'),
......
...@@ -113,7 +113,7 @@ void main() { ...@@ -113,7 +113,7 @@ void main() {
}); });
}); });
test('MultiChildRenderObjectElement with stateless components', () { test('MultiChildRenderObjectElement with stateless widgets', () {
testWidgets((WidgetTester tester) { testWidgets((WidgetTester tester) {
tester.pumpWidget( tester.pumpWidget(
...@@ -234,7 +234,7 @@ void main() { ...@@ -234,7 +234,7 @@ void main() {
}); });
}); });
test('MultiChildRenderObjectElement with stateful components', () { test('MultiChildRenderObjectElement with stateful widgets', () {
testWidgets((WidgetTester tester) { testWidgets((WidgetTester tester) {
tester.pumpWidget( tester.pumpWidget(
new Stack( new Stack(
...@@ -250,7 +250,7 @@ void main() { ...@@ -250,7 +250,7 @@ void main() {
tester.pumpWidget( tester.pumpWidget(
new Stack( new Stack(
children: <Widget>[ children: <Widget>[
new FlipComponent( new FlipWidget(
left: new DecoratedBox(decoration: kBoxDecorationA), left: new DecoratedBox(decoration: kBoxDecorationA),
right: new DecoratedBox(decoration: kBoxDecorationB) right: new DecoratedBox(decoration: kBoxDecorationB)
), ),
...@@ -261,7 +261,7 @@ void main() { ...@@ -261,7 +261,7 @@ void main() {
checkTree(tester, <BoxDecoration>[kBoxDecorationA, kBoxDecorationC]); checkTree(tester, <BoxDecoration>[kBoxDecorationA, kBoxDecorationC]);
flipStatefulComponent(tester); flipStatefulWidget(tester);
tester.pump(); tester.pump();
checkTree(tester, <BoxDecoration>[kBoxDecorationB, kBoxDecorationC]); checkTree(tester, <BoxDecoration>[kBoxDecorationB, kBoxDecorationC]);
...@@ -269,7 +269,7 @@ void main() { ...@@ -269,7 +269,7 @@ void main() {
tester.pumpWidget( tester.pumpWidget(
new Stack( new Stack(
children: <Widget>[ children: <Widget>[
new FlipComponent( new FlipWidget(
left: new DecoratedBox(decoration: kBoxDecorationA), left: new DecoratedBox(decoration: kBoxDecorationA),
right: new DecoratedBox(decoration: kBoxDecorationB) right: new DecoratedBox(decoration: kBoxDecorationB)
), ),
...@@ -279,7 +279,7 @@ void main() { ...@@ -279,7 +279,7 @@ void main() {
checkTree(tester, <BoxDecoration>[kBoxDecorationB]); checkTree(tester, <BoxDecoration>[kBoxDecorationB]);
flipStatefulComponent(tester); flipStatefulWidget(tester);
tester.pump(); tester.pump();
checkTree(tester, <BoxDecoration>[kBoxDecorationA]); checkTree(tester, <BoxDecoration>[kBoxDecorationA]);
...@@ -287,7 +287,7 @@ void main() { ...@@ -287,7 +287,7 @@ void main() {
tester.pumpWidget( tester.pumpWidget(
new Stack( new Stack(
children: <Widget>[ children: <Widget>[
new FlipComponent( new FlipWidget(
key: new Key('flip'), key: new Key('flip'),
left: new DecoratedBox(decoration: kBoxDecorationA), left: new DecoratedBox(decoration: kBoxDecorationA),
right: new DecoratedBox(decoration: kBoxDecorationB) right: new DecoratedBox(decoration: kBoxDecorationB)
...@@ -300,7 +300,7 @@ void main() { ...@@ -300,7 +300,7 @@ void main() {
new Stack( new Stack(
children: <Widget>[ children: <Widget>[
new DecoratedBox(key: new Key('c'), decoration: kBoxDecorationC), new DecoratedBox(key: new Key('c'), decoration: kBoxDecorationC),
new FlipComponent( new FlipWidget(
key: new Key('flip'), key: new Key('flip'),
left: new DecoratedBox(decoration: kBoxDecorationA), left: new DecoratedBox(decoration: kBoxDecorationA),
right: new DecoratedBox(decoration: kBoxDecorationB) right: new DecoratedBox(decoration: kBoxDecorationB)
...@@ -311,7 +311,7 @@ void main() { ...@@ -311,7 +311,7 @@ void main() {
checkTree(tester, <BoxDecoration>[kBoxDecorationC, kBoxDecorationA]); checkTree(tester, <BoxDecoration>[kBoxDecorationC, kBoxDecorationA]);
flipStatefulComponent(tester); flipStatefulWidget(tester);
tester.pump(); tester.pump();
checkTree(tester, <BoxDecoration>[kBoxDecorationC, kBoxDecorationB]); checkTree(tester, <BoxDecoration>[kBoxDecorationC, kBoxDecorationB]);
...@@ -319,7 +319,7 @@ void main() { ...@@ -319,7 +319,7 @@ void main() {
tester.pumpWidget( tester.pumpWidget(
new Stack( new Stack(
children: <Widget>[ children: <Widget>[
new FlipComponent( new FlipWidget(
key: new Key('flip'), key: new Key('flip'),
left: new DecoratedBox(decoration: kBoxDecorationA), left: new DecoratedBox(decoration: kBoxDecorationA),
right: new DecoratedBox(decoration: kBoxDecorationB) right: new DecoratedBox(decoration: kBoxDecorationB)
......
...@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
class FirstComponent extends StatelessComponent { class FirstWidget extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new GestureDetector( return new GestureDetector(
onTap: () { onTap: () {
...@@ -22,11 +22,11 @@ class FirstComponent extends StatelessComponent { ...@@ -22,11 +22,11 @@ class FirstComponent extends StatelessComponent {
} }
} }
class SecondComponent extends StatefulComponent { class SecondWidget extends StatefulWidget {
SecondComponentState createState() => new SecondComponentState(); SecondWidgetState createState() => new SecondWidgetState();
} }
class SecondComponentState extends State<SecondComponent> { class SecondWidgetState extends State<SecondWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new GestureDetector( return new GestureDetector(
onTap: () => Navigator.pop(context), onTap: () => Navigator.pop(context),
...@@ -42,8 +42,8 @@ class SecondComponentState extends State<SecondComponent> { ...@@ -42,8 +42,8 @@ class SecondComponentState extends State<SecondComponent> {
typedef void ExceptionCallback(dynamic exception); typedef void ExceptionCallback(dynamic exception);
class ThirdComponent extends StatelessComponent { class ThirdWidget extends StatelessWidget {
ThirdComponent({ this.targetKey, this.onException }); ThirdWidget({ this.targetKey, this.onException });
final Key targetKey; final Key targetKey;
final ExceptionCallback onException; final ExceptionCallback onException;
...@@ -64,11 +64,11 @@ class ThirdComponent extends StatelessComponent { ...@@ -64,11 +64,11 @@ class ThirdComponent extends StatelessComponent {
} }
void main() { void main() {
test('Can navigator navigate to and from a stateful component', () { test('Can navigator navigate to and from a stateful widget', () {
testWidgets((WidgetTester tester) { testWidgets((WidgetTester tester) {
final Map<String, RouteBuilder> routes = <String, RouteBuilder>{ final Map<String, RouteBuilder> routes = <String, RouteBuilder>{
'/': (RouteArguments args) => new FirstComponent(), '/': (RouteArguments args) => new FirstWidget(),
'/second': (RouteArguments args) => new SecondComponent(), '/second': (RouteArguments args) => new SecondWidget(),
}; };
tester.pumpWidget(new MaterialApp(routes: routes)); tester.pumpWidget(new MaterialApp(routes: routes));
...@@ -101,7 +101,7 @@ void main() { ...@@ -101,7 +101,7 @@ void main() {
testWidgets((WidgetTester tester) { testWidgets((WidgetTester tester) {
Key targetKey = new Key('foo'); Key targetKey = new Key('foo');
dynamic exception; dynamic exception;
Widget widget = new ThirdComponent( Widget widget = new ThirdWidget(
targetKey: targetKey, targetKey: targetKey,
onException: (dynamic e) { onException: (dynamic e) {
exception = e; exception = e;
......
...@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:test/test.dart' hide TypeMatcher; import 'package:test/test.dart' hide TypeMatcher;
class TestTransition extends AnimatedComponent { class TestTransition extends AnimatedWidget {
TestTransition({ TestTransition({
Key key, Key key,
this.childFirstHalf, this.childFirstHalf,
......
...@@ -210,7 +210,7 @@ void main() { ...@@ -210,7 +210,7 @@ void main() {
children: <Widget>[ children: <Widget>[
new Positioned( new Positioned(
right: 10.0, right: 10.0,
child: new FlipComponent(left: kDecoratedBoxA, right: kDecoratedBoxB) child: new FlipWidget(left: kDecoratedBoxA, right: kDecoratedBoxB)
), ),
] ]
) )
...@@ -220,7 +220,7 @@ void main() { ...@@ -220,7 +220,7 @@ void main() {
new TestParentData(right: 10.0), new TestParentData(right: 10.0),
]); ]);
flipStatefulComponent(tester); flipStatefulWidget(tester);
tester.pump(); tester.pump();
checkTree(tester, <TestParentData>[ checkTree(tester, <TestParentData>[
...@@ -232,7 +232,7 @@ void main() { ...@@ -232,7 +232,7 @@ void main() {
children: <Widget>[ children: <Widget>[
new Positioned( new Positioned(
top: 7.0, top: 7.0,
child: new FlipComponent(left: kDecoratedBoxA, right: kDecoratedBoxB) child: new FlipWidget(left: kDecoratedBoxA, right: kDecoratedBoxB)
), ),
] ]
) )
...@@ -242,7 +242,7 @@ void main() { ...@@ -242,7 +242,7 @@ void main() {
new TestParentData(top: 7.0), new TestParentData(top: 7.0),
]); ]);
flipStatefulComponent(tester); flipStatefulWidget(tester);
tester.pump(); tester.pump();
checkTree(tester, <TestParentData>[ checkTree(tester, <TestParentData>[
......
...@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
class ThePositiveNumbers extends StatelessComponent { class ThePositiveNumbers extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new ScrollableLazyList( return new ScrollableLazyList(
itemExtent: 100.0, itemExtent: 100.0,
...@@ -47,7 +47,7 @@ void main() { ...@@ -47,7 +47,7 @@ void main() {
expect(tester.findText('10'), isNull); expect(tester.findText('10'), isNull);
expect(tester.findText('100'), isNull); expect(tester.findText('100'), isNull);
StatefulComponentElement target = StatefulElement target =
tester.findElement((Element element) => element.widget is ScrollableLazyList); tester.findElement((Element element) => element.widget is ScrollableLazyList);
ScrollableState targetState = target.state; ScrollableState targetState = target.state;
targetState.scrollTo(1000.0); targetState.scrollTo(1000.0);
......
...@@ -11,8 +11,8 @@ final BoxDecoration kBoxDecorationA = new BoxDecoration(); ...@@ -11,8 +11,8 @@ final BoxDecoration kBoxDecorationA = new BoxDecoration();
final BoxDecoration kBoxDecorationB = new BoxDecoration(); final BoxDecoration kBoxDecorationB = new BoxDecoration();
final BoxDecoration kBoxDecorationC = new BoxDecoration(); final BoxDecoration kBoxDecorationC = new BoxDecoration();
class TestComponent extends StatelessComponent { class TestWidget extends StatelessWidget {
const TestComponent({ this.child }); const TestWidget({ this.child });
final Widget child; final Widget child;
Widget build(BuildContext context) => child; Widget build(BuildContext context) => child;
} }
...@@ -80,7 +80,7 @@ void main() { ...@@ -80,7 +80,7 @@ void main() {
tester.pumpWidget(new DecoratedBox( tester.pumpWidget(new DecoratedBox(
decoration: kBoxDecorationA, decoration: kBoxDecorationA,
child: new TestComponent( child: new TestWidget(
child: new DecoratedBox( child: new DecoratedBox(
decoration: kBoxDecorationB decoration: kBoxDecorationB
) )
...@@ -106,8 +106,8 @@ void main() { ...@@ -106,8 +106,8 @@ void main() {
tester.pumpWidget(new DecoratedBox( tester.pumpWidget(new DecoratedBox(
decoration: kBoxDecorationA, decoration: kBoxDecorationA,
child: new TestComponent( child: new TestWidget(
child: new TestComponent( child: new TestWidget(
child: new DecoratedBox( child: new DecoratedBox(
decoration: kBoxDecorationB decoration: kBoxDecorationB
) )
......
...@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
class StateMarker extends StatefulComponent { class StateMarker extends StatefulWidget {
StateMarker({ Key key, this.child }) : super(key: key); StateMarker({ Key key, this.child }) : super(key: key);
final Widget child; final Widget child;
......
...@@ -17,7 +17,7 @@ void main() { ...@@ -17,7 +17,7 @@ void main() {
// so if our widget is 100 pixels tall, it should fit exactly 6 times. // so if our widget is 100 pixels tall, it should fit exactly 6 times.
Widget builder() { Widget builder() {
return new FlipComponent( return new FlipWidget(
left: new ScrollableLazyList( left: new ScrollableLazyList(
itemBuilder: (BuildContext context, int start, int count) { itemBuilder: (BuildContext context, int start, int count) {
List<Widget> result = <Widget>[]; List<Widget> result = <Widget>[];
...@@ -39,19 +39,19 @@ void main() { ...@@ -39,19 +39,19 @@ void main() {
tester.pumpWidget(builder()); tester.pumpWidget(builder());
StatefulComponentElement element = tester.findElement((Element element) => element.widget is FlipComponent); StatefulElement element = tester.findElement((Element element) => element.widget is FlipWidget);
FlipComponentState testComponent = element.state; FlipWidgetState testWidget = element.state;
expect(callbackTracker, equals([0, 1, 2, 3, 4, 5])); expect(callbackTracker, equals([0, 1, 2, 3, 4, 5]));
callbackTracker.clear(); callbackTracker.clear();
testComponent.flip(); testWidget.flip();
tester.pump(); tester.pump();
expect(callbackTracker, equals([])); expect(callbackTracker, equals([]));
callbackTracker.clear(); callbackTracker.clear();
testComponent.flip(); testWidget.flip();
tester.pump(); tester.pump();
expect(callbackTracker, equals([0, 1, 2, 3, 4, 5])); expect(callbackTracker, equals([0, 1, 2, 3, 4, 5]));
...@@ -81,7 +81,7 @@ void main() { ...@@ -81,7 +81,7 @@ void main() {
}; };
GlobalKey<ScrollableState<ScrollableLazyList>> scrollableKey = new GlobalKey<ScrollableState<ScrollableLazyList>>(); GlobalKey<ScrollableState<ScrollableLazyList>> scrollableKey = new GlobalKey<ScrollableState<ScrollableLazyList>>();
FlipComponent testComponent = new FlipComponent( FlipWidget testWidget = new FlipWidget(
left: new ScrollableLazyList( left: new ScrollableLazyList(
key: scrollableKey, key: scrollableKey,
itemBuilder: itemBuilder, itemBuilder: itemBuilder,
...@@ -91,7 +91,7 @@ void main() { ...@@ -91,7 +91,7 @@ void main() {
right: new Text('Not Today') right: new Text('Not Today')
); );
tester.pumpWidget(testComponent); tester.pumpWidget(testWidget);
expect(callbackTracker, equals([1, 2, 3, 4])); expect(callbackTracker, equals([1, 2, 3, 4]));
...@@ -100,7 +100,7 @@ void main() { ...@@ -100,7 +100,7 @@ void main() {
scrollableKey.currentState.scrollTo(400.0); scrollableKey.currentState.scrollTo(400.0);
// now only 3 should fit, numbered 2-4. // now only 3 should fit, numbered 2-4.
tester.pumpWidget(testComponent); tester.pumpWidget(testWidget);
expect(callbackTracker, equals([2, 3, 4])); expect(callbackTracker, equals([2, 3, 4]));
...@@ -131,7 +131,7 @@ void main() { ...@@ -131,7 +131,7 @@ void main() {
}; };
GlobalKey<ScrollableState<ScrollableLazyList>> scrollableKey = new GlobalKey<ScrollableState<ScrollableLazyList>>(); GlobalKey<ScrollableState<ScrollableLazyList>> scrollableKey = new GlobalKey<ScrollableState<ScrollableLazyList>>();
FlipComponent testComponent = new FlipComponent( FlipWidget testWidget = new FlipWidget(
left: new ScrollableLazyList( left: new ScrollableLazyList(
key: scrollableKey, key: scrollableKey,
itemBuilder: itemBuilder, itemBuilder: itemBuilder,
...@@ -142,7 +142,7 @@ void main() { ...@@ -142,7 +142,7 @@ void main() {
right: new Text('Not Today') right: new Text('Not Today')
); );
tester.pumpWidget(testComponent); tester.pumpWidget(testWidget);
expect(callbackTracker, equals([1, 2, 3, 4, 5])); expect(callbackTracker, equals([1, 2, 3, 4, 5]));
...@@ -151,7 +151,7 @@ void main() { ...@@ -151,7 +151,7 @@ void main() {
scrollableKey.currentState.scrollTo(400.0); scrollableKey.currentState.scrollTo(400.0);
// now only 4 should fit, numbered 2-5. // now only 4 should fit, numbered 2-5.
tester.pumpWidget(testComponent); tester.pumpWidget(testWidget);
expect(callbackTracker, equals([2, 3, 4, 5])); expect(callbackTracker, equals([2, 3, 4, 5]));
......
...@@ -8,7 +8,7 @@ import 'package:test/test.dart'; ...@@ -8,7 +8,7 @@ import 'package:test/test.dart';
ChangerState changer; ChangerState changer;
class Changer extends StatefulComponent { class Changer extends StatefulWidget {
Changer(this.child); Changer(this.child);
final Widget child; final Widget child;
...@@ -29,7 +29,7 @@ class ChangerState extends State<Changer> { ...@@ -29,7 +29,7 @@ class ChangerState extends State<Changer> {
Widget build(BuildContext context) => _state ? new Wrapper(config.child) : config.child; Widget build(BuildContext context) => _state ? new Wrapper(config.child) : config.child;
} }
class Wrapper extends StatelessComponent { class Wrapper extends StatelessWidget {
Wrapper(this.child); Wrapper(this.child);
final Widget child; final Widget child;
...@@ -37,7 +37,7 @@ class Wrapper extends StatelessComponent { ...@@ -37,7 +37,7 @@ class Wrapper extends StatelessComponent {
Widget build(BuildContext context) => child; Widget build(BuildContext context) => child;
} }
class Leaf extends StatefulComponent { class Leaf extends StatefulWidget {
LeafState createState() => new LeafState(); LeafState createState() => new LeafState();
} }
......
...@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
class Inside extends StatefulComponent { class Inside extends StatefulWidget {
InsideState createState() => new InsideState(); InsideState createState() => new InsideState();
} }
...@@ -23,7 +23,7 @@ class InsideState extends State<Inside> { ...@@ -23,7 +23,7 @@ class InsideState extends State<Inside> {
} }
} }
class Middle extends StatefulComponent { class Middle extends StatefulWidget {
Middle({ this.child }); Middle({ this.child });
final Inside child; final Inside child;
...@@ -44,7 +44,7 @@ class MiddleState extends State<Middle> { ...@@ -44,7 +44,7 @@ class MiddleState extends State<Middle> {
} }
} }
class Outside extends StatefulComponent { class Outside extends StatefulWidget {
OutsideState createState() => new OutsideState(); OutsideState createState() => new OutsideState();
} }
......
...@@ -10,7 +10,7 @@ import 'package:test/test.dart'; ...@@ -10,7 +10,7 @@ import 'package:test/test.dart';
import 'test_widgets.dart'; import 'test_widgets.dart';
void main() { void main() {
test('Stateful component smoke test', () { test('Stateful widget smoke test', () {
testWidgets((WidgetTester tester) { testWidgets((WidgetTester tester) {
void checkTree(BoxDecoration expectedDecoration) { void checkTree(BoxDecoration expectedDecoration) {
...@@ -23,7 +23,7 @@ void main() { ...@@ -23,7 +23,7 @@ void main() {
} }
tester.pumpWidget( tester.pumpWidget(
new FlipComponent( new FlipWidget(
left: new DecoratedBox(decoration: kBoxDecorationA), left: new DecoratedBox(decoration: kBoxDecorationA),
right: new DecoratedBox(decoration: kBoxDecorationB) right: new DecoratedBox(decoration: kBoxDecorationB)
) )
...@@ -32,7 +32,7 @@ void main() { ...@@ -32,7 +32,7 @@ void main() {
checkTree(kBoxDecorationA); checkTree(kBoxDecorationA);
tester.pumpWidget( tester.pumpWidget(
new FlipComponent( new FlipWidget(
left: new DecoratedBox(decoration: kBoxDecorationB), left: new DecoratedBox(decoration: kBoxDecorationB),
right: new DecoratedBox(decoration: kBoxDecorationA) right: new DecoratedBox(decoration: kBoxDecorationA)
) )
...@@ -40,14 +40,14 @@ void main() { ...@@ -40,14 +40,14 @@ void main() {
checkTree(kBoxDecorationB); checkTree(kBoxDecorationB);
flipStatefulComponent(tester); flipStatefulWidget(tester);
tester.pump(); tester.pump();
checkTree(kBoxDecorationA); checkTree(kBoxDecorationA);
tester.pumpWidget( tester.pumpWidget(
new FlipComponent( new FlipWidget(
left: new DecoratedBox(decoration: kBoxDecorationA), left: new DecoratedBox(decoration: kBoxDecorationA),
right: new DecoratedBox(decoration: kBoxDecorationB) right: new DecoratedBox(decoration: kBoxDecorationB)
) )
...@@ -57,11 +57,11 @@ void main() { ...@@ -57,11 +57,11 @@ void main() {
}); });
}); });
test('Don\'t rebuild subcomponents', () { test('Don\'t rebuild subwidgets', () {
testWidgets((WidgetTester tester) { testWidgets((WidgetTester tester) {
tester.pumpWidget( tester.pumpWidget(
new FlipComponent( new FlipWidget(
key: new Key('rebuild test'), // this is so we don't get the state from the TestComponentConfig in the last test, but instead instantiate a new element with a new state. key: new Key('rebuild test'),
left: new TestBuildCounter(), left: new TestBuildCounter(),
right: new DecoratedBox(decoration: kBoxDecorationB) right: new DecoratedBox(decoration: kBoxDecorationB)
) )
...@@ -69,7 +69,7 @@ void main() { ...@@ -69,7 +69,7 @@ void main() {
expect(TestBuildCounter.buildCount, equals(1)); expect(TestBuildCounter.buildCount, equals(1));
flipStatefulComponent(tester); flipStatefulWidget(tester);
tester.pump(); tester.pump();
......
...@@ -6,12 +6,12 @@ import 'package:flutter_test/flutter_test.dart'; ...@@ -6,12 +6,12 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
class InnerComponent extends StatefulComponent { class InnerWidget extends StatefulWidget {
InnerComponent({ Key key }) : super(key: key); InnerWidget({ Key key }) : super(key: key);
InnerComponentState createState() => new InnerComponentState(); InnerWidgetState createState() => new InnerWidgetState();
} }
class InnerComponentState extends State<InnerComponent> { class InnerWidgetState extends State<InnerWidget> {
bool _didInitState = false; bool _didInitState = false;
void initState() { void initState() {
...@@ -24,10 +24,10 @@ class InnerComponentState extends State<InnerComponent> { ...@@ -24,10 +24,10 @@ class InnerComponentState extends State<InnerComponent> {
} }
} }
class OuterContainer extends StatefulComponent { class OuterContainer extends StatefulWidget {
OuterContainer({ Key key, this.child }) : super(key: key); OuterContainer({ Key key, this.child }) : super(key: key);
final InnerComponent child; final InnerWidget child;
OuterContainerState createState() => new OuterContainerState(); OuterContainerState createState() => new OuterContainerState();
} }
...@@ -44,20 +44,20 @@ void main() { ...@@ -44,20 +44,20 @@ void main() {
Key innerKey = new Key('inner'); Key innerKey = new Key('inner');
Key outerKey = new Key('outer'); Key outerKey = new Key('outer');
InnerComponent inner1 = new InnerComponent(key: innerKey); InnerWidget inner1 = new InnerWidget(key: innerKey);
InnerComponent inner2; InnerWidget inner2;
OuterContainer outer1 = new OuterContainer(key: outerKey, child: inner1); OuterContainer outer1 = new OuterContainer(key: outerKey, child: inner1);
OuterContainer outer2; OuterContainer outer2;
tester.pumpWidget(outer1); tester.pumpWidget(outer1);
StatefulComponentElement innerElement = tester.findElementByKey(innerKey); StatefulElement innerElement = tester.findElementByKey(innerKey);
InnerComponentState innerElementState = innerElement.state; InnerWidgetState innerElementState = innerElement.state;
expect(innerElementState.config, equals(inner1)); expect(innerElementState.config, equals(inner1));
expect(innerElementState._didInitState, isTrue); expect(innerElementState._didInitState, isTrue);
expect(innerElement.renderObject.attached, isTrue); expect(innerElement.renderObject.attached, isTrue);
inner2 = new InnerComponent(key: innerKey); inner2 = new InnerWidget(key: innerKey);
outer2 = new OuterContainer(key: outerKey, child: inner2); outer2 = new OuterContainer(key: outerKey, child: inner2);
tester.pumpWidget(outer2); tester.pumpWidget(outer2);
...@@ -69,7 +69,7 @@ void main() { ...@@ -69,7 +69,7 @@ void main() {
expect(innerElementState._didInitState, isTrue); expect(innerElementState._didInitState, isTrue);
expect(innerElement.renderObject.attached, isTrue); expect(innerElement.renderObject.attached, isTrue);
StatefulComponentElement outerElement = tester.findElementByKey(outerKey); StatefulElement outerElement = tester.findElementByKey(outerKey);
expect(outerElement.state.config, equals(outer2)); expect(outerElement.state.config, equals(outer2));
outerElement.state.setState(() {}); outerElement.state.setState(() {});
tester.pump(); tester.pump();
......
...@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
class TestWidget extends StatefulComponent { class TestWidget extends StatefulWidget {
TestWidget({ this.child, this.persistentState, this.syncedState }); TestWidget({ this.child, this.persistentState, this.syncedState });
final Widget child; final Widget child;
......
...@@ -18,7 +18,7 @@ final BoxDecoration kBoxDecorationC = new BoxDecoration( ...@@ -18,7 +18,7 @@ final BoxDecoration kBoxDecorationC = new BoxDecoration(
backgroundColor: const Color(0xFF0000FF) backgroundColor: const Color(0xFF0000FF)
); );
class TestBuildCounter extends StatelessComponent { class TestBuildCounter extends StatelessWidget {
static int buildCount = 0; static int buildCount = 0;
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -28,16 +28,16 @@ class TestBuildCounter extends StatelessComponent { ...@@ -28,16 +28,16 @@ class TestBuildCounter extends StatelessComponent {
} }
class FlipComponent extends StatefulComponent { class FlipWidget extends StatefulWidget {
FlipComponent({ Key key, this.left, this.right }) : super(key: key); FlipWidget({ Key key, this.left, this.right }) : super(key: key);
final Widget left; final Widget left;
final Widget right; final Widget right;
FlipComponentState createState() => new FlipComponentState(); FlipWidgetState createState() => new FlipWidgetState();
} }
class FlipComponentState extends State<FlipComponent> { class FlipWidgetState extends State<FlipWidget> {
bool _showLeft = true; bool _showLeft = true;
void flip() { void flip() {
...@@ -51,11 +51,11 @@ class FlipComponentState extends State<FlipComponent> { ...@@ -51,11 +51,11 @@ class FlipComponentState extends State<FlipComponent> {
} }
} }
void flipStatefulComponent(WidgetTester tester) { void flipStatefulWidget(WidgetTester tester) {
StatefulComponentElement stateElement = StatefulElement stateElement =
tester.findElement((Element element) => element is StatefulComponentElement); tester.findElement((Element element) => element is StatefulElement);
expect(stateElement, isNotNull); expect(stateElement, isNotNull);
expect(stateElement.state is FlipComponentState, isTrue); expect(stateElement.state is FlipWidgetState, isTrue);
FlipComponentState state = stateElement.state; FlipWidgetState state = stateElement.state;
state.flip(); state.flip();
} }
...@@ -15,7 +15,7 @@ typedef void MarkdownLinkCallback(String href); ...@@ -15,7 +15,7 @@ typedef void MarkdownLinkCallback(String href);
/// https://daringfireball.net/projects/markdown/ The rendered markdown is /// https://daringfireball.net/projects/markdown/ The rendered markdown is
/// placed in a padded scrolling view port. If you do not want the scrolling /// placed in a padded scrolling view port. If you do not want the scrolling
/// behaviour, use the [MarkdownBodyRaw] class instead. /// behaviour, use the [MarkdownBodyRaw] class instead.
class MarkdownRaw extends StatelessComponent { class MarkdownRaw extends StatelessWidget {
/// Creates a new Markdown [Widget] that renders the markdown formatted string /// Creates a new Markdown [Widget] that renders the markdown formatted string
/// passed in as [data]. By default the markdown will be rendered using the /// passed in as [data]. By default the markdown will be rendered using the
...@@ -82,7 +82,7 @@ class MarkdownRaw extends StatelessComponent { ...@@ -82,7 +82,7 @@ class MarkdownRaw extends StatelessComponent {
/// https://daringfireball.net/projects/markdown/ This class doesn't implement /// https://daringfireball.net/projects/markdown/ This class doesn't implement
/// any scrolling behavior, if you want scrolling either wrap the widget in /// any scrolling behavior, if you want scrolling either wrap the widget in
/// a [ScrollableViewport] or use the [MarkdownRaw] widget. /// a [ScrollableViewport] or use the [MarkdownRaw] widget.
class MarkdownBodyRaw extends StatefulComponent { class MarkdownBodyRaw extends StatefulWidget {
/// Creates a new Markdown [Widget] that renders the markdown formatted string /// Creates a new Markdown [Widget] that renders the markdown formatted string
/// passed in as [data]. You need to pass in a [markdownStyle] that defines /// passed in as [data]. You need to pass in a [markdownStyle] that defines
......
...@@ -92,8 +92,8 @@ class Instrumentation { ...@@ -92,8 +92,8 @@ class Instrumentation {
/// the given [runtimeType], if any. Returns null if there is no /// the given [runtimeType], if any. Returns null if there is no
/// matching element. /// matching element.
State findStateOfType(Type type) { State findStateOfType(Type type) {
StatefulComponentElement element = findElement((Element element) { StatefulElement element = findElement((Element element) {
return element is StatefulComponentElement && element.state.runtimeType == type; return element is StatefulElement && element.state.runtimeType == type;
}); });
return element?.state; return element?.state;
} }
...@@ -103,8 +103,8 @@ class Instrumentation { ...@@ -103,8 +103,8 @@ class Instrumentation {
/// given configuration is not that of a stateful widget or if there /// given configuration is not that of a stateful widget or if there
/// is no matching element. /// is no matching element.
State findStateByConfig(Widget config) { State findStateByConfig(Widget config) {
StatefulComponentElement element = findElement((Element element) { StatefulElement element = findElement((Element element) {
return element is StatefulComponentElement && element.state.config == config; return element is StatefulElement && element.state.config == config;
}); });
return element?.state; return element?.state;
} }
......
...@@ -336,7 +336,7 @@ class AnalyzeCommand extends FlutterCommand { ...@@ -336,7 +336,7 @@ class AnalyzeCommand extends FlutterCommand {
RegExp generalPattern = new RegExp(r'^\[(error|warning|hint|lint)\] (.+) \(([^(),]+), line ([0-9]+), col ([0-9]+)\)$'); RegExp generalPattern = new RegExp(r'^\[(error|warning|hint|lint)\] (.+) \(([^(),]+), line ([0-9]+), col ([0-9]+)\)$');
RegExp allowedIdentifiersPattern = new RegExp(r'_?([A-Z]|_+)\b'); RegExp allowedIdentifiersPattern = new RegExp(r'_?([A-Z]|_+)\b');
RegExp classesWithOptionalTypeArgumentsPattern = new RegExp(r'\b(GlobalKey|State|ScrollableState|Element|StatelessComponentElement|TypeMatcher)\b'); RegExp classesWithOptionalTypeArgumentsPattern = new RegExp(r'\b(GlobalKey|State|ScrollableState|Element|StatelessElement|TypeMatcher)\b');
RegExp constructorTearOffsPattern = new RegExp('.+#.+// analyzer doesn\'t like constructor tear-offs'); RegExp constructorTearOffsPattern = new RegExp('.+#.+// analyzer doesn\'t like constructor tear-offs');
RegExp conflictingNamesPattern = new RegExp('^The imported libraries \'([^\']+)\' and \'([^\']+)\' cannot have the same name \'([^\']+)\'\$'); RegExp conflictingNamesPattern = new RegExp('^The imported libraries \'([^\']+)\' and \'([^\']+)\' cannot have the same name \'([^\']+)\'\$');
RegExp missingFilePattern = new RegExp('^Target of URI does not exist: \'([^\')]+)\'\$'); RegExp missingFilePattern = new RegExp('^Target of URI does not exist: \'([^\')]+)\'\$');
......
...@@ -19,7 +19,7 @@ void main() { ...@@ -19,7 +19,7 @@ void main() {
); );
} }
class FlutterDemo extends StatefulComponent { class FlutterDemo extends StatefulWidget {
_FlutterDemoState createState() => new _FlutterDemoState(); _FlutterDemoState createState() => new _FlutterDemoState();
} }
......
...@@ -41,7 +41,7 @@ const double kIndicatorStrokeWidth = 2.0; ...@@ -41,7 +41,7 @@ const double kIndicatorStrokeWidth = 2.0;
const Color kIndicatorColor = const Color(0xFFFF4081); const Color kIndicatorColor = const Color(0xFFFF4081);
const double kIndicatorMargin = 2.0; const double kIndicatorMargin = 2.0;
class Chart extends StatelessComponent { class Chart extends StatelessWidget {
Chart({ Key key, this.data }) : super(key: key); Chart({ Key key, this.data }) : super(key: key);
final ChartData data; final ChartData data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment