Skip to content

Commit

Permalink
Setup dio
Browse files Browse the repository at this point in the history
  • Loading branch information
dhafinrayhan committed Nov 8, 2023
1 parent c1a3b84 commit d478114
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
1 change: 0 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ analyzer:
invalid_annotation_target: ignore
language:
strict-casts: true
strict-inference: true
strict-raw-types: true
plugins:
- custom_lint
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:label="DummyMart"
android:name="${applicationName}"
Expand Down
12 changes: 12 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

void main() {
HttpOverrides.global = _HttpOverrides();

runApp(const ProviderScope(child: DummyMartApp()));
}

Expand Down Expand Up @@ -36,3 +40,11 @@ class HomeScreen extends StatelessWidget {
);
}
}

class _HttpOverrides extends HttpOverrides {
@override
HttpClient createHttpClient(SecurityContext? context) {
return super.createHttpClient(context)
..badCertificateCallback = (_, __, ___) => true;
}
}
8 changes: 8 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.3"
dio:
dependency: "direct main"
description:
name: dio
sha256: "417e2a6f9d83ab396ec38ff4ea5da6c254da71e4db765ad737a42af6930140b7"
url: "https://pub.dev"
source: hosted
version: "5.3.3"
fake_async:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ environment:
sdk: '>=3.1.5 <4.0.0'

dependencies:
dio: ^5.3.3
flutter:
sdk: flutter
flutter_hooks: ^0.20.3
Expand Down

0 comments on commit d478114

Please sign in to comment.