├── android ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable │ │ │ │ │ └── launch_background.xml │ │ │ │ └── values │ │ │ │ │ └── styles.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── jm │ │ │ │ │ └── flutter_dio │ │ │ │ │ └── MainActivity.java │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle └── build.gradle ├── lib ├── dio_util │ ├── dio_method.dart │ ├── dio_response.dart │ ├── dio_transformer.dart │ ├── dio_token_interceptors.dart │ ├── dio_interceptors.dart │ ├── dio_cache_interceptors.dart │ └── dio_util.dart ├── http_example.dart ├── dio_example.dart ├── http_client_example.dart ├── dio_util_example.dart └── main.dart ├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner │ ├── AppDelegate.h │ ├── Assets.xcassets │ │ ├── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── Contents.json │ ├── main.m │ ├── AppDelegate.m │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── build │ └── Pods.build │ │ └── Release-iphonesimulator │ │ ├── Flutter.build │ │ └── dgph │ │ ├── Pods-Runner.build │ │ └── dgph │ │ └── shared_preferences.build │ │ └── dgph ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ └── project.pbxproj ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── WorkspaceSettings.xcsettings │ │ └── IDEWorkspaceChecks.plist ├── Podfile.lock ├── .gitignore └── Podfile ├── .metadata ├── .gitignore ├── README.md ├── test └── widget_test.dart ├── pubspec.yaml └── pubspec.lock /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /lib/dio_util/dio_method.dart: -------------------------------------------------------------------------------- 1 | enum DioMethod { 2 | get, 3 | post, 4 | put, 5 | delete, 6 | patch, 7 | head, 8 | } -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JunAILiang/flutter_dio_util/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/build/Pods.build/Release-iphonesimulator/Flutter.build/dgph: -------------------------------------------------------------------------------- 1 | DGPH1.04 Dec 21 202021:57:26 /UsersjmDesktopWorkGit 2 | my_projectflutter_dio_util flutter_dio ios 3 | Pods -------------------------------------------------------------------------------- /ios/build/Pods.build/Release-iphonesimulator/Pods-Runner.build/dgph: -------------------------------------------------------------------------------- 1 | DGPH1.04 Dec 21 202021:57:26 /UsersjmDesktopWorkGit 2 | my_projectflutter_dio_util flutter_dio ios 3 | Pods -------------------------------------------------------------------------------- /ios/build/Pods.build/Release-iphonesimulator/shared_preferences.build/dgph: -------------------------------------------------------------------------------- 1 | DGPH1.04 Dec 21 202021:57:26 /UsersjmDesktopWorkGit 2 | my_projectflutter_dio_util flutter_dio ios 3 | Pods -------------------------------------------------------------------------------- /android/app/src/main/java/com/jm/flutter_dio/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.jm.flutter_dio; 2 | 3 | import io.flutter.embedding.android.FlutterActivity; 4 | 5 | public class MainActivity extends FlutterActivity { 6 | } 7 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 9b2d32b605630f28625709ebd9d78ab3016b2bf6 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | #import "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.5.0' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - shared_preferences (0.0.1): 4 | - Flutter 5 | 6 | DEPENDENCIES: 7 | - Flutter (from `Flutter`) 8 | - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) 9 | 10 | EXTERNAL SOURCES: 11 | Flutter: 12 | :path: Flutter 13 | shared_preferences: 14 | :path: ".symlinks/plugins/shared_preferences/ios" 15 | 16 | SPEC CHECKSUMS: 17 | Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a 18 | shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d 19 | 20 | PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d 21 | 22 | COCOAPODS: 1.11.2 23 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /lib/dio_util/dio_response.dart: -------------------------------------------------------------------------------- 1 | 2 | class DioResponse { 3 | 4 | /// 消息(例如成功消息文字/错误消息文字) 5 | final String? message; 6 | /// 自定义code(可根据内部定义方式) 7 | final int? code; 8 | /// 接口返回的数据 9 | final T? data; 10 | /// 需要添加更多 11 | /// ......... 12 | 13 | DioResponse({ 14 | this.message, 15 | this.data, 16 | this.code, 17 | }); 18 | 19 | @override 20 | String toString() { 21 | StringBuffer sb = StringBuffer('{'); 22 | sb.write("\"message\":\"$message\""); 23 | sb.write(",\"errorMsg\":\"$code\""); 24 | sb.write(",\"data\":\"$data\""); 25 | sb.write('}'); 26 | return sb.toString(); 27 | } 28 | } 29 | 30 | class DioResponseCode { 31 | /// 成功 32 | static const int SUCCESS = 0; 33 | /// 错误 34 | static const int ERROR = 1; 35 | /// 更多 36 | } -------------------------------------------------------------------------------- /lib/dio_util/dio_transformer.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:dio/dio.dart'; 3 | 4 | class DioTransformer extends DefaultTransformer { 5 | 6 | @override 7 | Future transformRequest(RequestOptions options) async { 8 | // 如果请求的数据接口是List那我们直接抛出异常 9 | if (options.data is List) { 10 | throw DioError( 11 | error: "你不能直接发送List数据到服务器", 12 | requestOptions: options, 13 | ); 14 | } else { 15 | return super.transformRequest(options); 16 | } 17 | } 18 | 19 | @override 20 | Future transformResponse(RequestOptions options, ResponseBody response) async { 21 | 22 | // 例如我们响应选项里面没有自定义某些头部数据,那我们就可以自行添加 23 | options.extra['myHeader'] = 'abc'; 24 | return super.transformResponse(options, response); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flutter DioUtil 2 | 3 | 可直接下载源代码运行 4 | 5 | 如果你还不了解`Dio`查看如下四篇文章,将帮助你更好的理解什么`Dio`以及`DioUtil` 6 | 7 | [Flutter Dio源码分析(一)–Dio介绍](https://www.liujunmin.com/flutter/dio_introduce.html) 8 | 9 | [Flutter Dio源码分析(二)–HttpClient、Http、Dio对比](https://www.liujunmin.com/flutter/dio_compared.html) 10 | 11 | [Flutter Dio源码分析(三)–深度剖析](https://www.liujunmin.com/flutter/dio_analysis.html) 12 | 13 | [Flutter Dio源码分析(四)–封装](https://www.liujunmin.com/flutter/dio_encapsulation.html) 14 | 15 | ## 视频讲解地址 16 | 17 | [Flutter Dio源码分析(一)--Dio介绍视频教程](https://www.bilibili.com/video/BV1cg411V74y?p=1) 18 | 19 | [Flutter Dio源码分析(二)--HttpClient、Http、Dio对比视频教程](https://www.bilibili.com/video/BV1cg411V74y?p=2) 20 | 21 | [Flutter Dio源码分析(三)--深度剖析视频教程](https://www.bilibili.com/video/BV1cg411V74y?p=3) 22 | 23 | [Flutter Dio源码分析(四)--封装视频教程](https://www.bilibili.com/video/BV1cg411V74y?p=4) -------------------------------------------------------------------------------- /lib/http_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:http/http.dart' as http; 3 | 4 | class HttpExample extends StatelessWidget { 5 | 6 | void _sendDioGet() async { 7 | try { 8 | var response = await http.get(Uri.parse("http://localhost:8080/login?username=Jimi&password=123456")); 9 | print(response.body); 10 | } catch (e) { 11 | print(e); 12 | } 13 | } 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scaffold( 18 | appBar: AppBar( 19 | title: Text("HttpExample"), 20 | ), 21 | body: Center( 22 | child: Column( 23 | children: [ 24 | TextButton( 25 | onPressed: _sendDioGet, 26 | child: Text("发送get请求"), 27 | ) 28 | ], 29 | ), 30 | ), 31 | ); 32 | } 33 | } -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/dio_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | 5 | class DioExample extends StatefulWidget { 6 | @override 7 | _DioExampleState createState() => _DioExampleState(); 8 | } 9 | 10 | class _DioExampleState extends State { 11 | 12 | void _handleLogin() async { 13 | try { 14 | var response = await Dio().get('http://localhost:8080/login?username=Jimi&password=123456'); 15 | 16 | print(response.data); 17 | } catch (e) { 18 | print(e); 19 | } 20 | } 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return Scaffold( 25 | appBar: AppBar( 26 | title: Text("DioExample"), 27 | ), 28 | body: Center( 29 | child: Column( 30 | children: [ 31 | TextButton( 32 | onPressed: _handleLogin, 33 | child: Text("发送get请求"), 34 | ), 35 | ], 36 | ), 37 | ), 38 | ); 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:flutter_dio/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /lib/dio_util/dio_token_interceptors.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:flutter_dio/dio_util/dio_util.dart'; 3 | 4 | class DioTokenInterceptors extends Interceptor { 5 | @override 6 | void onRequest(RequestOptions options, RequestInterceptorHandler handler) { 7 | if (options.headers['refreshToken'] == null) { 8 | DioUtil.getInstance()?.dio.lock(); 9 | Dio _tokenDio = Dio(); 10 | _tokenDio..get("http://localhost:8080/getRefreshToken").then((d) { 11 | options.headers['refreshToken'] = d; 12 | handler.next(options); 13 | }).catchError((error, stackTrace) { 14 | handler.reject(error, true); 15 | }) .whenComplete(() { 16 | DioUtil.getInstance()?.dio.unlock(); 17 | }); // unlock the dio 18 | } else { 19 | options.headers['refreshToken'] = options.headers['refreshToken']; 20 | handler.next(options); 21 | } 22 | } 23 | 24 | @override 25 | void onResponse(Response response, ResponseInterceptorHandler handler) async { 26 | 27 | // 响应前需要做刷新token的操作 28 | 29 | super.onResponse(response, handler); 30 | } 31 | 32 | @override 33 | void onError(DioError err, ErrorInterceptorHandler handler) { 34 | super.onError(err, handler); 35 | } 36 | } -------------------------------------------------------------------------------- /lib/http_client_example.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | 4 | import 'package:flutter/material.dart'; 5 | 6 | class HttpClientExample extends StatelessWidget { 7 | @override 8 | Widget build(BuildContext context) { 9 | 10 | void _getUserInfo() async { 11 | try { 12 | // 1. 创建httpClient 13 | HttpClient httpClient = HttpClient(); 14 | // 2. 打开http连接,设置请求头 15 | HttpClientRequest request = await httpClient.getUrl(Uri.parse("http://localhost:8080/login?username=Jimi&password=123456")); 16 | // 3. 通过HttpClientRequest可以设置请求header 17 | request.headers.add("token", "123456"); 18 | // 4. 等待连接服务器 19 | HttpClientResponse response = await request.close(); 20 | // 5. 读取响应内容 21 | String responseBody = await response.transform(utf8.decoder).join(); 22 | // 6. 请求结束,关闭httpClient 23 | httpClient.close(); 24 | 25 | print(responseBody); 26 | } catch (e) { 27 | print(e); 28 | } 29 | } 30 | 31 | return Scaffold( 32 | appBar: AppBar( 33 | title: Text("DioExample"), 34 | ), 35 | body: Center( 36 | child: Column( 37 | children: [ 38 | TextButton( 39 | onPressed: _getUserInfo, 40 | child: Text("发送get请求"), 41 | ) 42 | ], 43 | ), 44 | ), 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 32 | end 33 | 34 | post_install do |installer| 35 | installer.pods_project.targets.each do |target| 36 | flutter_additional_ios_build_settings(target) 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_dio 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /lib/dio_util_example.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | 4 | import 'package:cookie_jar/cookie_jar.dart'; 5 | import 'package:dio/dio.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter_dio/dio_util/dio_method.dart'; 8 | import 'package:flutter_dio/dio_util/dio_response.dart'; 9 | import 'package:flutter_dio/dio_util/dio_util.dart'; 10 | 11 | class DioUtilExample extends StatefulWidget { 12 | @override 13 | _DioUtilExampleState createState() => _DioUtilExampleState(); 14 | } 15 | 16 | class _DioUtilExampleState extends State { 17 | 18 | CancelToken _cancelToken = CancelToken(); 19 | 20 | void _handleLogin() async { 21 | // 模拟用户退出页面 22 | // const _timeout = Duration(milliseconds: 2000); 23 | // Timer.periodic(_timeout, (timer) { 24 | // DioUtil().cancelRequests(token: _cancelToken); 25 | // }); 26 | 27 | // DioUtil().openLog(); 28 | DioUtil.getInstance()?.openLog(); 29 | // DioUtil.CACHE_ENABLE = true; 30 | // DioUtil().setProxy(proxyAddress: "https://www.baidu.com", enable: true); 31 | DioResponse result = await DioUtil().request("/login", method: DioMethod.get, params: { 32 | "username": "123456", 33 | "password": "123456" 34 | }, cancelToken: _cancelToken); 35 | print(result); 36 | } 37 | 38 | @override 39 | Widget build(BuildContext context) { 40 | return Scaffold( 41 | appBar: AppBar( 42 | title: Text("DioUtilExample"), 43 | ), 44 | body: Center( 45 | child: Column( 46 | children: [ 47 | TextButton( 48 | onPressed: _handleLogin, 49 | child: Text("发送请求"), 50 | ), 51 | ], 52 | ), 53 | ), 54 | ); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 29 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.jm.flutter_dio" 37 | minSdkVersion 16 38 | targetSdkVersion 29 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | } 42 | 43 | buildTypes { 44 | release { 45 | // TODO: Add your own signing config for the release build. 46 | // Signing with the debug keys for now, so `flutter run --release` works. 47 | signingConfig signingConfigs.debug 48 | } 49 | } 50 | } 51 | 52 | flutter { 53 | source '../..' 54 | } 55 | -------------------------------------------------------------------------------- /lib/dio_util/dio_interceptors.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:dio/dio.dart'; 3 | import 'package:flutter_dio/dio_util/dio_response.dart'; 4 | 5 | class DioInterceptors extends Interceptor { 6 | @override 7 | void onRequest(RequestOptions options, RequestInterceptorHandler handler) { 8 | 9 | // 对非open的接口的请求参数全部增加userId 10 | if (!options.path.contains("open")) { 11 | options.queryParameters["userId"] = "xxx"; 12 | } 13 | 14 | // 头部添加token 15 | options.headers["token"] = "xxx"; 16 | 17 | // 更多业务需求 18 | 19 | handler.next(options); 20 | 21 | // super.onRequest(options, handler); 22 | } 23 | 24 | @override 25 | void onResponse(Response response, ResponseInterceptorHandler handler) async { 26 | 27 | // 请求成功是对数据做基本处理 28 | if (response.statusCode == 200) { 29 | response.data = DioResponse(code: 0, message: "请求成功啦", data: response.data); 30 | } else { 31 | response.data = DioResponse(code: 1, message: "请求失败啦", data: response.data); 32 | } 33 | 34 | // 对某些单独的url返回数据做特殊处理 35 | if (response.requestOptions.baseUrl.contains("???????")) { 36 | //.... 37 | } 38 | 39 | // 根据公司的业务需求进行定制化处理 40 | 41 | // 重点 42 | handler.next(response); 43 | } 44 | 45 | @override 46 | void onError(DioError err, ErrorInterceptorHandler handler) { 47 | switch(err.type) { 48 | // 连接服务器超时 49 | case DioErrorType.connectTimeout: 50 | { 51 | // 根据自己的业务需求来设定该如何操作,可以是弹出框提示/或者做一些路由跳转处理 52 | } 53 | break; 54 | // 响应超时 55 | case DioErrorType.receiveTimeout: 56 | { 57 | // 根据自己的业务需求来设定该如何操作,可以是弹出框提示/或者做一些路由跳转处理 58 | } 59 | break; 60 | // 发送超时 61 | case DioErrorType.sendTimeout: 62 | { 63 | // 根据自己的业务需求来设定该如何操作,可以是弹出框提示/或者做一些路由跳转处理 64 | } 65 | break; 66 | // 请求取消 67 | case DioErrorType.cancel: 68 | { 69 | // 根据自己的业务需求来设定该如何操作,可以是弹出框提示/或者做一些路由跳转处理 70 | } 71 | break; 72 | // 404/503错误 73 | case DioErrorType.response: 74 | { 75 | // 根据自己的业务需求来设定该如何操作,可以是弹出框提示/或者做一些路由跳转处理 76 | } 77 | break; 78 | // other 其他错误类型 79 | case DioErrorType.other: 80 | { 81 | 82 | } 83 | break; 84 | 85 | } 86 | super.onError(err, handler); 87 | } 88 | } -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /lib/dio_util/dio_cache_interceptors.dart: -------------------------------------------------------------------------------- 1 | import 'dart:collection'; 2 | import 'package:dio/dio.dart'; 3 | import 'package:flutter_dio/dio_util/dio_util.dart'; 4 | import 'package:shared_preferences/shared_preferences.dart'; 5 | 6 | class CacheObject { 7 | CacheObject(this.response) 8 | : timeStamp = DateTime.now().millisecondsSinceEpoch; 9 | Response response; 10 | int timeStamp; 11 | 12 | @override 13 | bool operator ==(other) { 14 | return response.hashCode == other.hashCode; 15 | } 16 | 17 | @override 18 | int get hashCode => response.realUri.hashCode; 19 | } 20 | 21 | class DioCacheInterceptors extends Interceptor { 22 | // 为确保迭代器顺序和对象插入时间一致顺序一致,我们使用LinkedHashMap 23 | var cache = LinkedHashMap(); 24 | // sp 25 | SharedPreferences? preferences; 26 | 27 | @override 28 | void onRequest(RequestOptions options, RequestInterceptorHandler handler) async { 29 | if (!DioUtil.CACHE_ENABLE) return super.onRequest(options, handler); 30 | // 是否刷新缓存 31 | bool refresh = options.extra["refresh"] == true; 32 | 33 | if (refresh) { 34 | // 删除本地缓存 35 | delete(options.uri.toString()); 36 | } 37 | // 只有get请求才开启缓存 38 | if (options.extra["noCache"] != true && 39 | options.method.toLowerCase() == 'get') { 40 | String key = options.extra["cacheKey"] ?? options.uri.toString(); 41 | var ob = cache[key]; 42 | if (ob != null) { 43 | // 内存缓存 44 | if ((DateTime.now().millisecondsSinceEpoch - ob.timeStamp) / 1000 < 45 | DioUtil.MAX_CACHE_AGE) { 46 | return handler.resolve(cache[key]!.response); 47 | } else { 48 | //若已过期则删除缓存,继续向服务器请求 49 | cache.remove(key); 50 | } 51 | 52 | // 磁盘缓存 53 | } 54 | 55 | } 56 | super.onRequest(options, handler); 57 | } 58 | 59 | @override 60 | void onResponse(Response response, ResponseInterceptorHandler handler) { 61 | // 把响应的数据保存到缓存 62 | if (DioUtil.CACHE_ENABLE) { 63 | _saveCache(response); 64 | } 65 | 66 | super.onResponse(response, handler); 67 | } 68 | 69 | @override 70 | void onError(DioError err, ErrorInterceptorHandler handler) { 71 | // TODO: implement onError 72 | super.onError(err, handler); 73 | } 74 | 75 | 76 | _saveCache(Response object) { 77 | RequestOptions options = object.requestOptions; 78 | if (options.extra["noCache"] != true && 79 | options.method.toLowerCase() == "get") { 80 | // 如果缓存数量超过最大数量限制,则先移除最早的一条记录 81 | if (cache.length == DioUtil.MAX_CACHE_COUNT) { 82 | cache.remove(cache[cache.keys.first]); 83 | } 84 | String key = options.extra["cacheKey"] ?? options.uri.toString(); 85 | cache[key] = CacheObject(object); 86 | } 87 | } 88 | 89 | void delete(String key) { 90 | cache.remove(key); 91 | } 92 | } -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_dio 2 | description: A new Flutter application. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ">=2.12.0 <3.0.0" 22 | 23 | dependencies: 24 | flutter: 25 | sdk: flutter 26 | 27 | dio: ^4.0.0 28 | http: ^0.13.3 29 | dio_cookie_manager: ^2.0.0 30 | cookie_jar: ^3.0.1 31 | dio_http2_adapter: ^2.0.0 32 | shared_preferences: ^2.0.7 33 | 34 | # The following adds the Cupertino Icons font to your application. 35 | # Use with the CupertinoIcons class for iOS style icons. 36 | cupertino_icons: ^1.0.0 37 | 38 | dev_dependencies: 39 | flutter_test: 40 | sdk: flutter 41 | 42 | # For information on the generic Dart part of this file, see the 43 | # following page: https://dart.dev/tools/pub/pubspec 44 | 45 | # The following section is specific to Flutter. 46 | flutter: 47 | 48 | # The following line ensures that the Material Icons font is 49 | # included with your application, so that you can use the icons in 50 | # the material Icons class. 51 | uses-material-design: true 52 | 53 | # To add assets to your application, add an assets section, like this: 54 | # assets: 55 | # - images/a_dot_burr.jpeg 56 | # - images/a_dot_ham.jpeg 57 | 58 | # An image asset can refer to one or more resolution-specific "variants", see 59 | # https://flutter.dev/assets-and-images/#resolution-aware. 60 | 61 | # For details regarding adding assets from package dependencies, see 62 | # https://flutter.dev/assets-and-images/#from-packages 63 | 64 | # To add custom fonts to your application, add a fonts section here, 65 | # in this "flutter" section. Each entry in this list should have a 66 | # "family" key with the font family name, and a "fonts" key with a 67 | # list giving the asset and other descriptors for the font. For 68 | # example: 69 | # fonts: 70 | # - family: Schyler 71 | # fonts: 72 | # - asset: fonts/Schyler-Regular.ttf 73 | # - asset: fonts/Schyler-Italic.ttf 74 | # style: italic 75 | # - family: Trajan Pro 76 | # fonts: 77 | # - asset: fonts/TrajanPro.ttf 78 | # - asset: fonts/TrajanPro_Bold.ttf 79 | # weight: 700 80 | # 81 | # For details regarding fonts from package dependencies, 82 | # see https://flutter.dev/custom-fonts/#from-packages 83 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_dio/dio_example.dart'; 3 | import 'package:flutter_dio/dio_util_example.dart'; 4 | import 'package:flutter_dio/http_client_example.dart'; 5 | import 'package:flutter_dio/http_example.dart'; 6 | 7 | void main() { 8 | runApp(MyApp()); 9 | } 10 | 11 | class MyApp extends StatelessWidget { 12 | // This widget is the root of your application. 13 | @override 14 | Widget build(BuildContext context) { 15 | return MaterialApp( 16 | title: 'Flutter Demos', 17 | theme: ThemeData( 18 | // This is the theme of your application. 19 | // 20 | // Try running your application with "flutter run". You'll see the 21 | // application has a blue toolbar. Then, without quitting the app, try 22 | // changing the primarySwatch below to Colors.green and then invoke 23 | // "hot reload" (press "r" in the console where you ran "flutter run", 24 | // or simply save your changes to "hot reload" in a Flutter IDE). 25 | // Notice that the counter didn't reset back to zero; the application 26 | // is not restarted. 27 | primarySwatch: Colors.blue, 28 | // This makes the visual density adapt to the platform that you run 29 | // the app on. For desktop platforms, the controls will be smaller and 30 | // closer together (more dense) than on mobile platforms. 31 | visualDensity: VisualDensity.adaptivePlatformDensity, 32 | ), 33 | debugShowCheckedModeBanner: false, 34 | home: MyHomePage(title: 'Flutter Demos'), 35 | ); 36 | } 37 | } 38 | 39 | class MyHomePage extends StatefulWidget { 40 | MyHomePage({Key? key, required this.title}) : super(key: key); 41 | 42 | // This widget is the home page of your application. It is stateful, meaning 43 | // that it has a State object (defined below) that contains fields that affect 44 | // how it looks. 45 | 46 | // This class is the configuration for the state. It holds the values (in this 47 | // case the title) provided by the parent (in this case the App widget) and 48 | // used by the build method of the State. Fields in a Widget subclass are 49 | // always marked "final". 50 | 51 | final String title; 52 | 53 | @override 54 | _MyHomePageState createState() => _MyHomePageState(); 55 | } 56 | 57 | class _MyHomePageState extends State { 58 | 59 | List _dataList = [ 60 | { 61 | "title": "HttpClientExample", 62 | "page": HttpClientExample() 63 | }, 64 | { 65 | "title": "HttpExample", 66 | "page": HttpExample() 67 | }, 68 | { 69 | "title": "DioExample", 70 | "page": DioExample() 71 | }, 72 | { 73 | "title": "DioUtilExample", 74 | "page": DioUtilExample() 75 | }, 76 | 77 | ]; 78 | 79 | @override 80 | Widget build(BuildContext context) { 81 | // This method is rerun every time setState is called, for instance as done 82 | // by the _incrementCounter method above. 83 | // 84 | // The Flutter framework has been optimized to make rerunning build methods 85 | // fast, so that you can just rebuild anything that needs updating rather 86 | // than having to individually change instances of widgets. 87 | return Scaffold( 88 | appBar: AppBar( 89 | // Here we take the value from the MyHomePage object that was created by 90 | // the App.build method, and use it to set our appbar title. 91 | title: Text(widget.title), 92 | ), 93 | body: ListView.builder( 94 | itemBuilder: (context, index) { 95 | return TextButton( 96 | onPressed: () { 97 | Navigator.push(context, MaterialPageRoute(builder: (_) => _dataList[index]["page"])); 98 | }, 99 | child: Text(_dataList[index]["title"]), 100 | ); 101 | }, 102 | itemCount: _dataList.length, 103 | ), 104 | ); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /lib/dio_util/dio_util.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:cookie_jar/cookie_jar.dart'; 4 | import 'package:dio/adapter.dart'; 5 | import 'package:dio/dio.dart'; 6 | import 'package:dio_cookie_manager/dio_cookie_manager.dart'; 7 | import 'package:dio_http2_adapter/dio_http2_adapter.dart'; 8 | import 'package:flutter_dio/dio_util/dio_cache_interceptors.dart'; 9 | import 'package:flutter_dio/dio_util/dio_interceptors.dart'; 10 | import 'package:flutter_dio/dio_util/dio_method.dart'; 11 | import 'package:flutter_dio/dio_util/dio_token_interceptors.dart'; 12 | import 'package:flutter_dio/dio_util/dio_transformer.dart'; 13 | 14 | class DioUtil { 15 | 16 | /// 连接超时时间 17 | static const int CONNECT_TIMEOUT = 6*1000; 18 | /// 响应超时时间 19 | static const int RECEIVE_TIMEOUT = 6*1000; 20 | /// 请求的URL前缀 21 | static String BASE_URL = "http://localhost:8080"; 22 | /// 是否开启网络缓存,默认false 23 | static bool CACHE_ENABLE = false; 24 | /// 最大缓存时间(按秒), 默认缓存七天,可自行调节 25 | static int MAX_CACHE_AGE = 7 * 24 * 60 * 60; 26 | /// 最大缓存条数(默认一百条) 27 | static int MAX_CACHE_COUNT = 100; 28 | 29 | static DioUtil? _instance; 30 | static Dio _dio = Dio(); 31 | Dio get dio => _dio; 32 | 33 | DioUtil._internal() { 34 | _instance = this; 35 | _instance!._init(); 36 | } 37 | 38 | factory DioUtil() => _instance ?? DioUtil._internal(); 39 | 40 | static DioUtil? getInstance() { 41 | _instance ?? DioUtil._internal(); 42 | return _instance; 43 | } 44 | 45 | 46 | /// 取消请求token 47 | CancelToken _cancelToken = CancelToken(); 48 | /// cookie 49 | CookieJar cookieJar = CookieJar(); 50 | 51 | _init() { 52 | /// 初始化基本选项 53 | BaseOptions options = BaseOptions( 54 | baseUrl: BASE_URL, 55 | connectTimeout: CONNECT_TIMEOUT, 56 | receiveTimeout: RECEIVE_TIMEOUT 57 | ); 58 | 59 | /// 初始化dio 60 | _dio = Dio(options); 61 | 62 | /// 添加拦截器 63 | _dio.interceptors.add(DioInterceptors()); 64 | 65 | /// 添加转换器 66 | _dio.transformer = DioTransformer(); 67 | 68 | /// 添加cookie管理器 69 | _dio.interceptors.add(CookieManager(cookieJar)); 70 | 71 | /// 刷新token拦截器(lock/unlock) 72 | _dio.interceptors.add(DioTokenInterceptors()); 73 | 74 | /// 添加缓存拦截器 75 | _dio.interceptors.add(DioCacheInterceptors()); 76 | } 77 | 78 | /// 设置Http代理(设置即开启) 79 | void setProxy({ 80 | String? proxyAddress, 81 | bool enable = false 82 | }) { 83 | if (enable) { 84 | (_dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = 85 | (HttpClient client) { 86 | client.findProxy = (uri) { 87 | return proxyAddress ?? ""; 88 | }; 89 | client.badCertificateCallback = 90 | (X509Certificate cert, String host, int port) => true; 91 | }; 92 | } 93 | } 94 | 95 | /// 设置https证书校验 96 | void setHttpsCertificateVerification({ 97 | String? pem, 98 | bool enable = false 99 | }) { 100 | if (enable) { 101 | (_dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (client) { 102 | client.badCertificateCallback=(X509Certificate cert, String host, int port){ 103 | if(cert.pem==pem){ // 验证证书 104 | return true; 105 | } 106 | return false; 107 | }; 108 | }; 109 | } 110 | } 111 | 112 | /// 开启日志打印 113 | void openLog() { 114 | _dio.interceptors.add(LogInterceptor(responseBody: true)); 115 | } 116 | 117 | /// 请求类 118 | Future request(String path, { 119 | DioMethod method = DioMethod.get, 120 | Map? params, 121 | data, 122 | CancelToken? cancelToken, 123 | Options? options, 124 | ProgressCallback? onSendProgress, 125 | ProgressCallback? onReceiveProgress, 126 | }) async { 127 | const _methodValues = { 128 | DioMethod.get: 'get', 129 | DioMethod.post: 'post', 130 | DioMethod.put: 'put', 131 | DioMethod.delete: 'delete', 132 | DioMethod.patch: 'patch', 133 | DioMethod.head: 'head' 134 | }; 135 | 136 | 137 | options ??= Options(method: _methodValues[method]); 138 | try { 139 | Response response; 140 | response = await _dio.request(path, 141 | data: data, 142 | queryParameters: params, 143 | cancelToken: cancelToken ?? _cancelToken, 144 | options: options, 145 | onSendProgress: onSendProgress, 146 | onReceiveProgress: onReceiveProgress 147 | ); 148 | return response.data; 149 | } on DioError catch (e) { 150 | throw e; 151 | } 152 | } 153 | 154 | /// 取消网络请求 155 | void cancelRequests({CancelToken? token}) { 156 | token ?? _cancelToken.cancel("cancelled"); 157 | } 158 | } -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "2.8.2" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "2.1.0" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "1.2.0" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.3.1" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.1.0" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "1.15.0" 46 | cookie_jar: 47 | dependency: "direct main" 48 | description: 49 | name: cookie_jar 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "3.0.1" 53 | cupertino_icons: 54 | dependency: "direct main" 55 | description: 56 | name: cupertino_icons 57 | url: "https://pub.flutter-io.cn" 58 | source: hosted 59 | version: "1.0.0" 60 | dio: 61 | dependency: "direct main" 62 | description: 63 | name: dio 64 | url: "https://pub.flutter-io.cn" 65 | source: hosted 66 | version: "4.0.0" 67 | dio_cookie_manager: 68 | dependency: "direct main" 69 | description: 70 | name: dio_cookie_manager 71 | url: "https://pub.flutter-io.cn" 72 | source: hosted 73 | version: "2.0.0" 74 | dio_http2_adapter: 75 | dependency: "direct main" 76 | description: 77 | name: dio_http2_adapter 78 | url: "https://pub.flutter-io.cn" 79 | source: hosted 80 | version: "2.0.0" 81 | fake_async: 82 | dependency: transitive 83 | description: 84 | name: fake_async 85 | url: "https://pub.flutter-io.cn" 86 | source: hosted 87 | version: "1.2.0" 88 | ffi: 89 | dependency: transitive 90 | description: 91 | name: ffi 92 | url: "https://pub.flutter-io.cn" 93 | source: hosted 94 | version: "1.1.2" 95 | file: 96 | dependency: transitive 97 | description: 98 | name: file 99 | url: "https://pub.flutter-io.cn" 100 | source: hosted 101 | version: "6.1.2" 102 | flutter: 103 | dependency: "direct main" 104 | description: flutter 105 | source: sdk 106 | version: "0.0.0" 107 | flutter_test: 108 | dependency: "direct dev" 109 | description: flutter 110 | source: sdk 111 | version: "0.0.0" 112 | flutter_web_plugins: 113 | dependency: transitive 114 | description: flutter 115 | source: sdk 116 | version: "0.0.0" 117 | http: 118 | dependency: "direct main" 119 | description: 120 | name: http 121 | url: "https://pub.flutter-io.cn" 122 | source: hosted 123 | version: "0.13.3" 124 | http2: 125 | dependency: transitive 126 | description: 127 | name: http2 128 | url: "https://pub.flutter-io.cn" 129 | source: hosted 130 | version: "2.0.0" 131 | http_parser: 132 | dependency: transitive 133 | description: 134 | name: http_parser 135 | url: "https://pub.flutter-io.cn" 136 | source: hosted 137 | version: "4.0.0" 138 | js: 139 | dependency: transitive 140 | description: 141 | name: js 142 | url: "https://pub.flutter-io.cn" 143 | source: hosted 144 | version: "0.6.3" 145 | matcher: 146 | dependency: transitive 147 | description: 148 | name: matcher 149 | url: "https://pub.flutter-io.cn" 150 | source: hosted 151 | version: "0.12.11" 152 | material_color_utilities: 153 | dependency: transitive 154 | description: 155 | name: material_color_utilities 156 | url: "https://pub.flutter-io.cn" 157 | source: hosted 158 | version: "0.1.2" 159 | meta: 160 | dependency: transitive 161 | description: 162 | name: meta 163 | url: "https://pub.flutter-io.cn" 164 | source: hosted 165 | version: "1.7.0" 166 | path: 167 | dependency: transitive 168 | description: 169 | name: path 170 | url: "https://pub.flutter-io.cn" 171 | source: hosted 172 | version: "1.8.0" 173 | path_provider_linux: 174 | dependency: transitive 175 | description: 176 | name: path_provider_linux 177 | url: "https://pub.flutter-io.cn" 178 | source: hosted 179 | version: "2.0.2" 180 | path_provider_platform_interface: 181 | dependency: transitive 182 | description: 183 | name: path_provider_platform_interface 184 | url: "https://pub.flutter-io.cn" 185 | source: hosted 186 | version: "2.0.1" 187 | path_provider_windows: 188 | dependency: transitive 189 | description: 190 | name: path_provider_windows 191 | url: "https://pub.flutter-io.cn" 192 | source: hosted 193 | version: "2.0.3" 194 | pedantic: 195 | dependency: transitive 196 | description: 197 | name: pedantic 198 | url: "https://pub.flutter-io.cn" 199 | source: hosted 200 | version: "1.11.1" 201 | platform: 202 | dependency: transitive 203 | description: 204 | name: platform 205 | url: "https://pub.flutter-io.cn" 206 | source: hosted 207 | version: "3.0.2" 208 | plugin_platform_interface: 209 | dependency: transitive 210 | description: 211 | name: plugin_platform_interface 212 | url: "https://pub.flutter-io.cn" 213 | source: hosted 214 | version: "2.0.1" 215 | process: 216 | dependency: transitive 217 | description: 218 | name: process 219 | url: "https://pub.flutter-io.cn" 220 | source: hosted 221 | version: "4.2.3" 222 | shared_preferences: 223 | dependency: "direct main" 224 | description: 225 | name: shared_preferences 226 | url: "https://pub.flutter-io.cn" 227 | source: hosted 228 | version: "2.0.7" 229 | shared_preferences_linux: 230 | dependency: transitive 231 | description: 232 | name: shared_preferences_linux 233 | url: "https://pub.flutter-io.cn" 234 | source: hosted 235 | version: "2.0.2" 236 | shared_preferences_macos: 237 | dependency: transitive 238 | description: 239 | name: shared_preferences_macos 240 | url: "https://pub.flutter-io.cn" 241 | source: hosted 242 | version: "2.0.2" 243 | shared_preferences_platform_interface: 244 | dependency: transitive 245 | description: 246 | name: shared_preferences_platform_interface 247 | url: "https://pub.flutter-io.cn" 248 | source: hosted 249 | version: "2.0.0" 250 | shared_preferences_web: 251 | dependency: transitive 252 | description: 253 | name: shared_preferences_web 254 | url: "https://pub.flutter-io.cn" 255 | source: hosted 256 | version: "2.0.2" 257 | shared_preferences_windows: 258 | dependency: transitive 259 | description: 260 | name: shared_preferences_windows 261 | url: "https://pub.flutter-io.cn" 262 | source: hosted 263 | version: "2.0.2" 264 | sky_engine: 265 | dependency: transitive 266 | description: flutter 267 | source: sdk 268 | version: "0.0.99" 269 | source_span: 270 | dependency: transitive 271 | description: 272 | name: source_span 273 | url: "https://pub.flutter-io.cn" 274 | source: hosted 275 | version: "1.8.1" 276 | stack_trace: 277 | dependency: transitive 278 | description: 279 | name: stack_trace 280 | url: "https://pub.flutter-io.cn" 281 | source: hosted 282 | version: "1.10.0" 283 | stream_channel: 284 | dependency: transitive 285 | description: 286 | name: stream_channel 287 | url: "https://pub.flutter-io.cn" 288 | source: hosted 289 | version: "2.1.0" 290 | string_scanner: 291 | dependency: transitive 292 | description: 293 | name: string_scanner 294 | url: "https://pub.flutter-io.cn" 295 | source: hosted 296 | version: "1.1.0" 297 | term_glyph: 298 | dependency: transitive 299 | description: 300 | name: term_glyph 301 | url: "https://pub.flutter-io.cn" 302 | source: hosted 303 | version: "1.2.0" 304 | test_api: 305 | dependency: transitive 306 | description: 307 | name: test_api 308 | url: "https://pub.flutter-io.cn" 309 | source: hosted 310 | version: "0.4.8" 311 | typed_data: 312 | dependency: transitive 313 | description: 314 | name: typed_data 315 | url: "https://pub.flutter-io.cn" 316 | source: hosted 317 | version: "1.3.0" 318 | vector_math: 319 | dependency: transitive 320 | description: 321 | name: vector_math 322 | url: "https://pub.flutter-io.cn" 323 | source: hosted 324 | version: "2.1.1" 325 | win32: 326 | dependency: transitive 327 | description: 328 | name: win32 329 | url: "https://pub.flutter-io.cn" 330 | source: hosted 331 | version: "2.0.5" 332 | xdg_directories: 333 | dependency: transitive 334 | description: 335 | name: xdg_directories 336 | url: "https://pub.flutter-io.cn" 337 | source: hosted 338 | version: "0.2.0" 339 | sdks: 340 | dart: ">=2.14.0 <3.0.0" 341 | flutter: ">=2.0.0" 342 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 732C603CF937B061C3D704EF /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 44818CA6DC66BEAEA0F8BA83 /* libPods-Runner.a */; }; 13 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 14 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 15 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 16 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 17 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXCopyFilesBuildPhase section */ 21 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 22 | isa = PBXCopyFilesBuildPhase; 23 | buildActionMask = 2147483647; 24 | dstPath = ""; 25 | dstSubfolderSpec = 10; 26 | files = ( 27 | ); 28 | name = "Embed Frameworks"; 29 | runOnlyForDeploymentPostprocessing = 0; 30 | }; 31 | /* End PBXCopyFilesBuildPhase section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 35 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 36 | 29616E64D712A881148CA1D2 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 37 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 38 | 44818CA6DC66BEAEA0F8BA83 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 57B2E364D2321BD5B52141DB /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 40 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 41 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 42 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 43 | 876F4B10E15837D508D90B36 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 44 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 45 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 46 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 48 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 49 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 50 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 51 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | 732C603CF937B061C3D704EF /* libPods-Runner.a in Frameworks */, 60 | ); 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | /* End PBXFrameworksBuildPhase section */ 64 | 65 | /* Begin PBXGroup section */ 66 | 9740EEB11CF90186004384FC /* Flutter */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 70 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 71 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 72 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 73 | ); 74 | name = Flutter; 75 | sourceTree = ""; 76 | }; 77 | 97C146E51CF9000F007C117D = { 78 | isa = PBXGroup; 79 | children = ( 80 | 9740EEB11CF90186004384FC /* Flutter */, 81 | 97C146F01CF9000F007C117D /* Runner */, 82 | 97C146EF1CF9000F007C117D /* Products */, 83 | D5877A8181BEBA84F33D4822 /* Pods */, 84 | BFF1C2684319C87CD8965E88 /* Frameworks */, 85 | ); 86 | sourceTree = ""; 87 | }; 88 | 97C146EF1CF9000F007C117D /* Products */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 97C146EE1CF9000F007C117D /* Runner.app */, 92 | ); 93 | name = Products; 94 | sourceTree = ""; 95 | }; 96 | 97C146F01CF9000F007C117D /* Runner */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 100 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 101 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 102 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 103 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 104 | 97C147021CF9000F007C117D /* Info.plist */, 105 | 97C146F11CF9000F007C117D /* Supporting Files */, 106 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 107 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 108 | ); 109 | path = Runner; 110 | sourceTree = ""; 111 | }; 112 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 97C146F21CF9000F007C117D /* main.m */, 116 | ); 117 | name = "Supporting Files"; 118 | sourceTree = ""; 119 | }; 120 | BFF1C2684319C87CD8965E88 /* Frameworks */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 44818CA6DC66BEAEA0F8BA83 /* libPods-Runner.a */, 124 | ); 125 | name = Frameworks; 126 | sourceTree = ""; 127 | }; 128 | D5877A8181BEBA84F33D4822 /* Pods */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 876F4B10E15837D508D90B36 /* Pods-Runner.debug.xcconfig */, 132 | 57B2E364D2321BD5B52141DB /* Pods-Runner.release.xcconfig */, 133 | 29616E64D712A881148CA1D2 /* Pods-Runner.profile.xcconfig */, 134 | ); 135 | name = Pods; 136 | path = Pods; 137 | sourceTree = ""; 138 | }; 139 | /* End PBXGroup section */ 140 | 141 | /* Begin PBXNativeTarget section */ 142 | 97C146ED1CF9000F007C117D /* Runner */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 145 | buildPhases = ( 146 | 1679EA4271716310ED90F64E /* [CP] Check Pods Manifest.lock */, 147 | 9740EEB61CF901F6004384FC /* Run Script */, 148 | 97C146EA1CF9000F007C117D /* Sources */, 149 | 97C146EB1CF9000F007C117D /* Frameworks */, 150 | 97C146EC1CF9000F007C117D /* Resources */, 151 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 152 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 153 | ); 154 | buildRules = ( 155 | ); 156 | dependencies = ( 157 | ); 158 | name = Runner; 159 | productName = Runner; 160 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 161 | productType = "com.apple.product-type.application"; 162 | }; 163 | /* End PBXNativeTarget section */ 164 | 165 | /* Begin PBXProject section */ 166 | 97C146E61CF9000F007C117D /* Project object */ = { 167 | isa = PBXProject; 168 | attributes = { 169 | LastUpgradeCheck = 1300; 170 | ORGANIZATIONNAME = ""; 171 | TargetAttributes = { 172 | 97C146ED1CF9000F007C117D = { 173 | CreatedOnToolsVersion = 7.3.1; 174 | }; 175 | }; 176 | }; 177 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 178 | compatibilityVersion = "Xcode 9.3"; 179 | developmentRegion = en; 180 | hasScannedForEncodings = 0; 181 | knownRegions = ( 182 | en, 183 | Base, 184 | ); 185 | mainGroup = 97C146E51CF9000F007C117D; 186 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 187 | projectDirPath = ""; 188 | projectRoot = ""; 189 | targets = ( 190 | 97C146ED1CF9000F007C117D /* Runner */, 191 | ); 192 | }; 193 | /* End PBXProject section */ 194 | 195 | /* Begin PBXResourcesBuildPhase section */ 196 | 97C146EC1CF9000F007C117D /* Resources */ = { 197 | isa = PBXResourcesBuildPhase; 198 | buildActionMask = 2147483647; 199 | files = ( 200 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 201 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 202 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 203 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 204 | ); 205 | runOnlyForDeploymentPostprocessing = 0; 206 | }; 207 | /* End PBXResourcesBuildPhase section */ 208 | 209 | /* Begin PBXShellScriptBuildPhase section */ 210 | 1679EA4271716310ED90F64E /* [CP] Check Pods Manifest.lock */ = { 211 | isa = PBXShellScriptBuildPhase; 212 | buildActionMask = 2147483647; 213 | files = ( 214 | ); 215 | inputFileListPaths = ( 216 | ); 217 | inputPaths = ( 218 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 219 | "${PODS_ROOT}/Manifest.lock", 220 | ); 221 | name = "[CP] Check Pods Manifest.lock"; 222 | outputFileListPaths = ( 223 | ); 224 | outputPaths = ( 225 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 226 | ); 227 | runOnlyForDeploymentPostprocessing = 0; 228 | shellPath = /bin/sh; 229 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 230 | showEnvVarsInLog = 0; 231 | }; 232 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 233 | isa = PBXShellScriptBuildPhase; 234 | buildActionMask = 2147483647; 235 | files = ( 236 | ); 237 | inputPaths = ( 238 | ); 239 | name = "Thin Binary"; 240 | outputPaths = ( 241 | ); 242 | runOnlyForDeploymentPostprocessing = 0; 243 | shellPath = /bin/sh; 244 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 245 | }; 246 | 9740EEB61CF901F6004384FC /* Run Script */ = { 247 | isa = PBXShellScriptBuildPhase; 248 | buildActionMask = 2147483647; 249 | files = ( 250 | ); 251 | inputPaths = ( 252 | ); 253 | name = "Run Script"; 254 | outputPaths = ( 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | shellPath = /bin/sh; 258 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 259 | }; 260 | /* End PBXShellScriptBuildPhase section */ 261 | 262 | /* Begin PBXSourcesBuildPhase section */ 263 | 97C146EA1CF9000F007C117D /* Sources */ = { 264 | isa = PBXSourcesBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 268 | 97C146F31CF9000F007C117D /* main.m in Sources */, 269 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 270 | ); 271 | runOnlyForDeploymentPostprocessing = 0; 272 | }; 273 | /* End PBXSourcesBuildPhase section */ 274 | 275 | /* Begin PBXVariantGroup section */ 276 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 277 | isa = PBXVariantGroup; 278 | children = ( 279 | 97C146FB1CF9000F007C117D /* Base */, 280 | ); 281 | name = Main.storyboard; 282 | sourceTree = ""; 283 | }; 284 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 285 | isa = PBXVariantGroup; 286 | children = ( 287 | 97C147001CF9000F007C117D /* Base */, 288 | ); 289 | name = LaunchScreen.storyboard; 290 | sourceTree = ""; 291 | }; 292 | /* End PBXVariantGroup section */ 293 | 294 | /* Begin XCBuildConfiguration section */ 295 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 296 | isa = XCBuildConfiguration; 297 | buildSettings = { 298 | ALWAYS_SEARCH_USER_PATHS = NO; 299 | CLANG_ANALYZER_NONNULL = YES; 300 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 301 | CLANG_CXX_LIBRARY = "libc++"; 302 | CLANG_ENABLE_MODULES = YES; 303 | CLANG_ENABLE_OBJC_ARC = YES; 304 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 305 | CLANG_WARN_BOOL_CONVERSION = YES; 306 | CLANG_WARN_COMMA = YES; 307 | CLANG_WARN_CONSTANT_CONVERSION = YES; 308 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 309 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 310 | CLANG_WARN_EMPTY_BODY = YES; 311 | CLANG_WARN_ENUM_CONVERSION = YES; 312 | CLANG_WARN_INFINITE_RECURSION = YES; 313 | CLANG_WARN_INT_CONVERSION = YES; 314 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 315 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 316 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 317 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 318 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 319 | CLANG_WARN_STRICT_PROTOTYPES = YES; 320 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 321 | CLANG_WARN_UNREACHABLE_CODE = YES; 322 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 323 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 324 | COPY_PHASE_STRIP = NO; 325 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 326 | ENABLE_NS_ASSERTIONS = NO; 327 | ENABLE_STRICT_OBJC_MSGSEND = YES; 328 | GCC_C_LANGUAGE_STANDARD = gnu99; 329 | GCC_NO_COMMON_BLOCKS = YES; 330 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 331 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 332 | GCC_WARN_UNDECLARED_SELECTOR = YES; 333 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 334 | GCC_WARN_UNUSED_FUNCTION = YES; 335 | GCC_WARN_UNUSED_VARIABLE = YES; 336 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 337 | MTL_ENABLE_DEBUG_INFO = NO; 338 | SDKROOT = iphoneos; 339 | SUPPORTED_PLATFORMS = iphoneos; 340 | TARGETED_DEVICE_FAMILY = "1,2"; 341 | VALIDATE_PRODUCT = YES; 342 | }; 343 | name = Profile; 344 | }; 345 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 346 | isa = XCBuildConfiguration; 347 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 348 | buildSettings = { 349 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 350 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 351 | ENABLE_BITCODE = NO; 352 | FRAMEWORK_SEARCH_PATHS = ( 353 | "$(inherited)", 354 | "$(PROJECT_DIR)/Flutter", 355 | ); 356 | INFOPLIST_FILE = Runner/Info.plist; 357 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 358 | LIBRARY_SEARCH_PATHS = ( 359 | "$(inherited)", 360 | "$(PROJECT_DIR)/Flutter", 361 | ); 362 | PRODUCT_BUNDLE_IDENTIFIER = com.jm.flutterDio; 363 | PRODUCT_NAME = "$(TARGET_NAME)"; 364 | VERSIONING_SYSTEM = "apple-generic"; 365 | }; 366 | name = Profile; 367 | }; 368 | 97C147031CF9000F007C117D /* Debug */ = { 369 | isa = XCBuildConfiguration; 370 | buildSettings = { 371 | ALWAYS_SEARCH_USER_PATHS = NO; 372 | CLANG_ANALYZER_NONNULL = YES; 373 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 374 | CLANG_CXX_LIBRARY = "libc++"; 375 | CLANG_ENABLE_MODULES = YES; 376 | CLANG_ENABLE_OBJC_ARC = YES; 377 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 378 | CLANG_WARN_BOOL_CONVERSION = YES; 379 | CLANG_WARN_COMMA = YES; 380 | CLANG_WARN_CONSTANT_CONVERSION = YES; 381 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 382 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 383 | CLANG_WARN_EMPTY_BODY = YES; 384 | CLANG_WARN_ENUM_CONVERSION = YES; 385 | CLANG_WARN_INFINITE_RECURSION = YES; 386 | CLANG_WARN_INT_CONVERSION = YES; 387 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 388 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 389 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 390 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 391 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 392 | CLANG_WARN_STRICT_PROTOTYPES = YES; 393 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 394 | CLANG_WARN_UNREACHABLE_CODE = YES; 395 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 396 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 397 | COPY_PHASE_STRIP = NO; 398 | DEBUG_INFORMATION_FORMAT = dwarf; 399 | ENABLE_STRICT_OBJC_MSGSEND = YES; 400 | ENABLE_TESTABILITY = YES; 401 | GCC_C_LANGUAGE_STANDARD = gnu99; 402 | GCC_DYNAMIC_NO_PIC = NO; 403 | GCC_NO_COMMON_BLOCKS = YES; 404 | GCC_OPTIMIZATION_LEVEL = 0; 405 | GCC_PREPROCESSOR_DEFINITIONS = ( 406 | "DEBUG=1", 407 | "$(inherited)", 408 | ); 409 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 410 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 411 | GCC_WARN_UNDECLARED_SELECTOR = YES; 412 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 413 | GCC_WARN_UNUSED_FUNCTION = YES; 414 | GCC_WARN_UNUSED_VARIABLE = YES; 415 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 416 | MTL_ENABLE_DEBUG_INFO = YES; 417 | ONLY_ACTIVE_ARCH = YES; 418 | SDKROOT = iphoneos; 419 | TARGETED_DEVICE_FAMILY = "1,2"; 420 | }; 421 | name = Debug; 422 | }; 423 | 97C147041CF9000F007C117D /* Release */ = { 424 | isa = XCBuildConfiguration; 425 | buildSettings = { 426 | ALWAYS_SEARCH_USER_PATHS = NO; 427 | CLANG_ANALYZER_NONNULL = YES; 428 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 429 | CLANG_CXX_LIBRARY = "libc++"; 430 | CLANG_ENABLE_MODULES = YES; 431 | CLANG_ENABLE_OBJC_ARC = YES; 432 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 433 | CLANG_WARN_BOOL_CONVERSION = YES; 434 | CLANG_WARN_COMMA = YES; 435 | CLANG_WARN_CONSTANT_CONVERSION = YES; 436 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 437 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 438 | CLANG_WARN_EMPTY_BODY = YES; 439 | CLANG_WARN_ENUM_CONVERSION = YES; 440 | CLANG_WARN_INFINITE_RECURSION = YES; 441 | CLANG_WARN_INT_CONVERSION = YES; 442 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 443 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 444 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 445 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 446 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 447 | CLANG_WARN_STRICT_PROTOTYPES = YES; 448 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 449 | CLANG_WARN_UNREACHABLE_CODE = YES; 450 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 451 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 452 | COPY_PHASE_STRIP = NO; 453 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 454 | ENABLE_NS_ASSERTIONS = NO; 455 | ENABLE_STRICT_OBJC_MSGSEND = YES; 456 | GCC_C_LANGUAGE_STANDARD = gnu99; 457 | GCC_NO_COMMON_BLOCKS = YES; 458 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 459 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 460 | GCC_WARN_UNDECLARED_SELECTOR = YES; 461 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 462 | GCC_WARN_UNUSED_FUNCTION = YES; 463 | GCC_WARN_UNUSED_VARIABLE = YES; 464 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 465 | MTL_ENABLE_DEBUG_INFO = NO; 466 | SDKROOT = iphoneos; 467 | SUPPORTED_PLATFORMS = iphoneos; 468 | TARGETED_DEVICE_FAMILY = "1,2"; 469 | VALIDATE_PRODUCT = YES; 470 | }; 471 | name = Release; 472 | }; 473 | 97C147061CF9000F007C117D /* Debug */ = { 474 | isa = XCBuildConfiguration; 475 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 476 | buildSettings = { 477 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 478 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 479 | ENABLE_BITCODE = NO; 480 | FRAMEWORK_SEARCH_PATHS = ( 481 | "$(inherited)", 482 | "$(PROJECT_DIR)/Flutter", 483 | ); 484 | INFOPLIST_FILE = Runner/Info.plist; 485 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 486 | LIBRARY_SEARCH_PATHS = ( 487 | "$(inherited)", 488 | "$(PROJECT_DIR)/Flutter", 489 | ); 490 | PRODUCT_BUNDLE_IDENTIFIER = com.jm.flutterDio; 491 | PRODUCT_NAME = "$(TARGET_NAME)"; 492 | VERSIONING_SYSTEM = "apple-generic"; 493 | }; 494 | name = Debug; 495 | }; 496 | 97C147071CF9000F007C117D /* Release */ = { 497 | isa = XCBuildConfiguration; 498 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 499 | buildSettings = { 500 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 501 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 502 | ENABLE_BITCODE = NO; 503 | FRAMEWORK_SEARCH_PATHS = ( 504 | "$(inherited)", 505 | "$(PROJECT_DIR)/Flutter", 506 | ); 507 | INFOPLIST_FILE = Runner/Info.plist; 508 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 509 | LIBRARY_SEARCH_PATHS = ( 510 | "$(inherited)", 511 | "$(PROJECT_DIR)/Flutter", 512 | ); 513 | PRODUCT_BUNDLE_IDENTIFIER = com.jm.flutterDio; 514 | PRODUCT_NAME = "$(TARGET_NAME)"; 515 | VERSIONING_SYSTEM = "apple-generic"; 516 | }; 517 | name = Release; 518 | }; 519 | /* End XCBuildConfiguration section */ 520 | 521 | /* Begin XCConfigurationList section */ 522 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 523 | isa = XCConfigurationList; 524 | buildConfigurations = ( 525 | 97C147031CF9000F007C117D /* Debug */, 526 | 97C147041CF9000F007C117D /* Release */, 527 | 249021D3217E4FDB00AE95B9 /* Profile */, 528 | ); 529 | defaultConfigurationIsVisible = 0; 530 | defaultConfigurationName = Release; 531 | }; 532 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 533 | isa = XCConfigurationList; 534 | buildConfigurations = ( 535 | 97C147061CF9000F007C117D /* Debug */, 536 | 97C147071CF9000F007C117D /* Release */, 537 | 249021D4217E4FDB00AE95B9 /* Profile */, 538 | ); 539 | defaultConfigurationIsVisible = 0; 540 | defaultConfigurationName = Release; 541 | }; 542 | /* End XCConfigurationList section */ 543 | }; 544 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 545 | } 546 | --------------------------------------------------------------------------------