2020-04-15 09:13:39 +00:00
|
|
|
import 'dart:io';
|
|
|
|
|
2019-06-24 16:05:30 +00:00
|
|
|
import 'package:comunic/main.dart';
|
|
|
|
import 'package:comunic/models/config.dart';
|
2021-03-14 16:50:45 +00:00
|
|
|
import 'package:comunic/utils/flutter_utils.dart';
|
2019-06-24 16:05:30 +00:00
|
|
|
|
|
|
|
/// Dev (internal) build configuration for the project
|
|
|
|
///
|
|
|
|
/// @author Pierre HUBERT
|
|
|
|
|
2020-04-15 09:13:39 +00:00
|
|
|
/// Fix HTTPS issue
|
|
|
|
class MyHttpOverride extends HttpOverrides {
|
|
|
|
@override
|
|
|
|
HttpClient createHttpClient(SecurityContext context) {
|
|
|
|
return super.createHttpClient(context)
|
|
|
|
..badCertificateCallback = (cert, host, port) {
|
|
|
|
return host == "devweb.local"; // Forcefully trust local website
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-24 16:05:30 +00:00
|
|
|
void main() {
|
|
|
|
Config.set(Config(
|
2020-03-30 20:43:46 +00:00
|
|
|
apiServerName: "192.168.1.9:3000",
|
|
|
|
apiServerUri: "/",
|
2019-11-02 17:16:16 +00:00
|
|
|
apiServerSecure: false,
|
2021-03-14 16:50:45 +00:00
|
|
|
clientName: isWeb ? "FlutterWeb" : "ComunicFlutter",
|
2019-11-02 17:16:16 +00:00
|
|
|
));
|
2019-06-24 16:05:30 +00:00
|
|
|
|
2020-04-15 09:13:39 +00:00
|
|
|
HttpOverrides.global = new MyHttpOverride();
|
|
|
|
|
2019-06-24 16:05:30 +00:00
|
|
|
subMain();
|
|
|
|
}
|