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

CircleAvatar Not Work if local assets Image #2740

Closed
bobwatcherx opened this issue Feb 24, 2024 · 2 comments · Fixed by #2882
Closed

CircleAvatar Not Work if local assets Image #2740

bobwatcherx opened this issue Feb 24, 2024 · 2 comments · Fixed by #2882
Assignees
Labels
bug Something isn't working enhancement Improvement/Optimization

Comments

@bobwatcherx
Copy link

i try circleAvatar for local image in assets not work . but i using Image() is work

circleAvatar only Work for url Image

code

from flet import *


class Stories(UserControl):
	def __init__(self):
		super(Stories, self).__init__()
		self.man_picture = CircleAvatar(
			foreground_image_url="assets/man.jpg"
			)


	def build(self):
		return Column([
			Text("dqwd"),
			self.man_picture
			])

def main(page:Page):
	page.window_width = 300

	page.add(Stories())

app(main,view=AppView.WEB_BROWSER,port=5050,assets_dir="assets")
@InesaFitsner InesaFitsner added the bug Something isn't working label Feb 26, 2024
@lekshmanmj
Copy link

i try circleAvatar for local image in assets not work . but i using Image() is work

circleAvatar only Work for url Image

code

from flet import *


class Stories(UserControl):
	def __init__(self):
		super(Stories, self).__init__()
		self.man_picture = CircleAvatar(
			foreground_image_url="assets/man.jpg"
			)


	def build(self):
		return Column([
			Text("dqwd"),
			self.man_picture
			])

def main(page:Page):
	page.window_width = 300

	page.add(Stories())

app(main,view=AppView.WEB_BROWSER,port=5050,assets_dir="assets")

can pleas try by replacing "assets/man.jpg" with "./man.jpg"

@ndonkoHenri ndonkoHenri linked a pull request Mar 20, 2024 that will close this issue
@ndonkoHenri ndonkoHenri added the enhancement Improvement/Optimization label Mar 20, 2024
@ndonkoHenri ndonkoHenri self-assigned this Mar 20, 2024
@ndonkoHenri
Copy link
Collaborator

A pre-release with the fix concerning this issue is now available. Try it and report if you face any further issues or have any questions:

pip install flet --pre

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement Improvement/Optimization
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

4 participants