Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Pattle
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
71
Issues
71
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pattle
Pattle
Commits
82af9ae8
Verified
Commit
82af9ae8
authored
Jun 15, 2019
by
Wilko Manger
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show message when viewing room that the user left
parent
3b54eeea
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
18 deletions
+37
-18
lib/src/ui/main/chat/chat_bloc.dart
lib/src/ui/main/chat/chat_bloc.dart
+3
-2
lib/src/ui/main/chat/chat_page.dart
lib/src/ui/main/chat/chat_page.dart
+27
-12
lib/src/ui/resources/localizations.dart
lib/src/ui/resources/localizations.dart
+3
-0
pubspec.lock
pubspec.lock
+2
-2
pubspec.yaml
pubspec.yaml
+2
-2
No files found.
lib/src/ui/main/chat/chat_bloc.dart
View file @
82af9ae8
...
...
@@ -24,7 +24,7 @@ import 'package:pattle/src/di.dart' as di;
class
ChatBloc
{
Joined
Room
room
;
Room
room
;
int
_eventCount
=
20
;
...
...
@@ -125,8 +125,9 @@ class ChatBloc {
}
Future
<
void
>
sendMessage
(
String
text
)
async
{
final
room
=
this
.
room
;
// TODO: Check if text is just whitespace
if
(
text
.
isNotEmpty
)
{
if
(
room
is
JoinedRoom
&&
text
.
isNotEmpty
)
{
// Refresh the list every time the sent state changes.
await
for
(
var
sentState
in
room
.
send
(
TextMessage
(
body:
text
)))
{
await
loadEvents
();
...
...
lib/src/ui/main/chat/chat_page.dart
View file @
82af9ae8
...
...
@@ -36,7 +36,7 @@ class ChatPageState extends State<ChatPage> {
final
me
=
di
.
getLocalUser
();
final
ChatBloc
bloc
=
ChatBloc
();
final
Joined
Room
room
;
final
Room
room
;
ScrollController
scrollController
=
ScrollController
();
double
get
scrollLoadRange
=>
scrollController
.
position
.
maxScrollExtent
-
700
;
...
...
@@ -136,15 +136,17 @@ class ChatPageState extends State<ChatPage> {
}
Widget
_buildInput
()
{
return
Material
(
elevation:
8
,
color:
LightColors
.
red
[
50
],
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
vertical:
8
,
horizontal:
16
),
child:
Material
(
elevation:
8
,
borderRadius:
BorderRadius
.
circular
(
8
),
child:
TextField
(
const
elevation
=
8.0
;
if
(
bloc
.
room
is
JoinedRoom
)
{
return
Material
(
elevation:
elevation
,
color:
LightColors
.
red
[
50
],
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
vertical:
8
,
horizontal:
16
),
child:
Material
(
elevation:
elevation
,
borderRadius:
BorderRadius
.
circular
(
8
),
child:
TextField
(
controller:
textController
,
textInputAction:
TextInputAction
.
newline
,
autocorrect:
true
,
...
...
@@ -163,11 +165,24 @@ class ChatPageState extends State<ChatPage> {
textController
.
clear
();
}
)
),
),
)
)
);
}
else
{
return
Material
(
elevation:
elevation
,
color:
Colors
.
white
,
child:
Padding
(
padding:
EdgeInsets
.
all
(
16
),
child:
Text
(
l
(
context
).
cantSendMessages
,
textAlign:
TextAlign
.
center
,
),
)
)
);
);
}
}
Widget
_buildLoadingIndicator
()
{
...
...
lib/src/ui/resources/localizations.dart
View file @
82af9ae8
...
...
@@ -44,6 +44,9 @@ class Strings {
final
groupName
=
'Group name'
;
final
participants
=
'Participants'
;
final
cantSendMessages
=
'You can
\'
t send messages to this group because you
\'
re no longer a participant.'
;
final
connectionLost
=
'Connection has been lost.
\n
'
'Make sure your phone has an active internet connection.'
;
...
...
pubspec.lock
View file @
82af9ae8
...
...
@@ -215,14 +215,14 @@ packages:
name: matrix_sdk
url: "https://pub.dartlang.org"
source: hosted
version: "0.1
2.3
"
version: "0.1
3.1
"
matrix_sdk_sqflite:
dependency: "direct main"
description:
name: matrix_sdk_sqflite
url: "https://pub.dartlang.org"
source: hosted
version: "0.
8
.0"
version: "0.
9
.0"
meta:
dependency: transitive
description:
...
...
pubspec.yaml
View file @
82af9ae8
...
...
@@ -12,8 +12,8 @@ dependencies:
injector
:
^1.0.6
matrix_sdk
:
^0.1
2.3
matrix_sdk_sqflite
:
^0.
8
.0
matrix_sdk
:
^0.1
3.1
matrix_sdk_sqflite
:
^0.
9
.0
rxdart
:
^0.21.0
...
...
Wilko Manger
@wilko
mentioned in issue
#41 (closed)
·
Jun 16, 2019
mentioned in issue
#41 (closed)
mentioned in issue #41
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment