Q:

Add dynamically generated hyperlinks in flutter , not using a CONST url?

I am hitting the newapi.org to recieve the recent news. I am using these data to create a list view using ListTile. Since each row in list need to have separate hyperlinks which corresponds to that news website, I cannot use a const value. URL launcher is not allowing to have a dynamic value based on index
What I want..
        const url = _newsArticles[index].urlToImage;
        if (await canLaunch(url)) {
          await launch(url);
          } else {
            throw 'Could not launch $url';
             } }), 

But it is throwing error
Const variables must be initialized with a constant value.
Try changing the initializer to be a constant expression.dart(const_initialized_with_non_constant_value).

I tried removing the const, but new erros pop up if I do that. I went through some docs of urllauncher, could find anything relevent
Main ListTileCode
         const url = 'https://github.com/ajaytomgeorge';
        if (await canLaunch(url)) {
          await launch(url);
          } else {
            throw 'Could not launch $url';
             } }), 

ListTile _buildItemsForListView(BuildContext context, int index) {
  return ListTile(

    leading:ClipRRect(
        borderRadius: BorderRadius.circular(20.0),
        child: Image(
        width: 90.0,
        image: NetworkImage(_newsArticles[index].urlToImage),
        fit: BoxFit.cover,
        ),
        ),
     //_newsArticles[index].urlToImage == null ? Image.asset(Constants.NEWS_PLACEHOLDER_IMAGE_ASSET_URL) : Image.network(_newsArticles[index].urlToImage), 
    subtitle: Text(
      _newsArticles[index].title, 
      style: TextStyle(
        fontSize: 16,
        fontWeight: FontWeight.w600,
        color: Colors.black87,
        )
        ),
    trailing:IconButton(
      icon: Icon(
      FontAwesomeIcons.locationArrow,
      size: 12.0,
      color: Colors.greenAccent,
      ),
      onPressed: () async {
        const url = 'https://github.com/ajaytomgeorge';
        //const url = _newsArticles[index].urlToImage;
        if (await canLaunch(url)) {
          await launch(url);
          } else {
            throw 'Could not launch $url';
             } }),    

    isThreeLine: true,
  );

}

A:

Eliminating the const URL completely can solve the problem
          onPressed: () async {

        if (await canLaunch(_newsArticles[index].urlToImage)) {
          await launch(_newsArticles[index].urlToImage);
          } else {
            throw 'Could not launch $_newsArticles[index].urlToImage';
             } }),    

