Skip to content

Commit 4cf0275

Browse files
committed
stable version 1.0.0
1 parent 9bb7adc commit 4cf0275

Some content is hidden

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

47 files changed

+1035
-388
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,10 @@
6060
* group chat page which can update group name and upgrade users to admin if i the group creator and update group image
6161
* kick users from group
6262
* admin downgrade and upgrade system if iam admin
63-
* admins can add users only
63+
* admins can add users only
64+
65+
## 0.9.1
66+
* full localization support
67+
68+
## 1.0.0
69+
* first stable version

example/assets/icon.png

7.41 KB
Loading

example/assets/v.gif

-49.1 KB
Binary file not shown.

example/lib/controllers/home_controller.dart

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,52 @@
11
import 'package:example/generated/l10n.dart';
2+
import 'package:example/utils/load_more_type.dart';
23
import 'package:flutter/cupertino.dart';
34
import 'package:flutter/material.dart';
5+
import 'package:get_storage/get_storage.dart';
6+
import 'package:textless/textless.dart';
47
import 'package:v_chat_sdk/v_chat_sdk.dart';
58
import '../models/user.dart';
69
import '../utils/custom_alert.dart';
710
import '../utils/custom_dio.dart';
811

9-
class HomeController {
10-
BuildContext context;
12+
class HomeController extends ChangeNotifier {
13+
int currentIndex = 0;
1114

12-
HomeController(this.context);
15+
final usersList = <User>[];
16+
LoadMoreStatus loadingStatus = LoadMoreStatus.loaded;
17+
final scrollController = ScrollController();
18+
String searchText = "";
1319

14-
Future<List<User>> getUsers() async {
20+
void init(BuildContext context) {
21+
scrollController.addListener(_scrollListener);
22+
23+
/// here user will be online this must be init one user authenticated
24+
25+
if (GetStorage().hasData("myModel")) {
26+
/// this mean my user has auth so i will bind chat controller to make him online else will throw exception
27+
VChatController.instance.bindChatControllers(
28+
context: context,
29+
email: GetStorage().read("myModel")['email'],
30+
);
31+
}
32+
}
33+
34+
Future getUsers(BuildContext context) async {
1535
try {
1636
final res = (await CustomDio()
1737
.send(reqMethod: "get", path: "user", query: {"lastId": "first"}))
1838
.data['data'] as List;
19-
return res.map((e) => User.fromMap(e)).toList();
39+
final users = res.map((e) => User.fromMap(e)).toList();
40+
usersList.clear();
41+
usersList.addAll(users);
42+
notifyListeners();
2043
} catch (err) {
2144
CustomAlert.showError(context: context, err: err.toString());
2245
rethrow;
2346
}
2447
}
2548

26-
void startChat(String email) async {
49+
void startChat(String email, BuildContext context) async {
2750
try {
2851
final res =
2952
await CustomAlert.chatAlert(context: context, peerEmail: email);
@@ -39,4 +62,37 @@ class HomeController {
3962
rethrow;
4063
}
4164
}
65+
66+
void _scrollListener() async {
67+
if (scrollController.offset >=
68+
scrollController.position.maxScrollExtent / 2 &&
69+
!scrollController.position.outOfRange &&
70+
loadingStatus != LoadMoreStatus.loading &&
71+
loadingStatus != LoadMoreStatus.completed) {
72+
loadingStatus = LoadMoreStatus.loading;
73+
loadMore();
74+
}
75+
}
76+
77+
void onTabTapped(int index) {
78+
currentIndex = index;
79+
notifyListeners();
80+
}
81+
82+
Future<void> loadMore() async {
83+
final loadedRooms = await loadMoreApi(usersList.last.id);
84+
loadingStatus = LoadMoreStatus.loaded;
85+
if (loadedRooms.isEmpty) {
86+
loadingStatus = LoadMoreStatus.completed;
87+
}
88+
usersList.addAll(loadedRooms);
89+
notifyListeners();
90+
}
91+
92+
Future<List<User>> loadMoreApi(String lastId) async {
93+
final roomsMaps = (await CustomDio()
94+
.send(reqMethod: "get", path: "user", query: {"lastId": lastId}))
95+
.data['data'] as List;
96+
return roomsMaps.map((e) => User.fromMap(e)).toList();
97+
}
4298
}

example/lib/generated/intl/messages_ar_EG.dart

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,86 @@ class MessageLookup extends MessageLookupByLibrary {
2222

2323
final messages = _notInlinedMessages(_notInlinedMessages);
2424
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
25+
"about": MessageLookupByLibrary.simpleMessage("عن"),
2526
"allChatNotifications":
2627
MessageLookupByLibrary.simpleMessage("كل اشعارات المحادثه"),
2728
"ar": MessageLookupByLibrary.simpleMessage("عربي"),
29+
"areYouHaveQuestion":
30+
MessageLookupByLibrary.simpleMessage("هل لديك اساله ؟"),
31+
"buyTheBackendCode":
32+
MessageLookupByLibrary.simpleMessage("قم بشراء نسخه"),
33+
"cancel": MessageLookupByLibrary.simpleMessage("الغاء"),
2834
"changeLanguage": MessageLookupByLibrary.simpleMessage("تغيسر اللغه"),
2935
"changeTheme": MessageLookupByLibrary.simpleMessage("تغير الثيم"),
3036
"chats": MessageLookupByLibrary.simpleMessage("الدردشات"),
37+
"chooseGroupImage":
38+
MessageLookupByLibrary.simpleMessage("اختار صوره للجروب"),
3139
"chooseImage": MessageLookupByLibrary.simpleMessage("اختار صوره"),
40+
"chooseMembers": MessageLookupByLibrary.simpleMessage("اختار الاعضاء"),
41+
"codePrivateAndGroupChatWithVChatItsVery":
42+
MessageLookupByLibrary.simpleMessage(
43+
"اناء محادثه خاصه وجروب دردشه في دقائق"),
44+
"contactMeOnWhatsapp":
45+
MessageLookupByLibrary.simpleMessage("تواصل معي"),
46+
"contactUsAndReportIssuesOrNewFeatures":
47+
MessageLookupByLibrary.simpleMessage(
48+
"Contact Us And Report issues or new features"),
49+
"createGroup": MessageLookupByLibrary.simpleMessage("انشاء جروب دردشه"),
3250
"dark": MessageLookupByLibrary.simpleMessage("اسود "),
3351
"email": MessageLookupByLibrary.simpleMessage("البريد"),
3452
"en": MessageLookupByLibrary.simpleMessage("انجليزي"),
53+
"enterTheName": MessageLookupByLibrary.simpleMessage("ادخل الاسم"),
3554
"error": MessageLookupByLibrary.simpleMessage("خطا"),
55+
"groupName": MessageLookupByLibrary.simpleMessage("اسم الجروب شات"),
3656
"home": MessageLookupByLibrary.simpleMessage("الرئيسيه"),
57+
"imageHasBeenSelected":
58+
MessageLookupByLibrary.simpleMessage("تم اختيار الصوره"),
59+
"imageHasBeenSetSuccessfully":
60+
MessageLookupByLibrary.simpleMessage("تم اختيار الصوره"),
61+
"imageSizeMustBeLessThan20Mb": MessageLookupByLibrary.simpleMessage(
62+
"يجب ان تكون الصوره اقل من 20 ميجا"),
63+
"iosTestflightAndPublicFlutterUi": MessageLookupByLibrary.simpleMessage(
64+
"ios testflight and public flutter ui"),
3765
"light": MessageLookupByLibrary.simpleMessage("ابيض "),
66+
"loading": MessageLookupByLibrary.simpleMessage("جاري التحميل ..."),
3867
"logOut": MessageLookupByLibrary.simpleMessage("تسجيل خروج"),
3968
"login": MessageLookupByLibrary.simpleMessage("تسجيل دخول"),
69+
"members": MessageLookupByLibrary.simpleMessage("الاعضاء"),
4070
"message": MessageLookupByLibrary.simpleMessage("رساله"),
4171
"myGreatRooms": MessageLookupByLibrary.simpleMessage("كل المحادثات"),
4272
"name": MessageLookupByLibrary.simpleMessage("الاسم"),
73+
"newName": MessageLookupByLibrary.simpleMessage("الاسم الجديد"),
4374
"off": MessageLookupByLibrary.simpleMessage("ايقاف"),
4475
"offline": MessageLookupByLibrary.simpleMessage("قافل"),
4576
"ok": MessageLookupByLibrary.simpleMessage("تم"),
4677
"on": MessageLookupByLibrary.simpleMessage("تشغيل"),
78+
"ourFullDocumentation":
79+
MessageLookupByLibrary.simpleMessage("اطلع علي كيفيه التشغيل"),
4780
"password": MessageLookupByLibrary.simpleMessage("كلمه المرور"),
4881
"register": MessageLookupByLibrary.simpleMessage("تسجيل حساب"),
82+
"removeYourSelfFromTheListYourNameIs":
83+
MessageLookupByLibrary.simpleMessage(
84+
"برجاء حذف اسمك من اللسته اسمك هوه"),
85+
"selectAtLestOneUser":
86+
MessageLookupByLibrary.simpleMessage("اختار علي الاقل شخص"),
4987
"settings": MessageLookupByLibrary.simpleMessage("الاعدادات"),
88+
"splashScreen": MessageLookupByLibrary.simpleMessage("splash screen"),
89+
"success": MessageLookupByLibrary.simpleMessage("نجت العمليه"),
5090
"test": MessageLookupByLibrary.simpleMessage("تست"),
5191
"thisDataFromMyServerNotVchat":
5292
MessageLookupByLibrary.simpleMessage("هذه الداتا من سيرفر خارجي"),
93+
"title": MessageLookupByLibrary.simpleMessage("العنوان"),
5394
"update": MessageLookupByLibrary.simpleMessage("تحديث"),
54-
"updateProfile": MessageLookupByLibrary.simpleMessage("تحديث الحساب")
95+
"updateImage": MessageLookupByLibrary.simpleMessage("تحديث الصوره"),
96+
"updateName": MessageLookupByLibrary.simpleMessage("تحديث الاسم"),
97+
"updateProfile": MessageLookupByLibrary.simpleMessage("تحديث الحساب"),
98+
"userName": MessageLookupByLibrary.simpleMessage("اسم المستخدم"),
99+
"usersHasBeenAddedSuccessfully":
100+
MessageLookupByLibrary.simpleMessage("تم اضافه العضو بنجاح"),
101+
"vChatUsers": MessageLookupByLibrary.simpleMessage("الاعضاء"),
102+
"yourImageHasBeenUpdated":
103+
MessageLookupByLibrary.simpleMessage("تم تحديث الصوره"),
104+
"yourNameHasBeenUpdated":
105+
MessageLookupByLibrary.simpleMessage("تم تحديث الاسم ")
55106
};
56107
}

example/lib/generated/intl/messages_en.dart

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,87 @@ class MessageLookup extends MessageLookupByLibrary {
2222

2323
final messages = _notInlinedMessages(_notInlinedMessages);
2424
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
25+
"about": MessageLookupByLibrary.simpleMessage("About"),
2526
"allChatNotifications":
2627
MessageLookupByLibrary.simpleMessage("All Chat notifications"),
2728
"ar": MessageLookupByLibrary.simpleMessage("ar"),
29+
"areYouHaveQuestion":
30+
MessageLookupByLibrary.simpleMessage("Are you have question ?"),
31+
"buyTheBackendCode":
32+
MessageLookupByLibrary.simpleMessage("Buy the backend code"),
33+
"cancel": MessageLookupByLibrary.simpleMessage("cancel"),
2834
"changeLanguage":
2935
MessageLookupByLibrary.simpleMessage("Change language"),
3036
"changeTheme": MessageLookupByLibrary.simpleMessage("Change Theme"),
3137
"chats": MessageLookupByLibrary.simpleMessage("Chats"),
38+
"chooseGroupImage":
39+
MessageLookupByLibrary.simpleMessage("Choose group image"),
3240
"chooseImage": MessageLookupByLibrary.simpleMessage("choose image"),
41+
"chooseMembers": MessageLookupByLibrary.simpleMessage("choose members"),
42+
"codePrivateAndGroupChatWithVChatItsVery":
43+
MessageLookupByLibrary.simpleMessage(
44+
"Code private and Group Chat with v chat its very easy !"),
45+
"contactMeOnWhatsapp":
46+
MessageLookupByLibrary.simpleMessage("Contact me on whatsapp"),
47+
"contactUsAndReportIssuesOrNewFeatures":
48+
MessageLookupByLibrary.simpleMessage(
49+
"Contact Us And Report issues or new features"),
50+
"createGroup": MessageLookupByLibrary.simpleMessage("Create Group !"),
3351
"dark": MessageLookupByLibrary.simpleMessage("dark"),
3452
"email": MessageLookupByLibrary.simpleMessage("Email"),
3553
"en": MessageLookupByLibrary.simpleMessage("en"),
54+
"enterTheName": MessageLookupByLibrary.simpleMessage("Enter the name"),
3655
"error": MessageLookupByLibrary.simpleMessage("Error"),
56+
"groupName": MessageLookupByLibrary.simpleMessage("Group Name"),
3757
"home": MessageLookupByLibrary.simpleMessage("Home"),
58+
"imageHasBeenSelected":
59+
MessageLookupByLibrary.simpleMessage("image has been selected"),
60+
"imageHasBeenSetSuccessfully": MessageLookupByLibrary.simpleMessage(
61+
"image has been set successfully"),
62+
"imageSizeMustBeLessThan20Mb": MessageLookupByLibrary.simpleMessage(
63+
"image size must be less than 20 Mb"),
64+
"iosTestflightAndPublicFlutterUi": MessageLookupByLibrary.simpleMessage(
65+
"ios testflight and public flutter ui"),
3866
"light": MessageLookupByLibrary.simpleMessage("light"),
67+
"loading": MessageLookupByLibrary.simpleMessage("Loading ..."),
3968
"logOut": MessageLookupByLibrary.simpleMessage("Log out"),
4069
"login": MessageLookupByLibrary.simpleMessage("login"),
70+
"members": MessageLookupByLibrary.simpleMessage("Members"),
4171
"message": MessageLookupByLibrary.simpleMessage("Message"),
4272
"myGreatRooms": MessageLookupByLibrary.simpleMessage("My great rooms"),
4373
"name": MessageLookupByLibrary.simpleMessage("Name"),
74+
"newName": MessageLookupByLibrary.simpleMessage("new name"),
4475
"off": MessageLookupByLibrary.simpleMessage("Off"),
4576
"offline": MessageLookupByLibrary.simpleMessage("offline"),
4677
"ok": MessageLookupByLibrary.simpleMessage("Ok"),
4778
"on": MessageLookupByLibrary.simpleMessage("On"),
79+
"ourFullDocumentation":
80+
MessageLookupByLibrary.simpleMessage("Our Full Documentation"),
4881
"password": MessageLookupByLibrary.simpleMessage("Password"),
4982
"register": MessageLookupByLibrary.simpleMessage("Register"),
83+
"removeYourSelfFromTheListYourNameIs":
84+
MessageLookupByLibrary.simpleMessage(
85+
"Remove your self from the list your name is"),
86+
"selectAtLestOneUser":
87+
MessageLookupByLibrary.simpleMessage("select at lest one user"),
5088
"settings": MessageLookupByLibrary.simpleMessage("Settings"),
89+
"splashScreen": MessageLookupByLibrary.simpleMessage("splash screen"),
90+
"success": MessageLookupByLibrary.simpleMessage("success"),
5191
"test": MessageLookupByLibrary.simpleMessage("test"),
5292
"thisDataFromMyServerNotVchat": MessageLookupByLibrary.simpleMessage(
5393
"This data from my server not vchat"),
94+
"title": MessageLookupByLibrary.simpleMessage("Title"),
5495
"update": MessageLookupByLibrary.simpleMessage("Update"),
55-
"updateProfile": MessageLookupByLibrary.simpleMessage("Update profile")
96+
"updateImage": MessageLookupByLibrary.simpleMessage("update image"),
97+
"updateName": MessageLookupByLibrary.simpleMessage("update name"),
98+
"updateProfile": MessageLookupByLibrary.simpleMessage("Update profile"),
99+
"userName": MessageLookupByLibrary.simpleMessage("User name"),
100+
"usersHasBeenAddedSuccessfully": MessageLookupByLibrary.simpleMessage(
101+
"Users has been added successfully"),
102+
"vChatUsers": MessageLookupByLibrary.simpleMessage("v chat users"),
103+
"yourImageHasBeenUpdated": MessageLookupByLibrary.simpleMessage(
104+
"your image has been updated !"),
105+
"yourNameHasBeenUpdated":
106+
MessageLookupByLibrary.simpleMessage("your name has been updated !")
56107
};
57108
}

0 commit comments

Comments
 (0)