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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user