1
0
mirror of https://github.com/flutter/samples.git synced 2026-05-19 21:46:29 +00:00

veggieseasons: Migrate to null safety (#922)

This commit is contained in:
Brett Morgan
2021-10-12 10:27:54 +11:00
committed by GitHub
parent 994cdb4afa
commit ac2bef7d83
21 changed files with 134 additions and 148 deletions

View File

@@ -26,7 +26,7 @@ void main() {
}
class VeggieApp extends StatefulWidget {
const VeggieApp({Key key}) : super(key: key);
const VeggieApp({Key? key}) : super(key: key);
@override
State<StatefulWidget> createState() => _VeggieAppState();
@@ -39,7 +39,7 @@ class _VeggieAppState extends State<VeggieApp> with RestorationMixin {
String get restorationId => 'wrapper';
@override
void restoreState(RestorationBucket oldBucket, bool initialRestore) {
void restoreState(RestorationBucket? oldBucket, bool initialRestore) {
registerForRestoration(_appState, 'state');
}
@@ -77,7 +77,7 @@ class _RestorableAppState extends RestorableListenable<AppState> {
}
@override
AppState fromPrimitives(Object data) {
AppState fromPrimitives(Object? data) {
final appState = AppState();
final favorites = (data as List<dynamic>).cast<int>();
for (var id in favorites) {