Skip to content

Commit

Permalink
Merge pull request #40 from LiveHelperChat/master-update
Browse files Browse the repository at this point in the history
Merge first official latest release
  • Loading branch information
remdex authored Jan 6, 2025
2 parents 8bcd632 + 4b2fa82 commit 280e384
Show file tree
Hide file tree
Showing 38 changed files with 465 additions and 516 deletions.
14 changes: 8 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

/* def keystorePropertiesFile = rootProject.file("key.properties")
def keystorePropertiesFile = rootProject.file("key.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) */
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
compileSdkVersion 31
compileSdkVersion 33

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -44,8 +44,8 @@ android {
// TODO: Specify your own unique Application.kt ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.livehelperchat.chat"
minSdkVersion 19
targetSdkVersion 30
versionCode 40
targetSdkVersion 33
versionCode 42
versionName "2.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -57,6 +57,8 @@ android {
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
v1SigningEnabled true
v2SigningEnabled false
}
}

Expand All @@ -65,7 +67,7 @@ android {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
//signingConfig signingConfigs.debug
// signingConfig signingConfigs.release
signingConfig signingConfigs.release
}
}
}
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale"
Expand Down
8 changes: 4 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.9.10'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.google.gms:google-services:4.3.15'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down Expand Up @@ -38,6 +38,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
5 changes: 4 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
org.gradle.jvmargs=-Xmx1536M
#org.gradle.jvmargs=-Xmx1536M
#org.gradle.jvmargs=--add-opens java.base/java.io=ALL-UNNAMED
#org.gradle.jvmargs = -Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M" --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
org.gradle.jvmargs=-Xmx1536M --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Aug 31 15:23:10 EEST 2020
#Mon Oct 09 23:37:21 EEST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
1 change: 0 additions & 1 deletion lib/bloc/chatmessages/chat_messages_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:equatable/equatable.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:livehelp/model/model.dart';
import 'package:livehelp/services/server_repository.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/bloc/chatmessages/chat_operators_messages_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:equatable/equatable.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:livehelp/model/model.dart';
import 'package:livehelp/services/server_repository.dart';
Expand Down
3 changes: 0 additions & 3 deletions lib/bloc/chats_list/chatslist_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';

import 'package:livehelp/model/model.dart';
import 'package:livehelp/services/server_repository.dart';

import 'dart:convert';
import 'dart:developer' as developer;

part 'chatslist_event.dart';
part 'chatslist_state.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/bloc/login_form/loginform_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'dart:async';

import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/foundation.dart';
import 'package:livehelp/model/model.dart';
import 'package:livehelp/services/server_repository.dart';

Expand Down
2 changes: 1 addition & 1 deletion lib/data/database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class DatabaseHelper {

List<Map<String, dynamic>> listMap =
await db.rawQuery("SELECT * FROM $configTable");
if (listMap == null || listMap.length == 0) {
if (listMap.length == 0) {
await db.insert(configTable, tkn);
} else {
if (listMap.contains(tkn)) {
Expand Down
6 changes: 5 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ class App extends StatelessWidget {
navigatorObservers: [globals.routeObserver],
theme: ThemeData(
primarySwatch: Colors.indigo,
scaffoldBackgroundColor: Colors.white,
appBarTheme: AppBarTheme(
foregroundColor: Colors.white,
backgroundColor: Colors.indigo,
),
scaffoldBackgroundColor: Colors.indigo,
),
home: const MyHomePage());
}
Expand Down
1 change: 0 additions & 1 deletion lib/model/notification_channel.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter/foundation.dart';

class NotificationChannel {
final String id, name, description;
Expand Down
2 changes: 0 additions & 2 deletions lib/model/server.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:livehelp/model/model.dart';
import 'package:livehelp/utils/utils.dart';

import 'dart:convert';
import 'dart:developer' as developer;


// ignore_for_file: non_constant_identifier_names
Expand Down
10 changes: 4 additions & 6 deletions lib/pages/chat/chat_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import 'package:after_layout/after_layout.dart';
import 'package:http/http.dart' as http;

import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:livehelp/bloc/bloc.dart';

Expand Down Expand Up @@ -88,7 +86,7 @@ class ChatPageState extends State<ChatPage>
initState() {
super.initState();

WidgetsBinding.instance?.addObserver(this);
WidgetsBinding.instance.addObserver(this);
_chatCopy = widget.chat; // copy chat so that we can update it later
_isNewChat = widget.isNewChat;
_serverApiClient = ServerApiClient(httpClient: http.Client());
Expand Down Expand Up @@ -123,7 +121,7 @@ class ChatPageState extends State<ChatPage>
_isWritingSubject.close();
_isActionLoadingSubject.close();
_fcmTokenBloc!.add(ChatClosedEvent(chat: _chatCopy!));
WidgetsBinding.instance?.removeObserver(this);
WidgetsBinding.instance.removeObserver(this);
globals.routeObserver.unsubscribe(this);
super.dispose();
}
Expand Down Expand Up @@ -521,7 +519,7 @@ class ChatPageState extends State<ChatPage>
});

return IconTheme(
data: IconThemeData(color: Theme.of(context).accentColor),
data: IconThemeData(color: Theme.of(context).colorScheme.secondary),
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 0.0),
child: Row(
Expand Down Expand Up @@ -713,7 +711,7 @@ class ChatDetailTile extends StatelessWidget {
children: <Widget>[
new Text(info!,
textAlign: TextAlign.left,
style: Theme.of(context).accentTextTheme.subtitle2),
style: Theme.of(context).textTheme.subtitle2),
]))
],
);
Expand Down
8 changes: 3 additions & 5 deletions lib/pages/chat/operators_chat_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import 'package:after_layout/after_layout.dart';
import 'package:http/http.dart' as http;

