When calling a URL with launchUrl, the primary one or two instances it navigates to the right URL, however after that, it will get caught on a selected URL. Under is the code I used.
String getReportUrl() {
last String formattedDate =
DateFormat('yyyy-MM-dd').format(strToDateTime(errorDate));
print(
"CALL https://www.aaa.web/bbb/ccc-ddd?retailer=${information.retailer}&startDate=$formattedDate&endDate=$formattedDate");
return "https://www.aaa.web/bbb/ccc-ddd?retailer=${information.retailer}&startDate=$formattedDate&endDate=$formattedDate";
}
void _clickURL() async {
Uri url = Uri.parse(getReportUrl());
if (await canLaunchUrl(url)) {
await launchUrl(url);
} else {
throw "Couldn't launch $url";
}
}
Why does this occur, and please present an answer.
I checked if there was a problem with parsing the URL in getReportUrl(), however every thing was high quality. Additionally, I logged the URL throughout the name, and the log confirmed the right URL I meant to navigate to.