-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Closed
Labels
t: hot reloadReloading code during "flutter run"Reloading code during "flutter run"toolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
- Create a new app
- Replace
main.dartwith:
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title: new Text('Hot reload test'),
),
body: new Center(child: new Text('Foo')),
),
);
}
}
- Add a new member to MyApp:
class MyApp extends StatelessWidget {
var foo = 'foo';
@override
...
}
- Hot reload
=> get a warning that the new member wasn't reloaded?
Some program elements were changed during reload but did not run when the view was reassembled;
you may need to restart the app for the changes to have an effect.
• MyApp.foo (lib/main.dart:6)
• MyApp.foo= (lib/main.dart:6)
Metadata
Metadata
Assignees
Labels
t: hot reloadReloading code during "flutter run"Reloading code during "flutter run"toolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.