Skip to content

Commit

Permalink
Updated to newer version of the Flutter.
Browse files Browse the repository at this point in the history
Compatible with Odoo 16.0.
Upgraded the dependencies.
  • Loading branch information
mustafal committed May 25, 2023
1 parent 8cfc28d commit 6165d7f
Show file tree
Hide file tree
Showing 19 changed files with 268 additions and 229 deletions.
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\device_info-2.0.2\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.2\\\\","dependencies":[]},{"name":"shared_preferences","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences-2.0.6\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.0+3\\\\","dependencies":[]}],"android":[{"name":"device_info","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\device_info-2.0.2\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.2\\\\","dependencies":[]},{"name":"shared_preferences","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences-2.0.6\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.0+3\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.0\\\\","dependencies":[]},{"name":"shared_preferences_macos","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_macos-2.0.0\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.0+3\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.0.0\\\\","dependencies":[]},{"name":"shared_preferences_linux","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_linux-2.0.0\\\\","dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.1\\\\","dependencies":[]},{"name":"shared_preferences_windows","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_windows-2.0.0\\\\","dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_web-2.0.0\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"device_info","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sqflite","dependencies":[]}],"date_created":"2021-05-30 15:17:35.114536","version":"2.2.0"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info_plus","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.1\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.2.3\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_foundation-2.2.2\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite-2.2.8+4\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"device_info_plus","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.1\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.0.27\\\\","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_android-2.1.4\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite-2.2.8+4\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"device_info_plus","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.1\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.2.3\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_foundation-2.2.2\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite-2.2.8+4\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"device_info_plus","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.1\\\\","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.1.11\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_linux-2.2.0\\\\","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"device_info_plus","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.1\\\\","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.1.6\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_windows-2.2.0\\\\","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"device_info_plus","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.1\\\\","dependencies":[]},{"name":"shared_preferences_web","path":"C:\\\\Users\\\\lokha\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_web-2.1.0\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"device_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sqflite","dependencies":[]}],"date_created":"2023-05-25 22:27:36.979710","version":"3.10.2"}
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30
compileSdkVersion 33

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.8.20'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -24,6 +24,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
7 changes: 3 additions & 4 deletions ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\src\flutter"
export "FLUTTER_APPLICATION_PATH=F:\Work\Flutter Work\odoo_common_code_latest"
export "FLUTTER_APPLICATION_PATH=F:\Work\Flutter Work\Odoo-JsonRpc-with-Flutter"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build\ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
12 changes: 6 additions & 6 deletions lib/common/api_factory/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
import 'package:odoo_common_code_latest/common/api_factory/api_end_points.dart';
import 'package:odoo_common_code_latest/common/api_factory/dio_factory.dart';
import 'package:uuid/uuid.dart';
import 'package:odoo_common_code_latest/common/api_factory/models/version_info_response.dart';
import 'package:odoo_common_code_latest/common/config/config.dart';
import 'package:odoo_common_code_latest/common/config/prefs/pref_utils.dart';
import 'package:odoo_common_code_latest/common/utils/utils.dart';
import 'package:odoo_common_code_latest/common/widgets/log.dart';
import 'package:odoo_common_code_latest/src/authentication/models/user_model.dart';
import 'package:odoo_common_code_latest/common/api_factory/models/version_info_response.dart';
import 'package:odoo_common_code_latest/common/config/config.dart';
import 'package:uuid/uuid.dart';

enum ApiEnvironment { UAT, Dev, Prod }

Expand Down Expand Up @@ -54,12 +54,12 @@ class Api {
print(e);
}
if (e is DioError) {
if (e.type == DioErrorType.connectTimeout ||
if (e.type == DioErrorType.connectionTimeout ||
e.type == DioErrorType.sendTimeout ||
e.type == DioErrorType.receiveTimeout ||
e.type == DioErrorType.other) {
e.type == DioErrorType.unknown) {
onError('Server unreachable', {});
} else if (e.type == DioErrorType.response) {
} else if (e.type == DioErrorType.badResponse) {
final response = e.response;
if (response != null) {
final data = response.data;
Expand Down
23 changes: 5 additions & 18 deletions lib/common/api_factory/dio_factory.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:developer' show log;
import 'dart:io';
import 'package:device_info/device_info.dart';
import 'package:dio/adapter.dart';

import 'package:device_info_plus/device_info_plus.dart';
import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
import 'package:odoo_common_code_latest/common/api_factory/api.dart';
Expand Down Expand Up @@ -61,9 +61,9 @@ class DioFactory {
HttpHeaders.authorizationHeader: _authorization,
'Keep-Alive': Config.timeout,
},
connectTimeout: Config.timeout,
receiveTimeout: Config.timeout,
sendTimeout: Config.timeout,
connectTimeout: Duration(seconds: Config.timeout),
receiveTimeout: Duration(seconds: Config.timeout),
sendTimeout: Duration(seconds: Config.timeout),
contentType: Headers.jsonContentType,
),
);
Expand All @@ -80,18 +80,5 @@ class DioFactory {
},
));
}
if (Config.selfSignedCert) {
final httpClientAdapter =
_dio!.httpClientAdapter as DefaultHttpClientAdapter;
httpClientAdapter.onHttpClientCreate = _onHttpClientCreate;
}
}

dynamic _onHttpClientCreate(HttpClient client) {
client.badCertificateCallback = _badCertificateCallback;
}

bool _badCertificateCallback(X509Certificate cert, String host, int port) {
return true;
}
}
1 change: 1 addition & 0 deletions lib/common/api_factory/modules/authentication_module.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:convert';

import 'package:get/get.dart';
import 'package:odoo_common_code_latest/common/api_factory/api.dart';
import 'package:odoo_common_code_latest/common/config/config.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/common/app.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:developer';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
Expand Down
6 changes: 3 additions & 3 deletions lib/common/config/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ class Config {
Config._();

///Odoo URLs
static const String OdooDevURL = "https://7983981-14-0-all.runbot36.odoo.com/";
static const String OdooProdURL = "https://7983981-14-0-all.runbot36.odoo.com/";
static const String OdooUATURL = "https://7983981-14-0-all.runbot36.odoo.com/";
static const String OdooDevURL = "https://40767647-16-0-all.runbot153.odoo.com/";
static const String OdooProdURL = "https://40767647-16-0-all.runbot153.odoo.com/";
static const String OdooUATURL = "https://40767647-16-0-all.runbot153.odoo.com/";

/// SelfSignedCert:
static const selfSignedCert = false;
Expand Down
1 change: 1 addition & 0 deletions lib/common/config/localization/translations.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:get/get.dart';

import 'en.dart';

class AppTranslations extends Translations {
Expand Down
1 change: 1 addition & 0 deletions lib/common/config/prefs/pref_utils.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:convert';

import 'package:odoo_common_code_latest/common/config/prefs/pref_keys.dart';
import 'package:odoo_common_code_latest/src/authentication/models/user_model.dart';
import 'package:shared_preferences/shared_preferences.dart';
Expand Down
4 changes: 1 addition & 3 deletions lib/common/widgets/custom_button.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class CustomButton extends StatelessWidget {
var onPress;
Expand All @@ -20,7 +18,7 @@ class CustomButton extends StatelessWidget {
),
textColor: Colors.white,
child: child,
color: color ?? Theme.of(context).accentColor,
color: color ?? Theme.of(context).buttonTheme.colorScheme?.onSecondary,
);
}
}
3 changes: 1 addition & 2 deletions lib/src/authentication/models/user_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class UserModel {
int? companyId;
int? partnerId;
String? webBaseUrl;
String? showEffect;
bool? showEffect;
bool? displaySwitchCompanyMenu;
int? maxTimeBetweenKeysInMs;
bool? outOfOfficeMessage;
Expand Down Expand Up @@ -89,4 +89,3 @@ class Currency {
"digits": List<dynamic>.from(digits!.map((x) => x)),
};
}

1 change: 0 additions & 1 deletion lib/src/home/controller/home_controller.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:get/get.dart';
import 'package:odoo_common_code_latest/common/api_factory/modules/home_api_module.dart';
import 'package:odoo_common_code_latest/common/utils/utils.dart';
import 'package:odoo_common_code_latest/src/home/model/res_partner_model.dart';

class HomeController extends GetxController {
Expand Down
1 change: 0 additions & 1 deletion lib/src/home/view/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:odoo_common_code_latest/common/config/app_colors.dart';
import 'package:odoo_common_code_latest/common/utils/utils.dart';
import 'package:odoo_common_code_latest/common/widgets/log.dart';
import 'package:odoo_common_code_latest/common/widgets/main_container.dart';
import 'package:odoo_common_code_latest/src/home/controller/home_controller.dart';

Expand Down
Loading

0 comments on commit 6165d7f

Please sign in to comment.