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

Custom Icon support #58

Closed
Amr1440 opened this issue May 5, 2021 · 9 comments
Closed

Custom Icon support #58

Amr1440 opened this issue May 5, 2021 · 9 comments

Comments

@Amr1440
Copy link

Amr1440 commented May 5, 2021

Is it possible to use custom icons from assets ?

@sooxt98
Copy link
Owner

sooxt98 commented May 5, 2021

just use the leading param in GButton, check out the example

leading: selectedIndex == 1 || badge == 0

@golnarSheikhBahaie
Copy link

thnx a lot ;)

@Amr1440
Copy link
Author

Amr1440 commented Jun 29, 2021

Sorry i didnt understand what do you mean ?
what i want do is like this :
Image.asset('assets/images/profile.png'),
@sooxt98

@Amr1440
Copy link
Author

Amr1440 commented Jul 4, 2021

@golnarSheikhBahaie Can you please explain @sooxt98 answer to me ?

@sooxt98
Copy link
Owner

sooxt98 commented Jul 11, 2021

@Amr1440 Just do this, you're good to go.

GButton(
  // icon: LineIcons.home,
  leading: Image.asset('assets/images/profile.png'),
  text: 'Home',
),

Besides, you could always check back to the example provided

leading: CircleAvatar(

@ghost
Copy link

ghost commented Aug 23, 2021

Icon is required even when you use leading image.

@ghost
Copy link

ghost commented Aug 23, 2021

Icon is required even when you use leading image.

Please remove required at least so we can use custom images as Icon or support for Icons natively would be great so we can use assetIcons. Great package but can't seem to go around it.

@sooxt98
Copy link
Owner

sooxt98 commented Aug 23, 2021 via email

@ghost
Copy link

ghost commented Aug 23, 2021

It’s by design, firstly icon can’t be null it’s required to make all the tabbar leading size stays consistent. Leading accepts any widget, you just have to pass in dummy icon data as a default size placeholder.

On Tue, 24 Aug 2021 at 2:50 AM, RazaShabbir-vrc @.***> wrote: Icon is required even when you use leading image. Please remove required at least so we can use custom images as Icon or support for Icons natively would be great so we can use assetIcons. Great package but can't seem to go around it. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#58 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGCEC4DCONUN66VZZJC3KLT6KJ6BANCNFSM44ESXJTQ .

Got it, I think this resolves it. Thanks for the awesome package!

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

No branches or pull requests

3 participants