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
|
||||
);
|
||||
}
|
||||
}
|
||||
+31
-27
@@ -4,6 +4,7 @@ import 'package:core/presentation/utils/style_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.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:url_launcher/url_launcher.dart' as launcher;
|
||||
|
||||
@@ -18,35 +19,38 @@ class AppGridDashboardItem extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: InkWell(
|
||||
onTap: _openApp,
|
||||
child: Column(children: [
|
||||
app.iconName.endsWith("svg")
|
||||
? SvgPicture.asset(
|
||||
_imagePaths.getConfigurationImagePath(app.iconName),
|
||||
width: 56,
|
||||
height: 56,
|
||||
fit: BoxFit.fill)
|
||||
: Image.asset(
|
||||
_imagePaths.getConfigurationImagePath(app.iconName),
|
||||
width: 56,
|
||||
height: 56,
|
||||
fit: BoxFit.fill),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: Text(
|
||||
app.appName,
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.center,
|
||||
softWrap: CommonTextStyle.defaultSoftWrap,
|
||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||
style: const TextStyle(
|
||||
color: AppColor.colorNameEmail,
|
||||
fontSize: 15
|
||||
child: LinkBrowserWidget(
|
||||
uri: app.appUri,
|
||||
child: InkWell(
|
||||
onTap: _openApp,
|
||||
child: Column(children: [
|
||||
app.iconName.endsWith("svg")
|
||||
? SvgPicture.asset(
|
||||
_imagePaths.getConfigurationImagePath(app.iconName),
|
||||
width: 56,
|
||||
height: 56,
|
||||
fit: BoxFit.fill)
|
||||
: Image.asset(
|
||||
_imagePaths.getConfigurationImagePath(app.iconName),
|
||||
width: 56,
|
||||
height: 56,
|
||||
fit: BoxFit.fill),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: Text(
|
||||
app.appName,
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.center,
|
||||
softWrap: CommonTextStyle.defaultSoftWrap,
|
||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||
style: const TextStyle(
|
||||
color: AppColor.colorNameEmail,
|
||||
fontSize: 15
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
]),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user