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

StyleHook issue #209

Open
ZahidUrRehman13 opened this issue Dec 18, 2023 · 0 comments
Open

StyleHook issue #209

ZahidUrRehman13 opened this issue Dec 18, 2023 · 0 comments

Comments

@ZahidUrRehman13
Copy link

when insert svg image in place of icon and active icon, it overflow the circle and when i decrease the active icon size as per direction then it unfortunaltly does not change the icon size

bottomNavigationBar: StyleProvider(
style: Style(),
child: ConvexAppBar(
items: [
tabWidget("asset/png/default/calende.svg"),
tabWidget("asset/png/default/plate.svg"),
tabWidget("asset/png/default/dashboard.svg"),
tabWidget("asset/png/default/main.svg"),
tabWidget("asset/png/default/file.svg"),
],
onTap: (i) => setState(() => currentIndex = i),
backgroundColor: ConstantColor.colorBottomStatusBar,
activeColor: ConstantColor.colorOrangeTiger,
initialActiveIndex: 2,
top: -15,
style: TabStyle.custom,
),
))

TabItem tabWidget(String images) {
return TabItem(
icon: SvgPicture.asset(
images,
color: ConstantColor.colorBlack,
),
activeIcon: SvgPicture.asset(
images,
color: ConstantColor.colorWhite,
)
);
}

class Style extends StyleHook {
@OverRide
double get activeIconSize => 30;

@OverRide
double get activeIconMargin => 8;

@OverRide
double get iconSize => 30;

@OverRide
TextStyle textStyle(Color color, String? fontFamily) {
return TextStyle(fontSize: 0, color: color);
}

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

1 participant