TF-1510 Support right click to open browser context menu (Open new tab) for app grid
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:url_launcher/link.dart';
|
||||||
|
|
||||||
|
class LinkBrowserWidget extends StatelessWidget {
|
||||||
|
|
||||||
|
final Uri uri;
|
||||||
|
final Widget child;
|
||||||
|
|
||||||
|
const LinkBrowserWidget({
|
||||||
|
Key? key,
|
||||||
|
required this.uri,
|
||||||
|
required this.child
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Link(
|
||||||
|
uri: uri,
|
||||||
|
builder: (context, function) => child
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
@@ -4,6 +4,7 @@ import 'package:core/presentation/utils/style_utils.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:tmail_ui_user/features/base/widget/link_browser_widget.dart';
|
||||||
import 'package:tmail_ui_user/features/mailbox_dashboard/domain/app_dashboard/linagora_app.dart';
|
import 'package:tmail_ui_user/features/mailbox_dashboard/domain/app_dashboard/linagora_app.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart' as launcher;
|
import 'package:url_launcher/url_launcher.dart' as launcher;
|
||||||
|
|
||||||
@@ -18,6 +19,8 @@ class AppGridDashboardItem extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||||
|
child: LinkBrowserWidget(
|
||||||
|
uri: app.appUri,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: _openApp,
|
onTap: _openApp,
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
@@ -47,6 +50,7 @@ class AppGridDashboardItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user