feat: implement retreiving widgets
- display a bottom sheet with widgets - open widgets in a browser - fixes in .gitignore - Windows UWP build files Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
This commit is contained in:
parent
17f703345c
commit
31bec1a0d8
74 changed files with 1363 additions and 327 deletions
40
lib/pages/chat/cupertino_widgets_bottom_sheet.dart
Normal file
40
lib/pages/chat/cupertino_widgets_bottom_sheet.dart
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:url_launcher/link.dart';
|
||||
|
||||
class CupertinoWidgetsBottomSheet extends StatelessWidget {
|
||||
final Room room;
|
||||
|
||||
const CupertinoWidgetsBottomSheet({Key? key, required this.room})
|
||||
: super(key: key);
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoActionSheet(
|
||||
title: Text(L10n.of(context)!.matrixWidgets),
|
||||
actions: [
|
||||
...room.widgets.map(
|
||||
(widget) => Link(
|
||||
builder: (context, callback) {
|
||||
return CupertinoActionSheetAction(
|
||||
child: Text(widget.name),
|
||||
onPressed: callback ?? () {},
|
||||
);
|
||||
},
|
||||
target: LinkTarget.blank,
|
||||
uri: Uri.parse(widget.url),
|
||||
),
|
||||
),
|
||||
CupertinoActionSheetAction(
|
||||
child: Text(L10n.of(context)!.integrationsNotImplemented),
|
||||
onPressed: () {},
|
||||
),
|
||||
CupertinoActionSheetAction(
|
||||
child: Text(L10n.of(context)!.cancel),
|
||||
onPressed: Navigator.of(context).pop,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue