Skip to content

Commit 4437a1d

Browse files
committed
feat: daily updates
1 parent 4e0360c commit 4437a1d

File tree

48 files changed

+411
-88
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+411
-88
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
".env.production": ".env.development, .env",
55
"pubspec.yaml": ".flutter-plugins, .flutter-plugins-dependencies, pubspec.lock, .metadata"
66
},
7-
"editor.formatOnSave": true
7+
"editor.formatOnSave": true,
8+
"arb-editor.suppressedWarnings": ["missing_metadata_for_key"]
89
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ Get the latest version from the [Releases page](https://github.com/trongtindev/c
5959
| -------------------- | -------------- |
6060
| UI - Customize theme | ✅ Completed |
6161
| Settings | 💪 In-Progress |
62-
| Conversations | 💪 In-Progress |
62+
| Conversations | ✅ Completed |
6363
| Message Translation | ✅ Completed |
64-
| Contacts | 💪 In-Progress |
64+
| Contacts | ✅ Completed |
6565
| Notifications | 💪 In-Progress |
6666
| Push Notifications | ☑️ Not tested |
6767
| Reports | 🕛 Planned |

analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ analyzer:
22
errors:
33
non_constant_identifier_names: ignore
44
constant_identifier_names: ignore
5+
no_leading_underscores_for_library_prefixes: ignore
56
include: package:flutter_lints/flutter.yaml
67

78
linter:

lib/config/bindings.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import '/imports.dart';
66
class BindingsConfig {
77
Future<void> dependencies() async {
88
// global services
9+
await Get.putAsync(() => DeviceService().init());
910
await Get.putAsync(() => DbService().init());
1011
await Get.putAsync(() => ApiService().init());
1112
await Get.putAsync(() => AuthService().init());

lib/imports.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import 'package:package_info_plus/package_info_plus.dart';
12
import 'package:shared_preferences/shared_preferences.dart';
3+
4+
import 'imports.dart';
25
export 'package:refreshed/refreshed.dart'
36
show
47
Get,
@@ -75,6 +78,7 @@ export 'services/assistant.dart';
7578
export 'services/auth.dart';
7679
export 'services/db.dart';
7780
export 'services/deeplink.dart';
81+
export 'services/device.dart';
7882
export 'services/notification.dart';
7983
export 'services/realtime.dart';
8084
export 'services/settings.dart';
@@ -113,3 +117,5 @@ export 'screens/teams/controllers/index.dart';
113117
export 'screens/agents/controllers/index.dart';
114118

115119
late SharedPreferences prefs;
120+
late PackageInfo packageInfo;
121+
final cookieManager = CookieManager.instance();

lib/l10n/app_en.arb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
"upload": "Upload",
66
"phone_number": "Phone number",
77
"company": "Company name",
8+
"company_hint": "Enter the company name",
9+
"company_invalid": "company_invalid",
810
"country": "country",
911
"city": "City",
12+
"city_hint": "city_hint",
1013
"last_activity_at": "Last activity",
1114
"created_at": "Created at",
1215
"name": "Name",
@@ -80,6 +83,7 @@
8083
"contacts_empty_title": "No contacts found in this account",
8184
"contacts_empty_description": "Start adding new contacts by clicking on the button below",
8285
"contacts_add": "Add contact",
86+
"contacts_editor_title": "Contact details",
8387
"settings": "Settings",
8488
"settings_notification": "Notification",
8589
"login_title": "Log in to your account",
@@ -333,5 +337,14 @@
333337
"call": "Call",
334338
"message": "Message",
335339
"mark_auto_offline": "Mark offline automatically",
336-
"translate": "Translate"
340+
"translate": "Translate",
341+
"first_name": "First name",
342+
"first_name_hint": "Enter the first name",
343+
"first_name_invalid": "first_name_invalid",
344+
"last_name": "Last name",
345+
"last_name_hint": "Enter the last name",
346+
"last_name_invalid": "last_name_invalid",
347+
"bio": "Enter the bio",
348+
"bio_hint": "bio_hint",
349+
"bio_invalid": "bio_hint_invalid"
337350
}

lib/main.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'package:package_info_plus/package_info_plus.dart';
2+
13
import 'app.dart';
24
import 'imports.dart';
35
import 'package:path/path.dart' as p;
@@ -83,8 +85,9 @@ void main() async {
8385
await InAppWebViewController.setWebContentsDebuggingEnabled(kDebugMode);
8486
}
8587

86-
// preferences
88+
// preload
8789
prefs = await SharedPreferences.getInstance();
90+
packageInfo = await PackageInfo.fromPlatform();
8891

8992
// app
9093
runApp(SentryWidget(child: App()));

lib/models/conversation.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,9 @@ class ConversationInfo {
133133
var contact_last_seen_at = toDateTime(json['contact_last_seen_at']);
134134
List<dynamic> labels = json['labels'];
135135

136-
var first_reply_created_at = toDateTime(json['first_reply_created_at']);
137136
var last_non_activity_message = json['last_non_activity_message'] != null
138137
? MessageInfo.fromJson(json['last_non_activity_message'])
139138
: null;
140-
var last_activity_at = toDateTime(json['last_activity_at']);
141139
var priority = json['priority'] != null
142140
? ConversationPriority.values.byName(json['priority'])
143141
: ConversationPriority.none;
@@ -162,10 +160,10 @@ class ConversationInfo {
162160
status: ConversationStatus.values.byName(json['status']),
163161
created_at: created_at,
164162
timestamp: toDateTime(json['timestamp'])!,
165-
first_reply_created_at: first_reply_created_at,
163+
first_reply_created_at: toDateTime(json['first_reply_created_at']),
166164
unread_count: json['unread_count'],
167165
last_non_activity_message: last_non_activity_message,
168-
last_activity_at: last_activity_at ?? created_at,
166+
last_activity_at: toDateTime(json['last_activity_at']) ?? created_at,
169167
priority: priority,
170168
waiting_since: json['waiting_since'],
171169
sla_policy_id: json['sla_policy_id'],
@@ -204,9 +202,9 @@ class ListConversationResult
204202
});
205203

206204
factory ListConversationResult.fromJson(dynamic json) {
207-
List<dynamic> payload = json['payload'];
205+
List<dynamic> payload = json['data']['payload'];
208206
return ListConversationResult(
209-
meta: ListConversationMeta.fromJson(json['meta']),
207+
meta: ListConversationMeta.fromJson(json['data']['meta']),
210208
payload: payload.map(ConversationInfo.fromJson).toList(),
211209
);
212210
}

0 commit comments

Comments
 (0)