-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.front-end-serverIssues with the frontend serverIssues with the frontend serverweb-dev-compilerweb-hot-reloadIssues related to stateful hot reload on the webIssues related to stateful hot reload on the web
Description
Steps to reproduce
- Create a sample app with
flutter create --platforms=web sample - Create the source files and update main.dart as per code sample below
- Debug the app in VSCode
- Modify the sample class and sample mixin with changes
Observed::
- Changes to the returned value from
fromMixinare not reflected in the app, unless you later save thesample_class.dartfile too - Changes to
fromClasswork as expected - Changes to the properties
messageClassandmessageMixinare never reflected.
Code sample
Create lib\sample_mixin.dart:
mixin SampleMixin {
String messageMixin = "SampleMixin";
String fromMixin() {
return "From mixin";
}
}
Create lib\sample_class.dart
import 'sample_mixin.dart';
class SampleClass with SampleMixin {
String messageClass = "SampleClass";
String fromClass() {
return "From class";
}
}
Replace all of main.dart with the following:
import 'package:flutter/material.dart';
import 'sample_class.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final messages = SampleClass();
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("Class method: ${messages.fromClass()}"),
Text("Mixin method: ${messages.fromMixin()}"),
Text("Class property: ${messages.messageClass}"),
Text("Mixin property: ${messages.messageMixin}"),
],
),
),
);
}
}
Flutter version
Flutter 3.35.7 • channel stable • https://github.com/flutter/flutter.git
Framework • revision adc9010625 (8 days ago) • 2025-10-21 14:16:03 -0400
Engine • hash 6b24e1b529bc46df7ff397667502719a2a8b6b72 (revision 035316565a) (8 days ago) • 2025-10-21 14:28:01.000Z
Tools • Dart 3.9.2 • DevTools 2.48.0
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.front-end-serverIssues with the frontend serverIssues with the frontend serverweb-dev-compilerweb-hot-reloadIssues related to stateful hot reload on the webIssues related to stateful hot reload on the web
Type
Projects
Status
No status