Minor fixes
This commit is contained in:
parent
f721045d00
commit
76596cafb4
6 changed files with 43 additions and 20 deletions
|
|
@ -51,7 +51,16 @@ class MatrixState extends State<Matrix> {
|
|||
FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
|
||||
FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
|
||||
FlutterLocalNotificationsPlugin();
|
||||
Map<String, dynamic> shareContent;
|
||||
Map<String, dynamic> get shareContent => _shareContent;
|
||||
set shareContent(Map<String, dynamic> content) {
|
||||
_shareContent = content;
|
||||
onShareContentChanged.add(_shareContent);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _shareContent;
|
||||
|
||||
final StreamController<Map<String, dynamic>> onShareContentChanged =
|
||||
StreamController.broadcast();
|
||||
|
||||
String activeRoomId;
|
||||
File wallpaper;
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ class _ChatState extends State<_Chat> {
|
|||
title: selectedEvents.isEmpty
|
||||
? Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: Platform.isIOS
|
||||
crossAxisAlignment: !kIsWeb && Platform.isIOS
|
||||
? CrossAxisAlignment.center
|
||||
: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
|
|
|
|||
|
|
@ -125,7 +125,6 @@ class _ChatListState extends State<ChatList> {
|
|||
path: file.path,
|
||||
),
|
||||
};
|
||||
setState(() => null);
|
||||
}
|
||||
|
||||
void _processIncomingSharedText(String text) {
|
||||
|
|
@ -141,7 +140,6 @@ class _ChatListState extends State<ChatList> {
|
|||
"msgtype": "m.text",
|
||||
"body": text,
|
||||
};
|
||||
setState(() => null);
|
||||
}
|
||||
|
||||
void _initReceiveSharingINtent() {
|
||||
|
|
@ -170,11 +168,18 @@ class _ChatListState extends State<ChatList> {
|
|||
);
|
||||
_intentDataStreamSubscription?.cancel();
|
||||
_intentFileStreamSubscription?.cancel();
|
||||
_onShareContentChangedSub?.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
StreamSubscription _onShareContentChangedSub;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
_onShareContentChangedSub ??= Matrix.of(context)
|
||||
.onShareContentChanged
|
||||
.stream
|
||||
.listen((c) => setState(() => null));
|
||||
if (Matrix.of(context).shareContent != null) {
|
||||
selectMode = SelectMode.share;
|
||||
} else if (selectMode == SelectMode.share) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue