File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1+ import 'package:http/http.dart' as http;
12import 'dart:async' show StreamSubscription;
23import 'dart:io' ;
34import 'dart:convert' ;
@@ -22,6 +23,18 @@ ColorScheme colorSchemeFromContext(BuildContext context) {
2223 }
2324}
2425
26+ class MyHTTPClient extends http.BaseClient {
27+ final http.Client _inner;
28+
29+ MyHTTPClient (this ._inner);
30+
31+ @override
32+ Future <http.StreamedResponse > send (http.BaseRequest request) {
33+ request.headers["x-custom-header" ] = "42" ;
34+ return _inner.send (request);
35+ }
36+ }
37+
2538void main () {
2639 if (Platform .isIOS) {
2740 wechatRedirectURI =
@@ -917,6 +930,7 @@ class _MyAppState extends State<MyApp> {
917930 ),
918931 )
919932 : null ,
933+ httpClient: MyHTTPClient (http.Client ()),
920934 );
921935 _sub? .cancel ();
922936 await authgear.configure ();
You can’t perform that action at this time.
0 commit comments