import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:livehelp/bloc/bloc.dart';

Expand Down Expand Up @@ -87,7 +85,7 @@ class OperatorsChatPageState extends State<OperatorsChatPage>
initState() {
super.initState();

WidgetsBinding.instance?.addObserver(this);
WidgetsBinding.instance.addObserver(this);
_chatCopy = widget.chat; // copy chat so that we can update it later
_isNewChat = widget.isNewChat;
_serverApiClient = ServerApiClient(httpClient: http.Client());
Expand Down Expand Up @@ -121,7 +119,7 @@ class OperatorsChatPageState extends State<OperatorsChatPage>
_isWritingSubject.close();
_isActionLoadingSubject.close();
_fcmTokenBloc!.add(OperatorsChatClosedEvent(chat: _chatCopy!));
WidgetsBinding.instance?.removeObserver(this);
WidgetsBinding.instance.removeObserver(this);
globals.routeObserver.unsubscribe(this);
super.dispose();
}
Expand Down Expand Up @@ -463,7 +461,7 @@ class OperatorsChatPageState extends State<OperatorsChatPage>
});

return IconTheme(
data: IconThemeData(color: Theme.of(context).accentColor),
data: IconThemeData(color: Theme.of(context).colorScheme.secondary),
child: Container(
margin: const EdgeInsets.fromLTRB(5.0,0,0,0),
child: Row(
Expand Down
16 changes: 9 additions & 7 deletions lib/pages/chat/twilio_sms_chat.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

import 'package:flutter_bloc/flutter_bloc.dart';

Expand Down Expand Up @@ -53,15 +52,17 @@ class TwilioSMSChatState extends State<TwilioSMSChat> {
Widget build(BuildContext context) {
var sendBtn = Container(
padding: const EdgeInsets.only(top: 8.0),
child: RaisedButton(
child: ElevatedButton (
onPressed: () {
_submit();
},
child: Text(
"Send Twilio SMS",
style: new TextStyle(color: Colors.white),
),
color: Theme.of(context).primaryColor,
style: ElevatedButton.styleFrom(
primary: Theme.of(context).primaryColor, // Background color
)
));
var messageForm = Column(
mainAxisAlignment: MainAxisAlignment.center,
Expand Down Expand Up @@ -137,7 +138,7 @@ class TwilioSMSChatState extends State<TwilioSMSChat> {
Container(
padding: const EdgeInsets.only(top: 8.0),
child: new Text('* indicates required field',
style: Theme.of(context).textTheme.caption),
style: Theme.of(context).textTheme.bodySmall),
),
],
);
Expand Down Expand Up @@ -209,7 +210,8 @@ class TwilioSMSChatState extends State<TwilioSMSChat> {
}

void _showSnackBar(String text) {
_scaffoldKey.currentState!.showSnackBar(SnackBar(content: Text(text)));
//_scaffoldKey.currentState!.showSnackBar(SnackBar(content: Text(text)));
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(text)));
}

void onCheckBoxChanged(bool? value) {
Expand All @@ -223,7 +225,7 @@ class TwilioSMSChatState extends State<TwilioSMSChat> {
twilioPhonesList.clear();
var phones = await _serverRepository!.getTwilioPhones(_currentServer!);
setState(() => _isLoading = false);
if (phones != null && phones.length > 0) {
if (phones.length > 0) {
phones.forEach((item) {
setState(() {
twilioPhonesList.add(item);
Expand All @@ -245,7 +247,7 @@ Future<void> _ackAlert(BuildContext context) {
content:
const Text('Please configure a Phone number in Twilio extension.'),
actions: <Widget>[
FlatButton(
TextButton(
child: Text('Ok'),
onPressed: () {
Navigator.of(context).pop();
Expand Down
17 changes: 10 additions & 7 deletions lib/pages/config/department_hours.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ class _DepartmentHoursState extends State<DepartmentHours> {
backgroundColor: Colors.white,
),onPressed: null,)), */

FlatButton(
shape:
const CircleBorder(side: BorderSide(color: Colors.transparent)),
textColor: Colors.white,
TextButton(
//shape: const CircleBorder(side: BorderSide(color: Colors.transparent)),
// textColor: Colors.white,
style: TextButton.styleFrom(
primary: Colors.white, // Text Color
),
child: const Text("Refresh"),
onPressed: () {
_initAsyncloader();
Expand Down Expand Up @@ -458,7 +460,7 @@ class _DepartmentHoursState extends State<DepartmentHours> {
),
),
),
RaisedButton(
ElevatedButton (
onPressed: () {
_department?.online_hours_active = _onlineHoursActive;
_isLoading = true;
Expand All @@ -475,8 +477,9 @@ class _DepartmentHoursState extends State<DepartmentHours> {
child: const Text(
"Save Data",
style: TextStyle(color: Colors.white),
),
color: Theme.of(context).primaryColor,
),style: ElevatedButton.styleFrom(
primary: Theme.of(context).primaryColor, // Background color
)
),
],
),
Expand Down
10 changes: 6 additions & 4 deletions lib/pages/config/server_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ class _ServerDetailsState extends State<ServerSettings> {
backgroundColor: Colors.white,
),onPressed: null,)), */

FlatButton(
shape:
const CircleBorder(side: BorderSide(color: Colors.transparent)),
textColor: Colors.white,
TextButton(
//shape: const CircleBorder(side: BorderSide(color: Colors.transparent)),
// textColor: Colors.white,
style: TextButton.styleFrom(
primary: Colors.white, // Text Color
),
child: _isLoading
? const CircularProgressIndicator(
backgroundColor: Colors.white,
Expand Down
1 change: 0 additions & 1 deletion lib/pages/lists/chat_list_closed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:livehelp/bloc/bloc.dart';

import 'package:livehelp/model/model.dart';
import 'package:livehelp/services/server_repository.dart';
import 'package:livehelp/widget/widget.dart';
import 'package:livehelp/utils/utils.dart';

Expand Down
1 change: 0 additions & 1 deletion lib/pages/lists/chat_list_operators.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:livehelp/bloc/bloc.dart';

import 'package:livehelp/model/model.dart';
import 'package:livehelp/services/server_repository.dart';
import 'package:livehelp/widget/widget.dart';
import 'package:livehelp/utils/utils.dart';

Expand Down
1 change: 0 additions & 1 deletion lib/pages/lists/chat_list_pending.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:livehelp/bloc/bloc.dart';

import 'package:livehelp/model/model.dart';
import 'package:livehelp/services/server_repository.dart';
import 'package:livehelp/widget/widget.dart';
import 'package:livehelp/utils/utils.dart';

Expand Down
1 change: 0 additions & 1 deletion lib/pages/lists/chat_list_transferred.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:http/http.dart' as http;
import 'package:livehelp/bloc/bloc.dart';

import 'package:livehelp/model/model.dart';
import 'package:livehelp/services/server_repository.dart';
import 'package:livehelp/widget/widget.dart';
import 'package:livehelp/utils/utils.dart';
import 'package:livehelp/services/server_api_client.dart';
Expand Down
Loading

0 comments on commit 280e384

Please sign in to comment.