File tree Expand file tree Collapse file tree 4 files changed +6
-33
lines changed Expand file tree Collapse file tree 4 files changed +6
-33
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import 'dart:convert';
33import 'package:flutter/material.dart' ;
44import 'package:http/http.dart' ;
55import 'package:http_interceptor/http_interceptor.dart' ;
6- import 'package:http_interceptor_example/ credentials.dart' ; // If you are going to run this example you need to replace the key.
6+ import 'credentials.dart' ; // If you are going to run this example you need to replace the key.
77import 'cities.dart' ; // This is just a List of Maps that contains the suggested cities.
88
99void main () => runApp (MyApp ());
Original file line number Diff line number Diff line change 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.
71
8- import 'package:flutter/material.dart' ;
9- import 'package:flutter_test/flutter_test.dart' ;
10-
11- import 'package:http_interceptor_example/main.dart' ;
12-
13- void main () {
14- testWidgets ('Verify Platform version' , (WidgetTester tester) async {
15- // Build our app and trigger a frame.
16- await tester.pumpWidget (MyApp ());
17-
18- // Verify that platform version is retrieved.
19- expect (
20- find.byWidgetPredicate (
21- (Widget widget) => widget is Text &&
22- widget.data.startsWith ('Running on:' ),
23- ),
24- findsOneWidget,
25- );
26- });
27- }
Original file line number Diff line number Diff line change 11import 'dart:convert' ;
2- import 'package:collection/collection.dart' ;
32import 'package:http/http.dart' ;
43
54import 'package:http_interceptor/http_methods.dart' ;
@@ -38,9 +37,9 @@ class RequestData {
3837 if (body is String ) {
3938 request.body = body;
4039 } else if (body is List ) {
41- request.bodyBytes = DelegatingList . typed (body );
40+ request.bodyBytes = body. cast < int >( );
4241 } else if (body is Map ) {
43- request.bodyFields = DelegatingMap . typed (body );
42+ request.bodyFields = body. cast < String , String >( );
4443 } else {
4544 throw new ArgumentError ('Invalid request body "$body ".' );
4645 }
Original file line number Diff line number Diff line change 11name : http_interceptor
2- description : A new flutter plugin project .
2+ description : A Plugin that allows you to intercept request and response objects and modify them if desired .
33version : 0.0.1
4- author :
5- homepage :
4+ author :
Alejandro Ulate (codingalecr) <[email protected] > 5+ homepage : https://github.com/CodingAleCR/http_interceptor
66
77environment :
88 sdk : " >=2.1.0 <3.0.0"
You can’t perform that action at this time.
0 commit comments