You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[!] Flutter (Channel unknown, 3.10.5, on Microsoft Windows [Version 10.0.19045.3570], locale en-US)
! Flutter version 3.10.5 on channel unknown at C:\src\flutter
Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install. ! Unknown upstream repository. Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install. • Framework revision 796c8ef792 (5 months ago), 2023-06-13 15:51:02 -0700 • Engine revision 45f6e00911 • Dart version 3.0.5 • DevTools version 2.23.1 • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.[√] Windows Version (Installed version of Windows is version 10 or higher)[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1) • Android SDK at C:\Users\NikitaWork\AppData\Local\Android\sdk • Platform android-33-ext4, build-tools 33.0.1 • Java binary at: C:\Program Files\Java\jdk-11.0.17\bin\java • Java version Java(TM) SE Runtime Environment 18.9 (build 11.0.17+10-LTS-269) • All Android licenses accepted.[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.[X] Visual Studio - develop for Windows X Visual Studio not installed; this is necessary for Windows development. Download at https://visualstudio.microsoft.com/downloads/. Please install the "Desktop development with C++" workload, including all of its default components[!] Android Studio (version 2022.3) • Android Studio at C:\Program Files\Android • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart X Unable to find bundled Java version. • Try updating or re-installing Android Studio.[√] VS Code (version 1.84.0) • VS Code at C:\Users\NikitaWork\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.76.0[√] Connected device (3 available) • sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.3570] • Edge (web) • edge • web-javascript • Microsoft Edge 118.0.2088.76[√] Network resources • All expected network resources are available.! Doctor found issues in 4 categories.
Dart Version
3.0.5
Steps to Reproduce
I created a repository that will return a random color from request. I've added very short amount of time before timeout exception, because I will generate it locally then.
The project is using retrofit.
Dio getDio() {
Dio dio = Dio();
dio.options = BaseOptions(
baseUrl: 'https://solid.free.mockoapp.net/',
receiveDataWhenStatusError: true,
connectTimeout: const Duration(seconds: 1),
receiveTimeout: const Duration(seconds: 1),
);
return dio;
}
abstract class RandomRgbRepository {
Future<Color> getRandomColor();
}
class RandomRgbRepositoryImpl implements RandomRgbRepository {
final RandomRgbApi _randomRgbApi;
final RgbColorMapper _rgbColorMapper;
RandomRgbRepositoryImpl(this._randomRgbApi, this._rgbColorMapper);
@override
Future<Color> getRandomColor() async {
try {
final RgbResponse response = await _randomRgbApi.getRandomColor();
return _rgbColorMapper.map(response);
} on Exception catch (e) {
throw Exception(e);
}
}
}
@RestApi(baseUrl: "https://solid.free.mockoapp.net/")
abstract class RandomRgbApi {
factory RandomRgbApi(Dio dio, {String baseUrl}) = _RandomRgbApi;
@GET("/rgb")
Future<RgbResponse> getRandomColor();
}
@JsonSerializable()
class RgbResponse {
final int r;
final int g;
final int b;
RgbResponse(this.r, this.g, this.b);
factory RgbResponse.fromJson(Map<String, dynamic> json) =>
_$RgbResponseFromJson(json);
Map<String, dynamic> toJson() => _$RgbResponseToJson(this);
}
class GetRandomColorUseCase {
final RandomRgbRepository _repository = injector();
Future<Color> call() async {
return await _repository.getRandomColor().onError((error, stackTrace) {
final random = Random();
return Color.fromRGBO(
random.nextInt(256),
random.nextInt(256),
random.nextInt(256),
1,
);
});
}
}
Expected Result
I want to not see Uncaught exception when I catch it.
Actual Result
io_adapter.dart
Future _fetch(***) method
The text was updated successfully, but these errors were encountered:
it is not duplicate. It was fixed by restarting PC and VS Code.
Which means the exceptions themselves do not occur after another session of running. That doesn't mean the linked thread is resolved, or related to Dio anyway.
Package
dio
Version
5.3.3
Operating-System
Android
Output of
flutter doctor -v
Dart Version
3.0.5
Steps to Reproduce
I created a repository that will return a random color from request. I've added very short amount of time before timeout exception, because I will generate it locally then.
The project is using retrofit.
Expected Result
I want to not see Uncaught exception when I catch it.
Actual Result
io_adapter.dart
Future _fetch(***) method
The text was updated successfully, but these errors were encountered: