TF-2078 Sync use launchLink to open hyper link

(cherry picked from commit f5c9b0b0f2d2c5fcf06201fb06a1534f5da3a0f7)
This commit is contained in:
dab246
2023-08-10 18:27:38 +07:00
committed by Dat Vu
parent 9529c6c590
commit d29321da39
4 changed files with 7 additions and 27 deletions
@@ -1,7 +1,7 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/widgets.dart';
import 'package:tmail_ui_user/features/base/styles/hyper_link_widget_styles.dart';
import 'package:url_launcher/url_launcher_string.dart';
import 'package:tmail_ui_user/main/utils/app_utils.dart';
class HyperLinkWidget extends StatelessWidget {
@@ -19,14 +19,7 @@ class HyperLinkWidget extends StatelessWidget {
fontSize: HyperLinkWidgetStyles.textSize,
decoration: TextDecoration.underline
),
recognizer: TapGestureRecognizer()..onTap = () async {
if (await canLaunchUrlString(urlString)) {
launchUrlString(
urlString,
mode: LaunchMode.externalApplication
);
}
}
recognizer: TapGestureRecognizer()..onTap = () => AppUtils.launchLink(urlString)
)
);
}