[rename fixit] *Component* -> *Widget*
This patch renames StatelessComponent to StatelessWidget and StatefulComponent to StatefulWidget. Fixes #2308
This commit is contained in:
@@ -55,7 +55,7 @@ class _ButtonDemo {
|
||||
int get hashCode => hashValues(title.hashCode, text.hashCode);
|
||||
}
|
||||
|
||||
class ButtonsDemo extends StatefulComponent {
|
||||
class ButtonsDemo extends StatefulWidget {
|
||||
_ButtonsDemoState createState() => new _ButtonsDemoState();
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
assert(destination != null && destination.isValid);
|
||||
}
|
||||
@@ -114,7 +114,7 @@ class TravelDestinationItem extends StatelessComponent {
|
||||
}
|
||||
}
|
||||
|
||||
class CardsDemo extends StatelessComponent {
|
||||
class CardsDemo extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return new Scaffold(
|
||||
toolBar: new ToolBar(
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ChipDemo extends StatefulComponent {
|
||||
class ChipDemo extends StatefulWidget {
|
||||
_ChipDemoState createState() => new _ChipDemoState();
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
assert(index != null);
|
||||
assert(color != null);
|
||||
@@ -71,7 +71,7 @@ class ColorItem extends StatelessComponent {
|
||||
}
|
||||
}
|
||||
|
||||
class ColorSwatchTabView extends StatelessComponent {
|
||||
class ColorSwatchTabView extends StatelessWidget {
|
||||
ColorSwatchTabView({ Key key, this.swatch }) : super(key: key) {
|
||||
assert(swatch != null && swatch.isValid);
|
||||
}
|
||||
@@ -106,7 +106,7 @@ class ColorSwatchTabView extends StatelessComponent {
|
||||
}
|
||||
}
|
||||
|
||||
class ColorsDemo extends StatelessComponent {
|
||||
class ColorsDemo extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return new TabBarSelection<ColorSwatch>(
|
||||
values: colorSwatches,
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class DatePickerDemo extends StatefulComponent {
|
||||
class DatePickerDemo extends StatefulWidget {
|
||||
_DatePickerDemoState createState() => new _DatePickerDemoState();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ const String _alertWithTitleText =
|
||||
"Let Google help apps determine location. This means sending anyonmous location "
|
||||
"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);
|
||||
|
||||
final IconData icon;
|
||||
@@ -53,7 +53,7 @@ class DialogDemoItem extends StatelessComponent {
|
||||
}
|
||||
}
|
||||
|
||||
class DialogDemo extends StatefulComponent {
|
||||
class DialogDemo extends StatefulWidget {
|
||||
DialogDemoState createState() => new DialogDemoState();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DropDownDemo extends StatefulComponent {
|
||||
class DropDownDemo extends StatefulWidget {
|
||||
_DropDownDemoState createState() => new _DropDownDemoState();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import 'package:vector_math/vector_math_64.dart' as vec;
|
||||
ImageMap _images;
|
||||
SpriteSheet _sprites;
|
||||
|
||||
class FitnessDemo extends StatelessComponent {
|
||||
class FitnessDemo extends StatelessWidget {
|
||||
FitnessDemo({ Key key }) : super(key: key);
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
@@ -26,7 +26,7 @@ class FitnessDemo extends StatelessComponent {
|
||||
}
|
||||
}
|
||||
|
||||
class _FitnessDemoContents extends StatefulComponent {
|
||||
class _FitnessDemoContents extends StatefulWidget {
|
||||
_FitnessDemoContents({ Key key }) : super(key: key);
|
||||
_FitnessDemoContentsState createState() => new _FitnessDemoContentsState();
|
||||
}
|
||||
@@ -510,7 +510,7 @@ class _JumpingJackPart extends Sprite {
|
||||
}
|
||||
}
|
||||
|
||||
class _Fireworks extends StatefulComponent {
|
||||
class _Fireworks extends StatefulWidget {
|
||||
_Fireworks({ Key key }) : super(key: key);
|
||||
|
||||
_FireworksState createState() => new _FireworksState();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class _ContactCategory extends StatelessComponent {
|
||||
class _ContactCategory extends StatelessWidget {
|
||||
_ContactCategory({ Key key, this.icon, this.children }) : super(key: key);
|
||||
|
||||
final IconData icon;
|
||||
@@ -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) {
|
||||
assert(lines.length > 1);
|
||||
}
|
||||
@@ -67,7 +67,7 @@ class _ContactItem extends StatelessComponent {
|
||||
}
|
||||
}
|
||||
|
||||
class FlexibleSpaceDemo extends StatefulComponent {
|
||||
class FlexibleSpaceDemo extends StatefulWidget {
|
||||
FlexibleSpaceDemoState createState() => new FlexibleSpaceDemoState();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ enum DismissDialogAction {
|
||||
save,
|
||||
}
|
||||
|
||||
class DateTimeItem extends StatelessComponent {
|
||||
class DateTimeItem extends StatelessWidget {
|
||||
DateTimeItem({ Key key, DateTime dateTime, this.onChanged })
|
||||
: date = new DateTime(dateTime.year, dateTime.month, dateTime.day),
|
||||
time = new TimeOfDay(hour: dateTime.hour, minute: dateTime.minute),
|
||||
@@ -92,7 +92,7 @@ class DateTimeItem extends StatelessComponent {
|
||||
}
|
||||
}
|
||||
|
||||
class FullScreenDialogDemo extends StatefulComponent {
|
||||
class FullScreenDialogDemo extends StatefulWidget {
|
||||
FullScreenDialogDemoState createState() => new FullScreenDialogDemoState();
|
||||
}
|
||||
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
|
||||
class GridDemoPhotoItem extends StatelessComponent {
|
||||
class GridDemoPhotoItem extends StatelessWidget {
|
||||
GridDemoPhotoItem({ Key key, this.photo, this.tileStyle }) : super(key: key) {
|
||||
assert(photo != null && photo.isValid);
|
||||
assert(tileStyle != null);
|
||||
@@ -128,7 +128,7 @@ class GridListDemoGridDelegate extends FixedColumnCountGridDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
class GridListDemo extends StatefulComponent {
|
||||
class GridListDemo extends StatefulWidget {
|
||||
GridListDemo({ Key key }) : super(key: key);
|
||||
|
||||
GridListDemoState createState() => new GridListDemoState();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class IconsDemo extends StatefulComponent {
|
||||
class IconsDemo extends StatefulWidget {
|
||||
IconsDemoState createState() => new IconsDemoState();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class LeaveBehindItem {
|
||||
final String body;
|
||||
}
|
||||
|
||||
class LeaveBehindDemo extends StatefulComponent {
|
||||
class LeaveBehindDemo extends StatefulWidget {
|
||||
LeaveBehindDemo({ Key key }) : super(key: key);
|
||||
|
||||
LeaveBehindDemoState createState() => new LeaveBehindDemoState();
|
||||
|
||||
@@ -10,7 +10,7 @@ enum ListDemoItemSize {
|
||||
threeLine
|
||||
}
|
||||
|
||||
class ListDemo extends StatefulComponent {
|
||||
class ListDemo extends StatefulWidget {
|
||||
ListDemo({ Key key }) : super(key: key);
|
||||
|
||||
ListDemoState createState() => new ListDemoState();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MenuDemo extends StatefulComponent {
|
||||
class MenuDemo extends StatefulWidget {
|
||||
MenuDemo({ Key key }) : super(key: key);
|
||||
|
||||
MenuDemoState createState() => new MenuDemoState();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ModalBottomSheetDemo extends StatelessComponent {
|
||||
class ModalBottomSheetDemo extends StatelessWidget {
|
||||
final TextStyle textStyle = new TextStyle(
|
||||
color: Colors.indigo[400],
|
||||
fontSize: 24.0,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PageSelectorDemo extends StatelessComponent {
|
||||
class PageSelectorDemo extends StatelessWidget {
|
||||
|
||||
void _handleArrowButtonPress(BuildContext context, int delta) {
|
||||
final TabBarSelectionState<IconData> selection = TabBarSelection.of/*<IconData>*/(context);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PersistentBottomSheetDemo extends StatelessComponent {
|
||||
class PersistentBottomSheetDemo extends StatelessWidget {
|
||||
|
||||
final TextStyle textStyle = new TextStyle(
|
||||
color: Colors.indigo[400],
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ProgressIndicatorDemo extends StatefulComponent {
|
||||
class ProgressIndicatorDemo extends StatefulWidget {
|
||||
_ProgressIndicatorDemoState createState() => new _ProgressIndicatorDemoState();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:flutter/material.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: '' })
|
||||
: super(key: key) {
|
||||
assert(height != null);
|
||||
@@ -74,7 +74,7 @@ class _FlexibleSpaceGraphic extends _BarGraphic {
|
||||
);
|
||||
}
|
||||
|
||||
class _TechniqueItem extends StatelessComponent {
|
||||
class _TechniqueItem extends StatelessWidget {
|
||||
_TechniqueItem({ this.titleText, this.barGraphics, this.builder });
|
||||
|
||||
final String titleText;
|
||||
@@ -110,7 +110,7 @@ const String _introText =
|
||||
"it appears behind the device's status bar. When a flexible space Widget is "
|
||||
"specified it is stacked on top of the ToolBar.";
|
||||
|
||||
class ScrollingTechniquesDemo extends StatelessComponent {
|
||||
class ScrollingTechniquesDemo extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return new Scaffold(
|
||||
toolBar: new ToolBar(center: new Text('Scrolling Techniques')),
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SliderDemo extends StatefulComponent {
|
||||
class SliderDemo extends StatefulWidget {
|
||||
_SliderDemoState createState() => new _SliderDemoState();
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ const String _text2 =
|
||||
const String _text3 =
|
||||
"By default snackbars automatically disappear after a few seconds ";
|
||||
|
||||
class SnackBarDemo extends StatelessComponent {
|
||||
class SnackBarDemo extends StatelessWidget {
|
||||
SnackBarDemo({ Key key }) : super(key: key);
|
||||
|
||||
Widget buildBody(BuildContext context) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TabsDemo extends StatelessComponent {
|
||||
class TabsDemo extends StatelessWidget {
|
||||
final List<IconData> icons = <IconData>[
|
||||
Icons.event,
|
||||
Icons.home,
|
||||
|
||||
@@ -25,7 +25,7 @@ const String _explanatoryText =
|
||||
"with a FloatingActionButton that the Scaffold distinguishes from the others "
|
||||
"by its key.";
|
||||
|
||||
class TabsFabDemo extends StatefulComponent {
|
||||
class TabsFabDemo extends StatefulWidget {
|
||||
_TabsFabDemoState createState() => new _TabsFabDemoState();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TextFieldDemo extends StatefulComponent {
|
||||
class TextFieldDemo extends StatefulWidget {
|
||||
TextFieldDemo({ Key key }) : super(key: key);
|
||||
|
||||
TextFieldDemoState createState() => new TextFieldDemoState();
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TimePickerDemo extends StatefulComponent {
|
||||
class TimePickerDemo extends StatefulWidget {
|
||||
_TimePickerDemoState createState() => new _TimePickerDemoState();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ToggleControlsDemo extends StatefulComponent {
|
||||
class ToggleControlsDemo extends StatefulWidget {
|
||||
_ToggleControlsDemoState createState() => new _ToggleControlsDemoState();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ const String _introText =
|
||||
"a long press. Tooltip messages are also used by services that make Flutter "
|
||||
"apps accessible, like screen readers.";
|
||||
|
||||
class TooltipDemo extends StatelessComponent {
|
||||
class TooltipDemo extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
return new Scaffold(
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TwoLevelListDemo extends StatelessComponent {
|
||||
class TwoLevelListDemo extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return new Scaffold(
|
||||
toolBar: new ToolBar(center: new Text('Expand/Collapse List Control')),
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import 'package:flutter/material.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) {
|
||||
assert(name != null);
|
||||
assert(style != null);
|
||||
@@ -37,7 +37,7 @@ class TextStyleItem extends StatelessComponent {
|
||||
}
|
||||
}
|
||||
|
||||
class TypographyDemo extends StatelessComponent {
|
||||
class TypographyDemo extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final TextTheme textTheme = Theme.of(context).textTheme;
|
||||
final List<Widget> styleItems = <Widget>[
|
||||
|
||||
@@ -17,7 +17,7 @@ enum WeatherType {
|
||||
snow
|
||||
}
|
||||
|
||||
class WeatherDemo extends StatefulComponent {
|
||||
class WeatherDemo extends StatefulWidget {
|
||||
WeatherDemo({ Key key }) : super(key: key);
|
||||
_WeatherDemoState createState() => new _WeatherDemoState();
|
||||
}
|
||||
@@ -125,7 +125,7 @@ class _WeatherDemoState extends State<WeatherDemo> {
|
||||
const double _kWeatherButtonSize = 56.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);
|
||||
|
||||
final String icon;
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import 'home.dart';
|
||||
|
||||
class GalleryApp extends StatefulComponent {
|
||||
class GalleryApp extends StatefulWidget {
|
||||
GalleryApp({ Key key }) : super(key: key);
|
||||
|
||||
static GalleryAppState of(BuildContext context) => context.ancestorStateOfType(const TypeMatcher<GalleryAppState>());
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'app.dart';
|
||||
|
||||
class GalleryDrawer extends StatelessComponent {
|
||||
class GalleryDrawer extends StatelessWidget {
|
||||
GalleryDrawer({ Key key }) : super(key: key);
|
||||
|
||||
void _changeTheme(BuildContext context, bool value) {
|
||||
|
||||
@@ -39,7 +39,7 @@ import '../demo/two_level_list_demo.dart';
|
||||
import '../demo/typography_demo.dart';
|
||||
import '../demo/weather_demo.dart';
|
||||
|
||||
class GalleryHome extends StatefulComponent {
|
||||
class GalleryHome extends StatefulWidget {
|
||||
GalleryHome({ Key key }) : super(key: key);
|
||||
|
||||
GalleryHomeState createState() => new GalleryHomeState();
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'demo.dart';
|
||||
|
||||
class GallerySection extends StatelessComponent {
|
||||
class GallerySection extends StatelessWidget {
|
||||
GallerySection({ this.title, this.image, this.colors, this.demos });
|
||||
|
||||
final String title;
|
||||
|
||||
Reference in New Issue
Block a user