Skip to content

Commit 6dfc61c

Browse files
authored
Merge pull request #6 from hatemragab/group_chat
Finsh Group chat
2 parents cd8afa0 + 707ef8e commit 6dfc61c

Some content is hidden

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

57 files changed

+1209
-271
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,12 @@
5252

5353
## 0.6.0
5454

55-
* start implement group chat v1 still need more improvements
55+
* start implement group chat v1 still need more improvements
56+
57+
## 0.9.0
58+
* unread message count for group chat and single chat
59+
* leave group chat
60+
* group chat page which can update group name and upgrade users to admin if i the group creator and update group image
61+
* kick users from group
62+
* admin downgrade and upgrade system if iam admin
63+
* admins can add users only

example/android/app/src/main/AndroidManifest.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<application
1818
android:icon="@mipmap/ic_launcher"
19-
android:label="v_chat_sdk_example"
19+
android:label="v chat"
2020
android:requestLegacyExternalStorage="true"
2121
android:usesCleartextTraffic="true">
2222
<activity
@@ -55,6 +55,10 @@
5555
<meta-data
5656
android:name="com.google.firebase.messaging.default_notification_channel_id"
5757
android:value="high_importance_channel" />
58+
<meta-data
59+
android:name="com.google.firebase.messaging.default_notification_color"
60+
android:resource="@color/colorAccent" />
61+
5862

5963
</application>
6064
</manifest>
Loading
Binary file not shown.
Loading
Binary file not shown.
Loading
Binary file not shown.
Loading
Binary file not shown.
Loading
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="colorAccent">#0000FF</color>
4+
</resources>

example/lib/main.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ void main() async {
2626
// http://170.178.195.150:81/
2727
//10.0.2.2:3000
2828
await VChatController.instance.init(
29-
baseUrl: Uri.parse("http://170.178.195.150:81"),
30-
appName: "test_v_chat",
31-
isUseFirebase: true,
32-
widgetsBuilder: VChatCustomWidgets(),
33-
enableLogger: true,
34-
maxMediaUploadSize: 50 * 1000 * 1000,
35-
passwordHashKey: "passwordHashKey",
36-
);
29+
baseUrl: Uri.parse("http://170.178.195.150:81"),
30+
appName: "test_v_chat",
31+
isUseFirebase: true,
32+
widgetsBuilder: VChatCustomWidgets(),
33+
enableLogger: true,
34+
maxMediaUploadSize: 50 * 1000 * 1000,
35+
passwordHashKey: "passwordHashKey",
36+
maxGroupChatUsers: 500);
3737

3838
// add support new language
3939
// v_chat will change the language one you change it

example/lib/screens/about.dart

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import 'package:example/utils/custom_alert.dart';
2+
import 'package:flutter/material.dart';
3+
import 'package:flutter/services.dart';
4+
import 'package:textless/textless.dart';
5+
6+
class About extends StatefulWidget {
7+
const About({Key? key}) : super(key: key);
8+
9+
@override
10+
_AboutState createState() => _AboutState();
11+
}
12+
13+
class _AboutState extends State<About> {
14+
@override
15+
Widget build(BuildContext context) {
16+
return Scaffold(
17+
appBar: AppBar(
18+
title: "About".text,
19+
centerTitle: true,
20+
elevation: 0,
21+
),
22+
body: Padding(
23+
padding: const EdgeInsets.all(8.0),
24+
child: Column(
25+
crossAxisAlignment: CrossAxisAlignment.stretch,
26+
children: [
27+
"V Chat Sdk".h5.alignCenter,
28+
SizedBox(
29+
height: 10,
30+
),
31+
"Code private and Group Chat with v chat its very easy !".text,
32+
SizedBox(
33+
height: 6,
34+
),
35+
"Directed to flutter developers who want to implement chat system in their apps without write chat code"
36+
.text,
37+
SizedBox(
38+
height: 6,
39+
),
40+
"VChat Works with all backend service available because it not depend on your backend system it run isolated and connected to your backend with our public apis"
41+
.text,
42+
SizedBox(
43+
height: 6,
44+
),
45+
"Are you have question ?".text.black,
46+
SizedBox(
47+
height: 6,
48+
),
49+
Row(
50+
children: [
51+
"Contact me on whatsapp ".text,
52+
InkWell(
53+
onTap: () async {
54+
await Clipboard.setData(
55+
ClipboardData(text: "+201012309598"));
56+
CustomAlert.showSuccess(
57+
context: context,
58+
err: "copied to your ClipboardData");
59+
},
60+
child: "+201012309598".text.color(Colors.blue))
61+
],
62+
),
63+
SizedBox(
64+
height: 6,
65+
),
66+
Row(
67+
children: [
68+
"Contact me on Skype ".text,
69+
InkWell(
70+
onTap: () async {
71+
await Clipboard.setData(
72+
ClipboardData(text: "live:.cid.607250433850e3a6"));
73+
CustomAlert.showSuccess(
74+
context: context,
75+
err: "copied to your ClipboardData");
76+
},
77+
child: "live:.cid.607250433850e3a6".text.color(Colors.blue))
78+
],
79+
)
80+
],
81+
),
82+
),
83+
);
84+
}
85+
}

example/lib/screens/choose_group_members/choose_group_members_controller.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ class ChooseGroupMembersController extends ChangeNotifier {
1414

1515
final scrollController = ScrollController();
1616
final myModel = GetStorage().read("myModel");
17+
final bool isFromGroupInfo;
1718

1819
ChooseGroupMembersController({
1920
required this.context,
21+
required this.isFromGroupInfo,
2022
}) {
2123
getUsers();
2224
scrollController.addListener(_scrollListener);
@@ -88,6 +90,9 @@ class ChooseGroupMembersController extends ChangeNotifier {
8890
seletedUsers.add(u);
8991
}
9092
}
93+
if (isFromGroupInfo) {
94+
return Navigator.pop(context, seletedUsers);
95+
}
9196
Navigator.of(context).push(MaterialPageRoute(
9297
builder: (context) => CreateGroupPage(
9398
users: seletedUsers,
@@ -103,7 +108,7 @@ class ChooseGroupMembersController extends ChangeNotifier {
103108
for (final u in users) {
104109
if (u.isSelected) {
105110
if (u.id == myModel['_id']) {
106-
throw "un select your self from the list";
111+
throw "Remove your self from the list your name is ${myModel['name']}";
107112
}
108113
isThereSelection = true;
109114
}

example/lib/screens/choose_group_members/choose_group_members_screen.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ import 'package:textless/textless.dart';
55
import 'choose_group_members_controller.dart';
66

77
class ChooseGroupMembersPage extends StatelessWidget {
8-
const ChooseGroupMembersPage({Key? key}) : super(key: key);
8+
bool isFromGroupInfo;
9+
10+
ChooseGroupMembersPage({Key? key, this.isFromGroupInfo = false})
11+
: super(key: key);
912

1013
@override
1114
Widget build(BuildContext context) {
1215
return ChangeNotifierProvider(
13-
create: (BuildContext context) =>
14-
ChooseGroupMembersController(context: context),
16+
create: (BuildContext context) => ChooseGroupMembersController(
17+
context: context, isFromGroupInfo: isFromGroupInfo),
1518
builder: (context, child) => ChooseGroupMembersScreen(),
1619
);
1720
}

0 commit comments

Comments
 (0)