Skip to content

Hot reload warning when adding new members #13794

@mit-mit

Description

@mit-mit
  1. Create a new app
  2. Replace main.dart with:
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')),
      ),
    );
  }
}
  1. Add a new member to MyApp:
class MyApp extends StatelessWidget {
  var foo = 'foo';
  @override
  ...
}
  1. 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

No one assigned

    Labels

    t: hot reloadReloading code during "flutter run"toolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions