diff --git a/chat_sample/android/app/build.gradle b/chat_sample/android/app/build.gradle index 0e5cc76..e856dfa 100644 --- a/chat_sample/android/app/build.gradle +++ b/chat_sample/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -6,40 +12,21 @@ if (localPropertiesFile.exists()) { } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') ?: '1' +def flutterVersionName = localProperties.getProperty('flutter.versionName') ?: '1.0' android { - compileSdkVersion 33 + namespace 'com.quickblox.chat' + compileSdk 34 sourceSets { main.java.srcDirs += 'src/main/kotlin' } - lintOptions { - disable 'InvalidPackage' - } - defaultConfig { applicationId "com.quickblox.flutter.chat" - minSdkVersion 21 - targetSdkVersion 33 + minSdk 26 + targetSdk 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } @@ -73,12 +60,23 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = '17' + } + + lint { + disable 'InvalidPackage' + } } flutter { source '../..' } -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} +dependencies {} diff --git a/chat_sample/android/app/proguard-rules.pro b/chat_sample/android/app/proguard-rules.pro index f5ac73c..0403d32 100644 --- a/chat_sample/android/app/proguard-rules.pro +++ b/chat_sample/android/app/proguard-rules.pro @@ -1,9 +1,11 @@ # Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. +# By default, the flags in this file are appended to flags specified + +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. # # For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html +# http://developer.android.com/guide/developing/tools/proguard.html # If your project uses WebView with JS, uncomment the following # and specify the fully qualified class name to the JavaScript interface @@ -11,53 +13,41 @@ #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} +#-dontusemixedcaseclassnames +#-dontskipnonpubliclibraryclasses +#-verbose +# -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile +##---------------Begin: proguard configuration for Gson ---------- +# Gson uses generic type information stored in a class file when working with fields. Proguard +# removes such information by default, so configure it to keep all of it. +-keepattributes EnclosingMethod +-keepattributes InnerClasses -keepattributes Signature +-keepattributes Exceptions # For using GSON @Expose annotation -keepattributes *Annotation* -# Gson specific classes --keep class sun.misc.Unsafe { *; } -#-keep class com.google.gson.stream.** { *; } - -# Application classes that will be serialized/deserialized over Gson --keep class com.quickblox.core.account.model.** { *; } - --keep class com.quickblox.auth.parsers.** { *; } --keep class com.quickblox.auth.model.** { *; } --keep class com.quickblox.core.parser.** { *; } --keep class com.quickblox.core.model.** { *; } --keep class com.quickblox.core.server.** { *; } --keep class com.quickblox.core.rest.** { *; } --keep class com.quickblox.core.error.** { *; } --keep class com.quickblox.core.Query { *; } - --keep class com.quickblox.content.model.** { *; } +#quickblox sdk +-keep class com.quickblox.** { *; } --keep class com.quickblox.users.parsers.** { *; } --keep class com.quickblox.users.model.** { *; } - --keep class com.quickblox.messages.parsers.** { *; } --keep class com.quickblox.messages.QBPushNotifications { *; } --keep class com.quickblox.messages.model.** { *; } --keep class com.quickblox.messages.services.** { *; } +#smack xmpp library +-keep class org.jxmpp.** { *; } +-keep class org.jivesoftware.** { *; } +-dontwarn org.jivesoftware.** --keep class com.quickblox.chat.parser.** { *; } --keep class com.quickblox.chat.model.** { *; } +-keep class org.xmlpull.** { *; } +-dontwarn org.xmlpull.v1.** --keep class org.jivesoftware.** { *; } --keep class org.jxmpp.** { *; } +#webrtc -keep class org.webrtc.** { *; } --keep class com.quickblox.conference.** { *; } --keep class com.bumptech.** { *; } +#google gms +-keep class com.google.android.gms.** { *; } + +#json +-keep class org.json.** { *; } --dontwarn org.jivesoftware.smackx.** \ No newline at end of file +#flutter file picker library +-keep class androidx.lifecycle.DefaultLifecycleObserver \ No newline at end of file diff --git a/chat_sample/android/app/src/debug/AndroidManifest.xml b/chat_sample/android/app/src/debug/AndroidManifest.xml index 284f008..f880684 100644 --- a/chat_sample/android/app/src/debug/AndroidManifest.xml +++ b/chat_sample/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/chat_sample/android/app/src/main/AndroidManifest.xml b/chat_sample/android/app/src/main/AndroidManifest.xml index de41d42..1644984 100644 --- a/chat_sample/android/app/src/main/AndroidManifest.xml +++ b/chat_sample/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/chat_sample/android/build.gradle b/chat_sample/android/build.gradle index 4c5a033..bc157bd 100644 --- a/chat_sample/android/build.gradle +++ b/chat_sample/android/build.gradle @@ -1,20 +1,7 @@ -buildscript { - ext.kotlin_version = '1.5.31' - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:4.2.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - allprojects { repositories { google() - jcenter() + mavenCentral() } } @@ -26,6 +13,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/chat_sample/android/gradle.properties b/chat_sample/android/gradle.properties index a673820..b9a9a24 100644 --- a/chat_sample/android/gradle.properties +++ b/chat_sample/android/gradle.properties @@ -1,4 +1,6 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true -android.enableR8=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/chat_sample/android/gradle/wrapper/gradle-wrapper.properties b/chat_sample/android/gradle/wrapper/gradle-wrapper.properties index 939efa2..ded4cb0 100644 --- a/chat_sample/android/gradle/wrapper/gradle-wrapper.properties +++ b/chat_sample/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 23 08:50:38 CEST 2017 +#Mon Oct 21 18:41:33 EEST 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip diff --git a/chat_sample/android/settings.gradle b/chat_sample/android/settings.gradle index 44e62bc..dbdd977 100644 --- a/chat_sample/android/settings.gradle +++ b/chat_sample/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.2.2" apply false + id "org.jetbrains.kotlin.android" version "1.7.10" apply false +} + +include ":app" \ No newline at end of file diff --git a/chat_sample/ios/Flutter/AppFrameworkInfo.plist b/chat_sample/ios/Flutter/AppFrameworkInfo.plist index 4f8d4d2..8c6e561 100644 --- a/chat_sample/ios/Flutter/AppFrameworkInfo.plist +++ b/chat_sample/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/chat_sample/ios/Runner.xcodeproj/project.pbxproj b/chat_sample/ios/Runner.xcodeproj/project.pbxproj index af1cb8e..4694550 100644 --- a/chat_sample/ios/Runner.xcodeproj/project.pbxproj +++ b/chat_sample/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -155,7 +155,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -199,10 +199,12 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -230,6 +232,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); diff --git a/chat_sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/chat_sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a..5e31d3d 100644 --- a/chat_sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/chat_sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ CADisableMinimumFrameDurationOnPhone + UIApplicationSupportsIndirectInputEvents + diff --git a/chat_sample/lib/bloc/app_info/app_info_screen_bloc.dart b/chat_sample/lib/bloc/app_info/app_info_screen_bloc.dart index 9af608e..31bfd09 100644 --- a/chat_sample/lib/bloc/app_info/app_info_screen_bloc.dart +++ b/chat_sample/lib/bloc/app_info/app_info_screen_bloc.dart @@ -1,7 +1,7 @@ import 'package:chat_sample/bloc/app_info/app_info_screen_states.dart'; import 'package:chat_sample/data/settings_repository.dart'; import 'package:flutter/services.dart'; -import 'package:package_info/package_info.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:quickblox_sdk/models/qb_settings.dart'; import '../base_bloc.dart'; diff --git a/chat_sample/lib/bloc/base_bloc.dart b/chat_sample/lib/bloc/base_bloc.dart index cfc188b..26c1787 100644 --- a/chat_sample/lib/bloc/base_bloc.dart +++ b/chat_sample/lib/bloc/base_bloc.dart @@ -34,6 +34,16 @@ class Bloc implements BaseBloc { void setArgs(A args) {} + Future checkInternetConnection() async { + bool isExistInternetConnection = true; + + ConnectionType connectionType = await _deviceRepository.checkInternetConnection(); + if (connectionType == ConnectionType.none) { + isExistInternetConnection = false; + } + return isExistInternetConnection; + } + void dispose() { _eventController?.close(); _stateController?.close(); diff --git a/chat_sample/lib/bloc/chat/chat_screen_bloc.dart b/chat_sample/lib/bloc/chat/chat_screen_bloc.dart index 139cbd1..724fad5 100644 --- a/chat_sample/lib/bloc/chat/chat_screen_bloc.dart +++ b/chat_sample/lib/bloc/chat/chat_screen_bloc.dart @@ -442,6 +442,11 @@ class ChatScreenBloc extends Bloc _connectChat() async { try { + bool isNotExistInternetConnection = !await checkInternetConnection(); + if (isNotExistInternetConnection) { + return; + } + bool connected = await _chatRepository.isConnected() ?? false; if (!connected) { await _chatRepository.connect(_userId, DEFAULT_USER_PASSWORD); diff --git a/chat_sample/lib/bloc/delivered_to/delivered_viewed_screen_bloc.dart b/chat_sample/lib/bloc/delivered_to/delivered_viewed_screen_bloc.dart index f5f4b64..492d72d 100644 --- a/chat_sample/lib/bloc/delivered_to/delivered_viewed_screen_bloc.dart +++ b/chat_sample/lib/bloc/delivered_to/delivered_viewed_screen_bloc.dart @@ -176,6 +176,11 @@ class DeliveredViewedScreenBloc extends Bloc _connectChat() async { try { + bool isNotExistInternetConnection = !await checkInternetConnection(); + if (isNotExistInternetConnection) { + return; + } + bool connected = await _chatRepository.isConnected() ?? false; if (!connected) { await _chatRepository.connect(_userId, DEFAULT_USER_PASSWORD); diff --git a/chat_sample/lib/bloc/dialogs/dialogs_screen_bloc.dart b/chat_sample/lib/bloc/dialogs/dialogs_screen_bloc.dart index ee17995..42e54b0 100644 --- a/chat_sample/lib/bloc/dialogs/dialogs_screen_bloc.dart +++ b/chat_sample/lib/bloc/dialogs/dialogs_screen_bloc.dart @@ -156,6 +156,12 @@ class DialogsScreenBloc extends Bloc _connectChat() async { try { + bool isNotExistInternetConnection = !await checkInternetConnection(); + if (isNotExistInternetConnection) { + return; + } + bool connected = await _chatRepository.isConnected() ?? false; if (!connected) { await _chatRepository.connect(_userId, DEFAULT_USER_PASSWORD); diff --git a/chat_sample/lib/bloc/splash/splash_screen_bloc.dart b/chat_sample/lib/bloc/splash/splash_screen_bloc.dart index 2acab9a..5a0c903 100644 --- a/chat_sample/lib/bloc/splash/splash_screen_bloc.dart +++ b/chat_sample/lib/bloc/splash/splash_screen_bloc.dart @@ -33,7 +33,6 @@ class SplashScreenBloc extends Bloc _setSettings() async { try { await _settingsRepository.init(APPLICATION_ID, AUTH_KEY, AUTH_SECRET, ACCOUNT_KEY); - await _settingsRepository.initStreamManagement(true, 5); // for testing await _settingsRepository.enableXMPPLogging(); await _settingsRepository.enableLogging(); diff --git a/chat_sample/lib/data/custom_objects_repository.dart b/chat_sample/lib/data/custom_objects_repository.dart index 2a04baa..6e6edaf 100644 --- a/chat_sample/lib/data/custom_objects_repository.dart +++ b/chat_sample/lib/data/custom_objects_repository.dart @@ -53,8 +53,7 @@ class CustomObjectsRepository { Future updateCustomObject(String className, String objectId) async { try { - QBCustomObject? customObject = await QB.data.update(className, id: objectId); - String? id = customObject?.id; + List? customObjects = await QB.data.update(className, id: objectId); } on PlatformException catch (e) { throw RepositoryException(e.message); } diff --git a/chat_sample/lib/data/device_repository.dart b/chat_sample/lib/data/device_repository.dart index 739e2f6..5eb38b0 100644 --- a/chat_sample/lib/data/device_repository.dart +++ b/chat_sample/lib/data/device_repository.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'dart:collection'; -import 'package:connectivity/connectivity.dart'; +import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:flutter/services.dart'; /// Created by Injoit in 2021. @@ -17,7 +17,7 @@ class DeviceRepository { DeviceRepository._instance(); final Connectivity _connectivity = Connectivity(); - StreamSubscription? _connectivitySubscription; + StreamSubscription>? _connectivitySubscription; Set _connectionListenersSet = HashSet(); @@ -35,7 +35,7 @@ class DeviceRepository { } Future checkInternetConnection() async { - ConnectivityResult result = ConnectivityResult.none; + List result = [ConnectivityResult.none]; try { result = await _connectivity.checkConnectivity(); } on PlatformException catch (e) { @@ -44,16 +44,13 @@ class DeviceRepository { return _getConnectionType(result); } - ConnectionType _getConnectionType(ConnectivityResult result) { - switch (result) { - case ConnectivityResult.wifi: - return ConnectionType.wifi; - case ConnectivityResult.mobile: - return ConnectionType.mobile; - case ConnectivityResult.none: - return ConnectionType.none; - default: - return ConnectionType.none; + ConnectionType _getConnectionType(List result) { + if (result.contains(ConnectivityResult.wifi)) { + return ConnectionType.wifi; + } else if (result.contains(ConnectivityResult.mobile)) { + return ConnectionType.mobile; + } else { + return ConnectionType.none; } } @@ -73,7 +70,7 @@ class DeviceRepository { } } -class ConnectionListener { +mixin class ConnectionListener { String? tag; void setConnectionListenerTag(String tag) { diff --git a/chat_sample/lib/data/settings_repository.dart b/chat_sample/lib/data/settings_repository.dart index ff521e6..e49dcc4 100644 --- a/chat_sample/lib/data/settings_repository.dart +++ b/chat_sample/lib/data/settings_repository.dart @@ -25,10 +25,6 @@ class SettingsRepository { await QB.settings.disableCarbons(); } - Future initStreamManagement(bool autoReconnect, int messageTimeout) async { - await QB.settings.initStreamManagement(messageTimeout, autoReconnect: autoReconnect); - } - Future enableXMPPLogging() async { await QB.settings.enableXMPPLogging(); } diff --git a/chat_sample/lib/main.dart b/chat_sample/lib/main.dart index d79ba35..8cdfad4 100755 --- a/chat_sample/lib/main.dart +++ b/chat_sample/lib/main.dart @@ -56,10 +56,17 @@ class App extends StatelessWidget { title: 'Chat sample', theme: ThemeData( scaffoldBackgroundColor: Colors.white, - accentColor: Colors.blue, + hintColor: Colors.blue, + indicatorColor: Colors.blue, textTheme: Theme.of(context).textTheme.apply(bodyColor: Colors.black87), brightness: Brightness.dark, primarySwatch: Colors.blue, + progressIndicatorTheme: ProgressIndicatorThemeData( + color: Colors.blue, + ), + textSelectionTheme: TextSelectionThemeData( + cursorColor: Colors.blue, + ), ), navigatorKey: NavigationService().navigatorKey, onGenerateRoute: router.generateRoute, diff --git a/chat_sample/lib/presentation/screens/base_screen_state.dart b/chat_sample/lib/presentation/screens/base_screen_state.dart index 56f5a80..b3c8863 100644 --- a/chat_sample/lib/presentation/screens/base_screen_state.dart +++ b/chat_sample/lib/presentation/screens/base_screen_state.dart @@ -35,7 +35,8 @@ abstract class BaseScreenState extends State break; case AppLifecycleState.inactive: case AppLifecycleState.detached: - break; + case AppLifecycleState.hidden: + break; } } diff --git a/chat_sample/lib/presentation/screens/chat/chat_screen.dart b/chat_sample/lib/presentation/screens/chat/chat_screen.dart index 292c747..5e0ed4c 100755 --- a/chat_sample/lib/presentation/screens/chat/chat_screen.dart +++ b/chat_sample/lib/presentation/screens/chat/chat_screen.dart @@ -84,7 +84,7 @@ class _ChatScreenState extends BaseScreenState { Container( color: Color(0xfff1f1f1), child: RawScrollbar( - isAlwaysShown: false, + thumbVisibility: false, thickness: 3, controller: _scrollController, radius: Radius.circular(3), @@ -261,11 +261,13 @@ class _ChatScreenState extends BaseScreenState { } }); }, + keyboardType: TextInputType.multiline, minLines: 1, maxLines: 4, style: TextStyle(fontSize: 15.0, color: Colors.black87), decoration: InputDecoration( + border: InputBorder.none, focusedBorder: UnderlineInputBorder( borderSide: BorderSide(color: Colors.transparent)), hintStyle: TextStyle(color: Colors.black26), @@ -494,17 +496,21 @@ class _ChatScreenState extends BaseScreenState { bloc?.events?.add(event); Navigator.pop(context, DialogsScreen.FLAG_UPDATE); }, - child: Text(label)); + child: Text(label, style: TextStyle(color: Colors.blue))); Widget cancelButton = TextButton( onPressed: () { Navigator.pop(context); }, - child: Text("Cancel")); + child: Text("Cancel", style: TextStyle(color: Colors.blue))); AlertDialog alert = AlertDialog( backgroundColor: Colors.white, content: Text("$label chat?"), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(4.0), + ), + actionsPadding: EdgeInsets.symmetric(horizontal: 24.0, vertical: 8.0), actions: [okButton, cancelButton]); showDialog( diff --git a/chat_sample/lib/presentation/screens/dialogs/dialogs_screen.dart b/chat_sample/lib/presentation/screens/dialogs/dialogs_screen.dart index 6be7727..ee225b7 100755 --- a/chat_sample/lib/presentation/screens/dialogs/dialogs_screen.dart +++ b/chat_sample/lib/presentation/screens/dialogs/dialogs_screen.dart @@ -263,17 +263,21 @@ class _DialogsScreenState extends BaseScreenState { Navigator.pop(context); bloc?.events?.add(LogoutEvent()); }, - child: Text("Logout")); + child: Text("Logout", style: TextStyle(color: Colors.blue))); Widget cancelButton = TextButton( onPressed: () { Navigator.pop(context); }, - child: Text("Cancel")); + child: Text("Cancel", style: TextStyle(color: Colors.blue))); AlertDialog alert = AlertDialog( backgroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(4.0), + ), content: Text("Press Logout to continue"), + actionsPadding: EdgeInsets.symmetric(horizontal: 24.0, vertical: 8.0), actions: [okButton, cancelButton]); showDialog( diff --git a/chat_sample/lib/presentation/screens/dialogs/dialogs_screen_list_item.dart b/chat_sample/lib/presentation/screens/dialogs/dialogs_screen_list_item.dart index 3d9d488..0df37f2 100644 --- a/chat_sample/lib/presentation/screens/dialogs/dialogs_screen_list_item.dart +++ b/chat_sample/lib/presentation/screens/dialogs/dialogs_screen_list_item.dart @@ -66,9 +66,13 @@ class _DialogsListItemState extends State { Text(_formatString(_dialog.name!), style: TextStyle(fontSize: 17), overflow: TextOverflow.ellipsis), Padding(padding: EdgeInsets.only(top: 2)), - Text(_dialog.lastMessage != null ? _formatString(_dialog.lastMessage!) : "", + Flexible( + child: Text( + _dialog.lastMessage != null ? _formatString(_dialog.lastMessage!) : "", style: TextStyle(fontSize: 15, color: Color(0xFF6C7A92)), - overflow: TextOverflow.ellipsis), + overflow: TextOverflow.ellipsis, + ), + ), Padding( padding: EdgeInsets.only(top: 1), ), @@ -119,8 +123,8 @@ class _DialogsListItemState extends State { padding: EdgeInsets.only(top: 12), child: Checkbox( value: _isSelected, - fillColor: MaterialStateColor.resolveWith((states) => - states.contains(MaterialState.selected) ? Colors.blue : Colors.grey), + fillColor: WidgetStateColor.resolveWith( + (states) => states.contains(WidgetState.selected) ? Colors.blue : Colors.white), checkColor: Colors.white, activeColor: Colors.grey, onChanged: (bool? changed) { diff --git a/chat_sample/lib/presentation/screens/login/login_screen.dart b/chat_sample/lib/presentation/screens/login/login_screen.dart index 5c202dc..20bbed4 100755 --- a/chat_sample/lib/presentation/screens/login/login_screen.dart +++ b/chat_sample/lib/presentation/screens/login/login_screen.dart @@ -1,10 +1,10 @@ -import 'package:chat_sample/presentation/screens/base_screen_state.dart'; import 'package:chat_sample/bloc/login/login_screen_bloc.dart'; import 'package:chat_sample/bloc/login/login_screen_events.dart'; import 'package:chat_sample/bloc/login/login_screen_states.dart'; import 'package:chat_sample/bloc/stream_builder_with_listener.dart'; import 'package:chat_sample/presentation/navigation/navigation_service.dart'; import 'package:chat_sample/presentation/navigation/router.dart'; +import 'package:chat_sample/presentation/screens/base_screen_state.dart'; import 'package:chat_sample/presentation/screens/login/user_name_text_field.dart'; import 'package:chat_sample/presentation/utils/notification_utils.dart'; import 'package:chat_sample/presentation/widgets/decorated_app_bar.dart'; @@ -142,16 +142,22 @@ class _LoginScreenState extends BaseScreenState { } : null, style: ButtonStyle( - elevation: MaterialStateProperty.resolveWith( - (states) => states.contains(MaterialState.disabled) ? null : 3), - shadowColor: MaterialStateProperty.resolveWith((states) => - states.contains(MaterialState.disabled) - ? Color(0xff99A9C6) - : Color(0x403978FC)), - backgroundColor: MaterialStateProperty.resolveWith((states) => - states.contains(MaterialState.disabled) - ? Color(0xff99A9C6) - : Color(0xff3978FC))), + elevation: WidgetStateProperty.resolveWith( + (states) => states.contains(WidgetState.disabled) ? null : 3), + shadowColor: WidgetStateProperty.resolveWith((states) => + states.contains(WidgetState.disabled) + ? Color(0xff99A9C6) + : Color(0x403978FC)), + backgroundColor: WidgetStateProperty.resolveWith((states) => + states.contains(WidgetState.disabled) + ? Color(0xff99A9C6) + : Color(0xff3978FC)), + shape: WidgetStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(4.0), + ), + ), + ), child: Container( padding: EdgeInsets.only(top: 12, bottom: 12), child: Text( diff --git a/chat_sample/lib/presentation/screens/select_users/select_users_screen.dart b/chat_sample/lib/presentation/screens/select_users/select_users_screen.dart index 66fd7ec..98bbbbf 100644 --- a/chat_sample/lib/presentation/screens/select_users/select_users_screen.dart +++ b/chat_sample/lib/presentation/screens/select_users/select_users_screen.dart @@ -113,7 +113,7 @@ class _SelectUsersScreenState extends BaseScreenState { ]), Expanded( child: RawScrollbar( - isAlwaysShown: false, + thumbVisibility: false, thickness: 3, radius: Radius.circular(3), thumbColor: Colors.blue, diff --git a/chat_sample/lib/presentation/screens/select_users/select_users_screen_item.dart b/chat_sample/lib/presentation/screens/select_users/select_users_screen_item.dart index f181675..709afad 100644 --- a/chat_sample/lib/presentation/screens/select_users/select_users_screen_item.dart +++ b/chat_sample/lib/presentation/screens/select_users/select_users_screen_item.dart @@ -4,7 +4,6 @@ import 'package:chat_sample/bloc/select_users/select_users_screen_events.dart'; import 'package:chat_sample/models/user_wrapper.dart'; import 'package:chat_sample/presentation/utils/color_util.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; import 'package:provider/provider.dart'; /// Created by Injoit on 2021. @@ -63,8 +62,8 @@ class _SelectUsersScreenItemState extends State padding: EdgeInsets.only(top: 6), child: Checkbox( value: _isSelected, - fillColor: MaterialStateColor.resolveWith((states) => - states.contains(MaterialState.selected) ? Colors.blue : Colors.grey), + fillColor: WidgetStateColor.resolveWith( + (states) => states.contains(WidgetState.selected) ? Colors.blue : Colors.white), checkColor: Colors.white, activeColor: Colors.grey, onChanged: (bool? changed) { diff --git a/chat_sample/lib/presentation/utils/notification_utils.dart b/chat_sample/lib/presentation/utils/notification_utils.dart index 9bb0c92..1371496 100644 --- a/chat_sample/lib/presentation/utils/notification_utils.dart +++ b/chat_sample/lib/presentation/utils/notification_utils.dart @@ -15,7 +15,7 @@ class NotificationBarUtils { .showSnackBar(SnackBar( content: Text(errorMessage, style: TextStyle(color: Colors.white)), backgroundColor: Colors.black87, - duration: Duration(days: 365), + duration: Duration(seconds: errorCallback == null ? 3 : 6000), shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(5))), behavior: SnackBarBehavior.floating, margin: EdgeInsets.all(8.0), diff --git a/chat_sample/pubspec.yaml b/chat_sample/pubspec.yaml index 3fdf427..bd38b29 100644 --- a/chat_sample/pubspec.yaml +++ b/chat_sample/pubspec.yaml @@ -15,10 +15,10 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.1+0 +version: 1.1.0+0 environment: - sdk: ">=2.13.4 <3.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: flutter: @@ -29,12 +29,12 @@ dependencies: provider: ^6.0.0 hive_flutter: ^1.1.0 build_runner: ^2.1.2 - package_info: ^2.0.2 - flutter_svg: ^0.22.0 - quickblox_sdk: ^0.12.3 + package_info_plus: ^8.1.0 + flutter_svg: ^2.0.10+1 + quickblox_sdk: ^0.16.2 intl: ^0.17.0 grouped_list: ^4.1.0 - connectivity: ^3.0.6 + connectivity_plus: ^6.1.0 flutter_launcher_icons: ^0.9.2 flutter_icons: