@@ -364,6 +364,8 @@ class $State$bridge<T extends StatefulWidget> extends State<T> with $Bridge<Stat
364
364
])),
365
365
'initState' : BridgeMethodDef (
366
366
BridgeFunctionDef (returns: BridgeTypeAnnotation (BridgeTypeRef .type (RuntimeTypes .voidType)))),
367
+ 'dispose' : BridgeMethodDef (
368
+ BridgeFunctionDef (returns: BridgeTypeAnnotation (BridgeTypeRef .type (RuntimeTypes .voidType)))),
367
369
'build' : BridgeMethodDef (BridgeFunctionDef (
368
370
returns: BridgeTypeAnnotation ($Widget .$type),
369
371
params: [BridgeParameter ('context' , BridgeTypeAnnotation ($BuildContext .$type), false )])),
@@ -394,6 +396,11 @@ class $State$bridge<T extends StatefulWidget> extends State<T> with $Bridge<Stat
394
396
super .initState ();
395
397
return null ;
396
398
});
399
+ case 'dispose' :
400
+ return $Function ((runtime, target, args) {
401
+ super .dispose ();
402
+ return null ;
403
+ });
397
404
case 'widget' :
398
405
if (super .widget is $Instance ) {
399
406
return super .widget as $Instance ;
@@ -413,6 +420,10 @@ class $State$bridge<T extends StatefulWidget> extends State<T> with $Bridge<Stat
413
420
// ignore: must_call_super
414
421
void initState () => $_invoke ('initState' , []);
415
422
423
+ @override
424
+ // ignore: must_call_super
425
+ void dispose () => $_invoke ('dispose' , []);
426
+
416
427
@override
417
428
Widget build (BuildContext context) => $_invoke ('build' , [$BuildContext .wrap (context)]);
418
429
0 commit comments