fix: http:// prefix issue fix (#2719)

This commit is contained in:
chirag paneliya 2023-06-07 05:27:12 +05:30 committed by GitHub
parent 381d2e6c71
commit bfe6c8074a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -299,7 +299,7 @@ class _VisitURLAccessoryState extends State<_VisitURLAccessory>
void onTap() { void onTap() {
var content = var content =
widget.cellContext.getCellData(loadIfNotExist: false)?.content ?? ""; widget.cellContext.getCellData(loadIfNotExist: false)?.content ?? "";
if (!content.contains('http://')) { if (!content.startsWith('http://') && !content.startsWith('https://')) {
content = 'http://$content'; content = 'http://$content';
} }
final uri = Uri.parse(content); final uri = Uri.parse(content);