I'm encountering the following error often, though it's inconsistent and I can't figure out why. I'm using tester as instructed for Flutter Integration tests.
Test Code:
testWidgets('should create and save simulation', (tester) async {
await startApp(tester, app);
await login(tester);
await navigateTo(NavPage.SIMULATOR, tester);
String scenarioName = "CreateAndSaveScenario";
await createScenario(scenarioName, tester);
expect(find.text("CRQ Simulator"), findsWidgets);
expect(find.text("Edit Scenario"), findsWidgets);
expect(find.text(scenarioName), findsWidgets);
Finder fairSwitchFinder = find.byType(Switch);
tester.tap(fairSwitchFinder);
await navigateTo(NavPage.SIMULATOR, tester);
expect(find.byType(ListTile), findsOneWidget);
expect(find.text(scenarioName), findsOneWidget);
});
Error:
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═════════════════
The following assertion was thrown running a test:
Assertion failed:
file:///C:/Users/jared/dev/flutter/packages/flutter_test/lib/src/test_async_utils.dart:315:14
lineMatch != null
is not true
When the exception was thrown, this was the stack:
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49 throw_
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 29:3 assertFailed
packages/flutter_test/src/test_async_utils.dart 315:23 _findResponsibleMethod
packages/flutter_test/src/test_async_utils.dart 198:42 guardSync
packages/flutter_test/src/widget_tester.dart 459:18 expect$
views/simulator/crq_simulator_test.dart 37:7 <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50 <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1399:47 _rootRunUnary
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1300:19 runUnary
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 147:18 handleValue
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 766:44 handleValueCallback
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 795:13 _propagateToListeners
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 566:5 [_completeWithValue]
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 639:7 <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1391:13 _rootRun
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1293:19 run
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1201:7 runGuarded
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1241:23 callback
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15 <fn>
The test description was:
should create and save simulation
═════════════════════════════════════════════════════════════════
end of failure 1
I was expecting the tester to navigate, but after the fairSwitchFinder tap, it seems to not be able to do anything because the lineMatch is null? The error is not very descriptive
Okay, I figured this out fairly quickly afterward. Surprised there weren't any answers up, but hopefully this question shows up in searches now.
I was missing an await.
I changed
tester.tap(fairSwitchFinder); to await tester.tap(fairSwitchFinder); and it fixed it.
Related
I've debugged the issue and came to a problem in the audio_service.dart at line 969. In this line the the File object has been used from dart.io library which is not supported in the Flutter web. Am I using the library in a wrong way or is this a bug?
Error: Unsupported operation: _Namespace
dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49 throw
dart-sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart 200:5 get _namespace
dart-sdk/lib/io/file_impl.dart 376:45 lengthSync
packages/audio_service/audio_service.dart 969:30 _observeMediaItem
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50
dart-sdk/lib/async/zone.dart 1653:54 runUnary
dart-sdk/lib/async/future_impl.dart 147:18 handleValue
dart-sdk/lib/async/future_impl.dart 766:44 handleValueCallback
dart-sdk/lib/async/future_impl.dart 795:13 _propagateToListeners
dart-sdk/lib/async/future_impl.dart 557:7 [_complete]
dart-sdk/lib/async/stream_pipe.dart 61:11 _cancelAndValue
dart-sdk/lib/async/stream.dart 1718:11
dart-sdk/lib/async/stream_pipe.dart 11:14 _runUserCode
dart-sdk/lib/async/stream.dart 1716:7
dart-sdk/lib/async/zone.dart 1586:10 runUnaryGuarded
dart-sdk/lib/async/stream_impl.dart 339:11 [_sendData]
dart-sdk/lib/async/stream_impl.dart 515:13 perform
dart-sdk/lib/async/stream_impl.dart 620:10 handleNext
dart-sdk/lib/async/stream_impl.dart 591:7 callback
dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15
Running the "How to test a Flutter app" codelab on non-web devices works fine, but is showing errors when running on WEB.
Codelab: https://codelabs.developers.google.com/codelabs/flutter-app-testing#5
The error message I get when running Step 6: Widget testing's flutter run test/home_test.dart command on Chrome device:
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK
╞════════════════════════════════════════════════════
The following assertion was thrown running a test:
Assertion failed:
file:///Users/imanonion/fluttertest/flutter/packages/flutter_test/lib/src/binding.dart:1299:12
!timersPending
"A Timer is still pending even after the widget tree was disposed."
Somehow, the binding.dart file cannot be found in my file directory...
Any idea why the widget test doesn't run the same way on web/chrome? How can I rectify the error?
Full terminal output:
Multiple devices found:
macOS (desktop) • macos • darwin-arm64 • macOS 12.6 21G115 darwin-arm
Chrome (web) • chrome • web-javascript • Google Chrome 107.0.5304.121
[1]: macOS (macos)
[2]: Chrome (chrome)
Please choose one (To quit, press "q/Q"): 2
Launching test/home_test.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome... 11.1s
This app is linked to the debug service: ws://127.0.0.1:53728/ZI4uGNSPrGg=/ws
Debug service listening on ws://127.0.0.1:53728/ZI4uGNSPrGg=/ws
💪 Running with sound null safety 💪
🔥 To hot restart changes while running, press "r" or "R".
For a more detailed help message, press "h". To quit, press "q".
An Observatory debugger and profiler on Chrome is available at:
http://127.0.0.1:53728/ZI4uGNSPrGg=
Flutter Web Bootstrap: Programmatic
00:00 +0: Home Page Widget Tests Testing if ListView shows up
Pending timers:
Timer (duration: 0:00:00.000000, periodic: false), created:
packages/fake_async/fake_async.dart 308:62 __
packages/fake_async/fake_async.dart 252:27 [_createTimer]
packages/fake_async/fake_async.dart 185:19 <fn>
dart-sdk/lib/async/zone.dart 1353:19 createTimer
dart-sdk/lib/async/timer.dart 54:10 new
dart-sdk/lib/async/future.dart 419:9 delayed
lib/_engine/engine/platform_dispatcher.dart 1136:41
replyToPlatformMessage
lib/_engine/engine/platform_dispatcher.dart 472:13
[_sendPlatformMessage]
lib/_engine/engine/platform_dispatcher.dart 325:5
sendPlatformMessage
packages/flutter/src/services/binding.dart 364:36 send
packages/flutter_test/src/test_default_binary_messenger.dart 139:31 send
packages/flutter/src/services/platform_channel.dart 289:31 _invokeMethod
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async
packages/flutter/src/services/platform_channel.dart 283:30 [_invokeMethod]
packages/flutter/src/services/platform_channel.dart 567:3 [_invokeMethod]
packages/flutter/src/services/platform_channel.dart 566:18 invokeMethod
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async
packages/flutter/src/services/platform_channel.dart 565:29 invokeMethod
packages/flutter/src/services/system_chrome.dart 394:35
setApplicationSwitcherDescription
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async
packages/flutter/src/services/system_chrome.dart 393:56
setApplicationSwitcherDescription
packages/flutter/src/widgets/title.dart 42:18 build
packages/flutter/src/widgets/framework.dart 4949:22 build
...
packages/flutter/src/widgets/framework.dart 4904:16 performRebuild
packages/provider/src/inherited_provider.dart 456:11 performRebuild
packages/flutter/src/widgets/framework.dart 4604:5 rebuild
packages/flutter/src/widgets/framework.dart 4859:5 [_firstBuild]
packages/flutter/src/widgets/framework.dart 4853:5 mount
packages/provider/src/inherited_provider.dart 356:11 mount
packages/flutter/src/widgets/framework.dart 3863:15 inflateWidget
packages/flutter/src/widgets/framework.dart 3592:18 updateChild
packages/flutter/src/widgets/framework.dart 4904:16 performRebuild
packages/flutter/src/widgets/framework.dart 4604:5 rebuild
packages/flutter/src/widgets/framework.dart 4859:5 [_firstBuild]
packages/flutter/src/widgets/framework.dart 4853:5 mount
packages/nested/nested.dart 222:11 mount
packages/flutter/src/widgets/framework.dart 3863:15 inflateWidget
packages/flutter/src/widgets/framework.dart 3586:20 updateChild
packages/flutter/src/widgets/binding.dart 1195:16 [_rebuild]
packages/flutter/src/widgets/binding.dart 1172:5 update
packages/flutter/src/widgets/binding.dart 1186:7 performRebuild
packages/flutter/src/widgets/framework.dart 4604:5 rebuild
packages/flutter/src/widgets/framework.dart 2667:18 buildScope
packages/flutter_test/src/binding.dart 1191:7 drawFrame
packages/flutter/src/rendering/binding.dart 378:5
[_handlePersistentFrameCallback]
packages/flutter/src/scheduler/binding.dart 1175:15
[_invokeFrameCallback]
packages/flutter/src/scheduler/binding.dart 1104:9 handleDrawFrame
packages/flutter_test/src/binding.dart 1057:9 <fn>
dart-sdk/lib/async/zone.dart 1391:13 _rootRun
dart-sdk/lib/async/zone.dart 1293:19 run
packages/flutter_test/src/test_async_utils.dart 71:35 guard
packages/flutter_test/src/binding.dart 1043:27 pump
packages/flutter_test/src/widget_tester.dart 554:22 <fn>
dart-sdk/lib/async/zone.dart 1391:13 _rootRun
dart-sdk/lib/async/zone.dart 1293:19 run
packages/flutter_test/src/test_async_utils.dart 71:35 guard
packages/flutter_test/src/widget_tester.dart 551:27 pumpWidget
home_test.dart 18:19 <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async
home_test.dart 17:50 <fn>
packages/flutter_test/src/widget_tester.dart 171:29 <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50 <fn>
dart-sdk/lib/async/zone.dart 1399:47 _rootRunUnary
dart-sdk/lib/async/zone.dart 1300:19 runUnary
dart-sdk/lib/async/future_impl.dart 147:18 handleValue
dart-sdk/lib/async/future_impl.dart 766:44
handleValueCallback
dart-sdk/lib/async/future_impl.dart 795:13
_propagateToListeners
dart-sdk/lib/async/future_impl.dart 566:5
[_completeWithValue]
dart-sdk/lib/async/future_impl.dart 639:7 <fn>
packages/fake_async/fake_async.dart 197:32 flushMicrotasks
packages/flutter_test/src/binding.dart 1264:16 <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async
packages/flutter_test/src/binding.dart 1251:35 <fn>
dart-sdk/lib/async/future.dart 277:37 <fn>
dart-sdk/lib/async/zone.dart 1383:47 _rootRun
dart-sdk/lib/async/zone.dart 1293:19 run
dart-sdk/lib/async/zone.dart 1201:7 runGuarded
dart-sdk/lib/async/zone.dart 1241:23 <fn>
dart-sdk/lib/async/zone.dart 1391:13 _rootRun
dart-sdk/lib/async/zone.dart 1293:19 run
dart-sdk/lib/async/zone.dart 1201:7 runGuarded
dart-sdk/lib/async/zone.dart 1241:23 callback
dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5
_startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15 <fn>
Timer (duration: 0:00:00.000000, periodic: false), created:
packages/fake_async/fake_async.dart 308:62 __
packages/fake_async/fake_async.dart 252:27 [_createTimer]
packages/fake_async/fake_async.dart 185:19 <fn>
dart-sdk/lib/async/zone.dart 1353:19 createTimer
dart-sdk/lib/async/timer.dart 54:10 new
dart-sdk/lib/async/future.dart 419:9 delayed
lib/_engine/engine/platform_dispatcher.dart 1136:41
replyToPlatformMessage
lib/_engine/engine/platform_dispatcher.dart 568:5
[_sendPlatformMessage]
lib/_engine/engine/platform_dispatcher.dart 325:5
sendPlatformMessage
packages/flutter/src/services/binding.dart 364:36 send
packages/flutter_test/src/test_default_binary_messenger.dart 139:31 send
packages/flutter/src/services/platform_channel.dart 289:31 _invokeMethod
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async
packages/flutter/src/services/platform_channel.dart 283:30 [_invokeMethod]
packages/flutter/src/services/platform_channel.dart 567:3 [_invokeMethod]
packages/flutter/src/services/platform_channel.dart 566:18 invokeMethod
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async
packages/flutter/src/services/platform_channel.dart 565:29 invokeMethod
packages/flutter/src/services/system_chrome.dart 589:33 <fn>
dart-sdk/lib/async/zone.dart 1383:47 _rootRun
dart-sdk/lib/async/zone.dart 1293:19 run
dart-sdk/lib/async/zone.dart 1201:7 runGuarded
dart-sdk/lib/async/zone.dart 1241:23 <fn>
packages/fake_async/fake_async.dart 197:32 flushMicrotasks
packages/flutter_test/src/binding.dart 1059:7 <fn>
dart-sdk/lib/async/zone.dart 1391:13 _rootRun
dart-sdk/lib/async/zone.dart 1293:19 run
packages/flutter_test/src/test_async_utils.dart 71:35 guard
packages/flutter_test/src/binding.dart 1043:27 pump
packages/flutter_test/src/widget_tester.dart 554:22 <fn>
dart-sdk/lib/async/zone.dart 1391:13 _rootRun
dart-sdk/lib/async/zone.dart 1293:19 run
packages/flutter_test/src/test_async_utils.dart 71:35 guard
packages/flutter_test/src/widget_tester.dart 551:27 pumpWidget
home_test.dart 18:19 <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async
home_test.dart 17:50 <fn>
packages/flutter_test/src/widget_tester.dart 171:29 <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50 <fn>
dart-sdk/lib/async/zone.dart 1399:47 _rootRunUnary
dart-sdk/lib/async/zone.dart 1300:19 runUnary
dart-sdk/lib/async/future_impl.dart 147:18 handleValue
dart-sdk/lib/async/future_impl.dart 766:44
handleValueCallback
dart-sdk/lib/async/future_impl.dart 795:13
_propagateToListeners
dart-sdk/lib/async/future_impl.dart 566:5
[_completeWithValue]
dart-sdk/lib/async/future_impl.dart 639:7 <fn>
packages/fake_async/fake_async.dart 197:32 flushMicrotasks
packages/flutter_test/src/binding.dart 1264:16 <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async
packages/flutter_test/src/binding.dart 1251:35 <fn>
dart-sdk/lib/async/future.dart 277:37 <fn>
dart-sdk/lib/async/zone.dart 1383:47 _rootRun
dart-sdk/lib/async/zone.dart 1293:19 run
dart-sdk/lib/async/zone.dart 1201:7 runGuarded
dart-sdk/lib/async/zone.dart 1241:23 <fn>
dart-sdk/lib/async/zone.dart 1391:13 _rootRun
dart-sdk/lib/async/zone.dart 1293:19 run
dart-sdk/lib/async/zone.dart 1201:7 runGuarded
dart-sdk/lib/async/zone.dart 1241:23 callback
dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5
_startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15 <fn>
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK
╞════════════════════════════════════════════════════
The following assertion was thrown running a test:
Assertion failed:
file:///Users/imanonion/fluttertest/flutter/packages/flutter_test/lib/src/binding.da
rt:1299:12
!timersPending
"A Timer is still pending even after the widget tree was disposed."
When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49 throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 29:3
assertFailed
packages/flutter_test/src/binding.dart 1299:26
[_verifyInvariants]
packages/flutter_test/src/binding.dart 857:7
_runTestBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50 <fn>
dart-sdk/lib/async/zone.dart 1399:47
_rootRunUnary
dart-sdk/lib/async/zone.dart 1300:19
runUnary
dart-sdk/lib/async/future_impl.dart 147:18
handleValue
dart-sdk/lib/async/future_impl.dart 766:44
handleValueCallback
dart-sdk/lib/async/future_impl.dart 795:13
_propagateToListeners
dart-sdk/lib/async/future_impl.dart 566:5
[_completeWithValue]
dart-sdk/lib/async/future_impl.dart 639:7 <fn>
packages/fake_async/fake_async.dart 197:32
flushMicrotasks
packages/flutter_test/src/binding.dart 1264:16 <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54
runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async
packages/flutter_test/src/binding.dart 1251:35 <fn>
dart-sdk/lib/async/future.dart 277:37 <fn>
dart-sdk/lib/async/zone.dart 1383:47
_rootRun
dart-sdk/lib/async/zone.dart 1293:19 run
dart-sdk/lib/async/zone.dart 1201:7
runGuarded
dart-sdk/lib/async/zone.dart 1241:23 <fn>
dart-sdk/lib/async/zone.dart 1391:13
_rootRun
dart-sdk/lib/async/zone.dart 1293:19 run
dart-sdk/lib/async/zone.dart 1201:7
runGuarded
dart-sdk/lib/async/zone.dart 1241:23
callback
dart-sdk/lib/async/schedule_microtask.dart 40:11
_microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5
_startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15 <fn>
The test description was:
Testing if ListView shows up
════════════════════════════════════════════════════════════════════════════════════
════════════════
00:00 +0: Home Page Widget Tests Testing if ListView shows up [E]
Test failed. See exception logs above.
The test description was: Testing if ListView shows up
00:00 +0 -1: Home Page Widget Tests Testing Scrolling
00:00 +1 -1: Home Page Widget Tests Testing IconButtons
00:01 +2 -1: Some tests failed.
The Flutter DevTools debugger and profiler on Chrome is available at:
http://127.0.0.1:9102?uri=http://127.0.0.1:53728/ZI4uGNSPrGg=
Thank you in advance! :)
Goodmorning, I'm trying to use keycloak and flutter but unfortunally when i ask the token to keycloak he gives me an XMLHttpRequestError. I use thos method to ask:
Future<String> makeTokenRequest(String url,Map<String,String>params) async {
try {
print("arrivato in _restManager");
await post(url, body: params).then((result) {
print(result.toString());
});
}catch(e){
throw e;
}
}
Future<String> getToken(String email,String password) async {
try{
Map<String,String> params=Map();
params["grant_type"]="password";
params["client_id"]="myclient";
params["client_secret"]="6be8e24b-9c81-482e-99ac-05ed154e572e";
params["username"]="cappuccio";
params["password"]="franco";
String result=await _restManager.makeTokenRequest("http://localhost:8080/auth/realms/PiattaformaPrenotazioni/protocol/openid-connect/token",params);
}catch(e){
throw e;
}
}
those two methods are just toys that i'm using to learn, i know that probably they aren't the best way. I read that if i don't specify anything post method will use urlencoded and with a Map<String,String> body he will encode it right.
The Error i get is this:
Error: XMLHttpRequest error.
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 909:28 get current
packages/http/src/browser_client.dart 84:22 <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1613:54 runUnary
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 155:18 handleValue
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 707:44 handleValueCallback
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 736:13 _propagateToListeners
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 533:7 [_complete]
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/stream_pipe.dart 61:11 _cancelAndValue
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/stream.dart 1219:7 <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 324:14 _checkAndCall
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 329:39 dcall
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/html/dart2js/html_dart2js.dart 37307:58 <fn>
at Object.createErrorWithStack (http://localhost:57146/dart_sdk.js:5362:12)
at Object._rethrow (http://localhost:57146/dart_sdk.js:39548:16)
at async._AsyncCallbackEntry.new.callback (http://localhost:57146/dart_sdk.js:39542:13)
at Object._microtaskLoop (http://localhost:57146/dart_sdk.js:39374:13)
at _startMicrotaskLoop (http://localhost:57146/dart_sdk.js:39380:13)
at http://localhost:57146/dart_sdk.js:34887:9
arrivato in _restManager
errore in restManager
errore in SharedInstance
Error: XMLHttpRequest error.
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 909:28 get current
packages/http/src/browser_client.dart 84:22 <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1613:54 runUnary
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 155:18 handleValue
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 707:44 handleValueCallback
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 736:13 _propagateToListeners
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 533:7 [_complete]
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/stream_pipe.dart 61:11 _cancelAndValue
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/stream.dart 1219:7 <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 324:14 _checkAndCall
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 329:39 dcall
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/html/dart2js/html_dart2js.dart 37307:58 <fn>
at Object.createErrorWithStack (http://localhost:57146/dart_sdk.js:5362:12)
at Object._rethrow (http://localhost:57146/dart_sdk.js:39548:16)
at async._AsyncCallbackEntry.new.callback (http://localhost:57146/dart_sdk.js:39542:13)
at Object._microtaskLoop (http://localhost:57146/dart_sdk.js:39374:13)
at _startMicrotaskLoop (http://localhost:57146/dart_sdk.js:39380:13)
at http://localhost:57146/dart_sdk.js:34887:9
I had the same problems, I resolved it setting * in keycloak/your client/Valid redirect URIs
I would like to know if it is possible to load data in memory from a file stored in firebase storage?
My goal is to open the file and show the data in the browser, without downloading it to the computer. Firebase is configured correctly in my project, I can upload and get URL.
I tried using the command below, but I get an error:
await FirebaseStorage.instance
.ref()
.child(TabelaIbptConsts.PATH_TABELAS)
.child('MG.csv')
.getData()
.then((value) => print(value));
I get the error below:
Error: XMLHttpRequest error.
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 909:28 get current
packages/http/src/browser_client.dart 71:22 <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1613:54 runUnary
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 155:18 handleValue
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 707:44 handleValueCallback
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 736:13 _propagateToListeners
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 533:7 [_complete]
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/stream_pipe.dart 61:11 _cancelAndValue
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/stream.dart 1219:7 <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 324:14 _checkAndCall
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 329:39 dcall
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/html/dart2js/html_dart2js.dart 37307:58 <fn>
at Object.createErrorWithStack (http://localhost:63639/dart_sdk.js:5054:12)
at Object._rethrow (http://localhost:63639/dart_sdk.js:37670:16)
at async._AsyncCallbackEntry.new.callback (http://localhost:63639/dart_sdk.js:37666:13)
at Object._microtaskLoop (http://localhost:63639/dart_sdk.js:37526:13)
at _startMicrotaskLoop (http://localhost:63639/dart_sdk.js:37532:13)
at http://localhost:63639/dart_sdk.js:33303:9
Any help would be appreciated! If can't solve for Dio, what other packages is recommended for Flutter Web to do a POST (I need to be able to add followRedirect=false so the basic http package is out). Thanks!!
var resp = await Dio().post("xyz.com:1001/login", data: {"user": email, "pass" : pwd})
Get
Error: Sorry, please contact support: DioError [DioErrorType.DEFAULT]: RangeError (index): Index out of range: index should be less than 1: 1
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 236:49 throw_
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/js_array.dart 581:7 _get]
packages/dio/src/options.dart 301:29 get uri
packages/dio/src/adapters/browser_adapter.dart 30:37 <fn>
packages/dio/src/adapters/browser_adapter.dart 32:63 fetch
packages/dio/src/dio.dart 922:46 _dispatchRequest
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50 <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1612:54 runUnary
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 152:18 handleValue
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 704:44 handleValueCallback
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 733:13 _propagateToListeners
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 539:5 [_completeWithValue]
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 577:7 callback
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15 <fn>
at Object.throw_ [as throw] (http://localhost:56880/dart_sdk.js:5331:11)
at throwError (http://localhost:56880/packages/webcargo_mobile/user/login.dart.lib.js:818:15)
at _RootZone.runUnary (http://localhost:56880/dart_sdk.js:38886:58)
at _FutureListener.catchError.handleError (http://localhost:56880/dart_sdk.js:33886:48)
at handleError (http://localhost:56880/dart_sdk.js:34448:51)
at Function._propagateToListeners (http://localhost:56880/dart_sdk.js:34474:17)
at _Future.new.[_completeError] (http://localhost:56880/dart_sdk.js:34320:23)
at _SyncCompleter.new.[_completeError] (http://localhost:56880/dart_sdk.js:33803:36)
at _SyncCompleter.new.completeError (http://localhost:56880/dart_sdk.js:33726:29)
at onError (http://localhost:56880/dart_sdk.js:33571:60)
at _RootZone.runBinary (http://localhost:56880/dart_sdk.js:38891:58)
at _FutureListener.then.handleError (http://localhost:56880/dart_sdk.js:33884:48)
at handleError (http://localhost:56880/dart_sdk.js:34448:51)
at Function._propagateToListeners (http://localhost:56880/dart_sdk.js:34474:17)
at _Future.new.[_completeWithValue] (http://localhost:56880/dart_sdk.js:34312:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:56880/dart_sdk.js:34335:35)
at Object._microtaskLoop (http://localhost:56880/dart_sdk.js:39173:13)
at _startMicrotaskLoop (http://localhost:56880/dart_sdk.js:39179:13)
at http://localhost:56880/dart_sdk.js:34686:9
Your URL is missing a scheme eg: http://
So try adding a scheme like http://example.com/login