Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FCPListItem does not support imageUrl #20

Open
vanlooverenkoen opened this issue Sep 14, 2022 · 3 comments · May be fixed by #24
Open

FCPListItem does not support imageUrl #20

vanlooverenkoen opened this issue Sep 14, 2022 · 3 comments · May be fixed by #24

Comments

@vanlooverenkoen
Copy link

Current implementation to set an image to a listItem is using an asset

    if image != nil {
      listItem.setImage(UIImage().fromFlutterAsset(name: image!))
    }

It should be possible to also use a HTTPs link to an image so we don't need to ship every image in assets

vanlooverenkoen added a commit to icapps/flutter_carplay that referenced this issue Sep 14, 2022
vanlooverenkoen added a commit to icapps/flutter_carplay that referenced this issue Sep 20, 2022
vanlooverenkoen added a commit to icapps/flutter_carplay that referenced this issue Sep 20, 2022
vanlooverenkoen added a commit to icapps/flutter_carplay that referenced this issue Sep 20, 2022
vanlooverenkoen added a commit to icapps/flutter_carplay that referenced this issue Sep 21, 2022
vanlooverenkoen added a commit to icapps/flutter_carplay that referenced this issue Sep 21, 2022
@bensalcie
Copy link

Hi @vanlooverenkoen I was able to load list items with image url by doing the following.

  1. Open the flutter iOS project in XCODE

  2. Open the PODS->Development Pods->flutter_carplay

  3. Open the preceding .. unto the last directory, you will find flutter_carplay->Classes->Models -> Lists

  4. Navigate to FCPListItem.

  5. Find the codes:

  6. if image != nil { ...
    7.Replace with :
    ` if image != nil {
    if image!.starts(with: "http"){

         let url = URL(string: image!)
         let stationImage = try? UIImage(withURL: url!)
         
         listItem.setImage(stationImage)
     }else{
         listItem.setImage(UIImage().fromFlutterAsset(name: image!))
     }
    

    }`

  7. Inside update, do the same.
    This will intercept all urls beginning with http with custom loader and those beginning with any other format as asset images.
    Thank you.

@vanlooverenkoen
Copy link
Author

Yes indeed that is why a pull request implementing this feature a month ago. #24

szeidner added a commit to szeidner/flutter_carplay that referenced this issue Nov 30, 2022
@harryandroiddev
Copy link

flutter: Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction , After loading images from ulr i got this error and the mobile app ui freezes .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants