dio icon indicating copy to clipboard operation
dio copied to clipboard

How to stop error from being presented.

Open er-aman-gupta opened this issue 1 year ago • 4 comments

New Issue Checklist

  • [ ] I have searched for a similar issue in the project and found none

Issue Info

Info Value
Platform Name e.g. flutter / ios / android ios
Platform Version e.g. 1.5.0 / 12.0 / 9.0 15.2
Dio Version e.g. 2.1.0 / 1.0.17 4.0.6
Android Studio / Xcode Version e.g. Android Studio 3.3.2 / Xcode 10.2.1 Xcode 13.4
Repro rate e.g. all the time (100%) / sometimes x% / only once
Repro with our demo prj e.g. does it happen with our demo project?
Demo project link e.g. link to a demo project that highlights the issue

Issue Description and Steps

How do i stop this error from being presented. This comes up in case of no internet or 404. I have already tried adding error handling to the code where i call api.

er-aman-gupta avatar Aug 01 '22 18:08 er-aman-gupta

Hey send flutter doc report. This can be easily resolved

adilwahla avatar Aug 01 '22 18:08 adilwahla

you need to check Internet Connection before going to Proceeds into the main screen. If the Internet connection is not available we can notify the user to Turn On the internet connection

please follow this and you will get out of this error [https://www.geeksforgeeks.org/how-to-check-internet-connection-in-flutter/]

adilwahla avatar Aug 01 '22 18:08 adilwahla

@adilwahla , checking internet connection before proceeding is valid but no internet case is just one case where this is presented. It also comes when i get 404

Flutter doctor

[✓] Flutter (Channel stable, 2.10.4, on macOS 12.2.1 21D62 darwin-arm, locale
    en-IN)
    • Flutter version 2.10.4 at /Users/amangupta/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c860cba910 (4 months ago), 2022-03-25 00:23:12 -0500
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version
    32.1.0-rc1)
    • Android SDK at /Users/amangupta/Library/Android/sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • Java binary at: /Library/Internet
      Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
    • Java version Java(TM) SE Runtime Environment (build 1.8.0_333-b02)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4)
    • Xcode at /Applications/Xcode_13.4.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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
    • Java version OpenJDK Runtime Environment (build
      11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.69.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.44.0

[✓] Connected device (2 available)
    • iPhone 13 Pro Max (mobile) • 4C3884A6-6837-410C-BD82-2FFF17F41B05 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator)
    • Chrome (web)               • chrome                               •
      web-javascript • Google Chrome 103.0.5060.134

[✓] HTTP Host Availability
    • All required HTTP hosts are available

er-aman-gupta avatar Aug 02 '22 07:08 er-aman-gupta

https://stackoverflow.com/questions/57455741/flutter-handling-error-dio-package-404-400-etc

check this out & reply me if you still getting problem cheers

adilwahla avatar Aug 02 '22 09:08 adilwahla