This commit is contained in:
1 parent
f89ca690c8
commit
96544ca924
22 files changed
+1026
-381
No files matched your search
@@ -5,8 +5,8 @@ import 'package:flutter_chat_types/flutter_chat_types.dart' as types;
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:mqtt5_client/mqtt5_client.dart';
|
||||
import 'package:stadtbote/content_views/utils/content_view_widget.dart';
|
||||
import 'package:stadtbote/content_views/utils/header_info.dart';
|
||||
import 'package:stadtbote/main.dart';
|
||||
import 'package:stadtbote/messages/pop_content_view_message.dart';
|
||||
import 'package:stadtbote/model/message.dart' as sbmessage;
|
||||
import 'package:stadtbote/model/message.dart';
|
||||
import 'package:stadtbote/model/session_status.dart';
|
||||
@@ -23,21 +23,10 @@ class MessagesPage extends ContentViewWidget {
|
||||
State<MessagesPage> createState() => _MessagesPageState();
|
||||
|
||||
@override
|
||||
Future<HeaderInfo> getHeaderInfo(BuildContext context) async {
|
||||
return HeaderInfo(
|
||||
titleWidget: const Text(
|
||||
'Nachrichten',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20.0,
|
||||
),
|
||||
),
|
||||
rightButtonEnabled: true,
|
||||
rightButtonVisible: true,
|
||||
rightButtonImage: Util.fetchFutureIcon(const Icon(Icons.help_outline, size: 20.0, color: Colors.white)),
|
||||
rightButtonOnPressed: () async {
|
||||
await Util.startBrowser('https://app.assecutor.de/help/sb/app/context/003/index.html');
|
||||
});
|
||||
Future<Widget> getHeaderWidget(BuildContext context) async {
|
||||
await Future.delayed(const Duration(microseconds: 0));
|
||||
|
||||
return _HeaderWidget();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,3 +186,90 @@ class _MessagesPageState extends State<MessagesPage> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class _HeaderWidget extends StatefulWidget {
|
||||
@override
|
||||
State<_HeaderWidget> createState() => _HeaderWidgetState();
|
||||
}
|
||||
|
||||
class _HeaderWidgetState extends State<_HeaderWidget> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var cellWidth = (MediaQuery.of(context).size.width - 60 - 60 - 25) / 2;
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: Container(
|
||||
width: 60,
|
||||
height: 60,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.white,
|
||||
),
|
||||
child: FittedBox(
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
await MessageService().publish<PopContentViewMessage>(Constants.messageTopicPopContentView, arguments: PopContentViewMessage(count: 1));
|
||||
},
|
||||
child: const CircleAvatar(
|
||||
radius: 10,
|
||||
backgroundColor: Constants.colorPrimary,
|
||||
child: Padding(padding: EdgeInsets.all(1.0), child: Icon(Icons.arrow_back, size: 20.0, color: Colors.white)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: false,
|
||||
child: Container(
|
||||
width: 60,
|
||||
height: 60,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
child: FittedBox(
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
await MessageService().publish<PopContentViewMessage>(Constants.messageTopicPopContentView, arguments: PopContentViewMessage(count: 1));
|
||||
},
|
||||
child: const CircleAvatar(
|
||||
backgroundColor: Constants.colorPrimary,
|
||||
radius: 10,
|
||||
child: Padding(padding: EdgeInsets.all(1.0), child: Icon(Icons.info_outline, size: 20.0, color: Colors.white))),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 100,
|
||||
width: cellWidth * 2,
|
||||
child: const Center(
|
||||
child: Text(
|
||||
textAlign: TextAlign.center,
|
||||
"Nachrichten",
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user