We have an app built in flutter everything is connecting quite well however when we run the app in debug mode we get an error.
The base url has been set within another class which works fine.
If i take the base url + the url snippet in the code below and paste it in a browser it works 100%, but not when running it within the app
Here is the code snippet below
**@override
Future<SplashResponse> splashData() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>> (
'/pos/web?config_id=1#action=pos.ui&cids=1/splashdata',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = SplashResponse.fromJson(_result.data);
return value;
}**
The above code gives of an Exception error
Here are the logs
[log] MySharedPref-> null
I/flutter (12057): --> GET https://erpdemo.appxtreme.co.za/pos/web?config_id=1#action=pos.ui&cids=1/splashdata
I/flutter (12057): Headers:
I/flutter (12057): Authorization: cwpsysD0tp1mpl#
I/flutter (12057): Accept: application/json
I/flutter (12057): content-type: text/plain
I/flutter (12057): Login: null
I/flutter (12057): queryParameters:
I/flutter (12057): Body: {}
I/flutter (12057): --> END GET
I/flutter (12057): 200--> GET https://erpdemo.appxtreme.co.za/pos/web?config_id=1#action=pos.ui&cids=1/splashdata
[log] response: ->
<!DOCTYPE html>
<html style="height: 100%;">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>
<title>ERP</title>
<link type="image/x-icon" rel="shortcut icon" href="/web/static/src/img/favicon.ico"/>
<link type="text/css" rel="stylesheet" href="/web/content/2086-67b044e/web.assets_common.css"/>
<link type="text/css" rel="stylesheet" href="/web/content/2087-6dba58d/web.assets_frontend.css"/>
<script type="text/javascript">
var odoo = {
csrf_token: "189c6000060bdb888fab768c666efcfd02b0f1f1o",
debug: "",
};
</script>
<script type="text/javascript">
odoo.session_info = {"is_admin": false, "is_system": false, "is_website_user": false, "user_id": false, "is_frontend": true, "translationURL": "/website/translations", "cache_hashes": {"translations": "f568e808869e9f2daadf9b03e6cf575dc1feef78"}};
</script>
<script defer="defer" type="text/javascript" src="/web/content/2088-486a751/web.assets_common_minimal_js.js"></script>
<script defer="defer" type="text/javascript" src="/web/content/2089-be897af/web.assets_frontend_minimal_js.js"></script>
<script defer="defer" type="text/javascript" data-src="/web/content/2090-1c86fec/web.assets_common_lazy.js"></script>
<script defer="defer" type="text/javascript" data-src="/web/content/2091-1683bd0/web.assets_frontend_lazy.js"></script>
</head>
<body class="o_home_menu_background">
<link rel="stylesheet" href="/web/static/_custom/style.css"/>
<div id="wrapwrap" class=" ">
<main>
<div class="container py-5">
<div style="max-width: 300px;" class="card border-0 mx-auto bg-100 rounded-0 shadow-sm bg-white o_database_list">
<div class="card-body">
<div class="text-center pb-3 border-bottom mb-4">
<img alt="Logo" style="max-height:120px; max-width: 100%; width:auto" src="/web/binary/company_logo"/>
</div>
<form class="oe_login_form" role="form" method="post" onsubmit="this.action = this.action + location.hash" action="/web/login">
<input type="hidden" name="csrf_token" value="0c70f6a46a3f4f0bcecda2e06da78e5d54bec2a5o1641827119"/>
<div class="form-group field-login">
<label for="login">Email</label>
<input type="text" placeholder="Email" name="login" id="login" required="required" autofocus="autofocus" autocapitalize="off" class="form-control "/>
</div>
<div class="form-group field-password">
<label for="password">Password</label>
<input type="password" placeholder="Password" name="password" id="password" required="required" autocomplete="current-password" maxlength="4096" class="form-control "/>
</div>
<div class="clearfix oe_login_buttons text-center mb-1 pt-3">
<button type="submit" class="btn btn-primary btn-block">Log in</button>
<div class="justify-content-between mt-2 d-flex small">
<a href="/web/signup?redirect=https%3A%2F%2Ferpdemo.appxtreme.co.za%2Fpos%2Fweb%3Fconfig_id%3D1">Don't have an account?</a>
<a href="/web/reset_password?redirect=https%3A%2F%2Ferpdemo.appxtreme.co.za%2Fpos%2Fweb%3Fconfig_id%3D1">Reset Password</a>
</div>
<div class="o_login_auth"></div>
</div>
<input type="hidden" name="redirect" value="https://erpdemo.appxtreme.co.za/pos/web?config_id=1"/>
</form>
<div class="text-center small mt-4 pt-3 border-top">
<a class="border-right pr-2 mr-1" href="/web/database/manager">Manage Databases</a>
</div>
</div>
</div>
</div>
</main>
</div>
</body>
</html>
If anyone can provide some insight as to why this error would occurr and maybe a possible fix it would be of great help
Regards