Remove BuildContext argument to initState

This argument isn't needed anymore now that State has a getter for context.
This commit is contained in:
Adam Barth
2015-09-30 13:15:46 -07:00
parent 01f7c8460f
commit 347bd25cb4
31 changed files with 62 additions and 70 deletions

View File

@@ -54,8 +54,8 @@ class MineDiggerState extends State<MineDigger> {
// |uiState| keeps track of the visible player progess.
List<List<CellState>> uiState;
void initState(BuildContext context) {
super.initState(context);
void initState() {
super.initState();
resetGame();
}

View File

@@ -34,8 +34,8 @@ class StocksAppState extends State<StocksApp> {
final Map<String, Stock> _stocks = <String, Stock>{};
final List<String> _symbols = <String>[];
void initState(BuildContext context) {
super.initState(context);
void initState() {
super.initState();
new StockDataFetcher((StockData data) {
setState(() {
data.appendTo(_stocks, _symbols);

View File

@@ -65,8 +65,8 @@ class CardCollectionAppState extends State<CardCollectionApp> {
_initVariableSizedCardModels();
}
void initState(BuildContext context) {
super.initState(context);
void initState() {
super.initState();
_initCardModels();
}
@@ -264,7 +264,6 @@ class CardCollectionAppState extends State<CardCollectionApp> {
})
.toList();
double offset;
for (int i = 0; i < cumulativeHeights.length; i++) {
if (cumulativeHeights[i] >= scrollOffset)
return 12.0 + (margins + _cardModels[i].height) / 2.0 + ((i == 0) ? 0.0 : cumulativeHeights[i - 1]);

View File

@@ -12,8 +12,8 @@ class DatePickerDemo extends StatefulComponent {
}
class DatePickerDemoState extends State<DatePickerDemo> {
void initState(BuildContext context) {
super.initState(context);
void initState() {
super.initState();
DateTime now = new DateTime.now();
_dateTime = new DateTime(now.year, now.month, now.day);
}

View File

@@ -21,8 +21,8 @@ class PageableListApp extends StatefulComponent {
}
class PageableListAppState extends State<PageableListApp> {
void initState(BuildContext context) {
super.initState(context);
void initState() {
super.initState();
List<Size> cardSizes = [
[100.0, 300.0], [300.0, 100.0], [200.0, 400.0], [400.0, 400.0], [300.0, 400.0]
]

View File

@@ -11,8 +11,8 @@ class ProgressIndicatorApp extends StatefulComponent {
}
class ProgressIndicatorAppState extends State<ProgressIndicatorApp> {
void initState(BuildContext context) {
super.initState(context);
void initState() {
super.initState();
valueAnimation = new ValueAnimation<double>()
..duration = const Duration(milliseconds: 1500)
..variable = new AnimatedValue<double>(

View File

@@ -11,8 +11,8 @@ class ScaleApp extends StatefulComponent {
}
class ScaleAppState extends State<ScaleApp> {
void initState(BuildContext context) {
super.initState(context);
void initState() {
super.initState();
_offset = Offset.zero;
_zoom = 1.0;
}

View File

@@ -11,8 +11,8 @@ class StyledTextApp extends StatefulComponent {
}
class StyledTextAppState extends State<StyledTextApp> {
void initState(BuildContext context) {
super.initState(context);
void initState() {
super.initState();
toText = toStyledText;
nameLines = dialogText
.split('\n')