Repository navigation
[RFW] Unable to use customizedErrorWidget.builder in RFW #144960
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.20Found to occur in 3.20Found to occur in 3.20found in release: 3.21Found to occur in 3.21Found to occur in 3.21has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: rfwRemote Flutter Widgets packageRemote Flutter Widgets packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
Description
Steps to reproduce
Override the error widget builder with ErrorWidget.builder.
Expected results
RFW should render the override error widget.
Actual results
RFW still renders the default error widget.
Code sample
Code sample
void main() {
ErrorWidget.builder = (FlutterErrorDetails details) {
// In release builds, show a yellow-on-blue message instead:
return Container(
alignment: Alignment.center,
child: Text(
'Error!\n${details.exception}',
style: const TextStyle(color: Colors.yellow),
textAlign: TextAlign.center,
textDirection: TextDirection.ltr,
),
);
};
runApp(const Example());
}
...
class Example extends StatefulWidget {
const Example({super.key});
@override
State<Example> createState() => _ExampleState();
}
class _ExampleState extends State<Example> {
final Runtime _runtime = Runtime();
final DynamicContent _data = DynamicContent();
static final RemoteWidgetLibrary _remoteWidgets = parseLibraryFile('''
import core.widgets;
widget root = Container(
color: 0xFF002211,
child: Center(
child: Random(text: ["Hello, ", data.name.greet, "!"], textDirection: "ltr"),
),
);
''');
static const LibraryName coreName = LibraryName(<String>['core', 'widgets']);
static const LibraryName mainName = LibraryName(<String>['main']);
@override
void initState() {
super.initState();
_runtime.update(coreName, createCoreWidgets());
_runtime.update(mainName, _remoteWidgets);
_data.update('greet', <String, Object>{'name': 'World'});
}
@override
Widget build(BuildContext context) {
return RemoteWidget(
runtime: _runtime,
data: _data,
widget: const FullyQualifiedWidgetName(mainName, 'root'),
onEvent: (String name, DynamicMap arguments) {
debugPrint('user triggered event "$name" with data: $arguments');
},
);
}
}
Screenshots or Video
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[Paste your output here]Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.20Found to occur in 3.20Found to occur in 3.20found in release: 3.21Found to occur in 3.21Found to occur in 3.21has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: rfwRemote Flutter Widgets packageRemote Flutter Widgets packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team

Activity
[-][RFW] Unable to used customized`ErrorWidget.builder` in RFW[/-][+][RFW] Unable to use customized`ErrorWidget.builder` in RFW[/+]danagbemava-nc commentedon Mar 12, 2024
Reproducible using the code sample provided above.
flutter doctor -v
ebwood commentedon Mar 12, 2024
rfw directly build ErrorWidget when error occurs, not like flutter use ErrorWidget.builder.
stuartmorgan-g commentedon Mar 12, 2024
/cc @Hixie
Support overriding `ErrorWidget.builder` (#6302)
danagbemava-nc commentedon Mar 14, 2024
Closing this since flutter/packages#6302 has been merged.
github-actions commentedon Mar 28, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.