-
Notifications
You must be signed in to change notification settings - Fork 227
Open
Labels
Description
The loadLibrary() async call used with a deferred import never finishes in a fake async environment.
This requires complicated workarounds to avoid deferred imports deep in the tested code.
Here is a reproducer:
import 'package:flutter_localizations/flutter_localizations.dart'
deferred as loc;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('deferred should work in widget tests', (
WidgetTester tester,
) async {
// This call never finishes.
await loc.loadLibrary();
// Just verify that we can access something from the library.
expect(loc.kCupertinoSupportedLanguages, isNotEmpty);
});
}% flutter --version
Flutter 3.35.7 • channel stable • https://github.com/flutter/flutter.git
Framework • revision adc9010625 (9 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
Reactions are currently unavailable