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

How to change text styte depends on selected tab? #199

Open
RomanSoviak opened this issue Jul 19, 2023 · 0 comments
Open

How to change text styte depends on selected tab? #199

RomanSoviak opened this issue Jul 19, 2023 · 0 comments

Comments

@RomanSoviak
Copy link

RomanSoviak commented Jul 19, 2023

I have this code and I don't know how to change text Color depends on the tab selection

bottomNavigationBar: StyleProvider(
              style: BookReaderNavigationBarStyle(),
              child: ConvexAppBar(
                style: TabStyle.react,
                items: bottomNavigationItems,
                color: Colors.white,
                backgroundColor: AppColors.greyColor,
                initialActiveIndex: _tabIndex,
                onTap: (int index) {
                  if (index != _tabIndex) {
                    setState(() => _tabIndex = index);
                  }
                },
              ),
            ),

And this is my style:


class BookReaderNavigationBarStyle extends InternalStyle {
  @override
  TextStyle textStyle(Color color, fontFamily) {
    return TextStyle(
      color: Colors.black,
      fontSize: sp(12),
      fontWeight: FontWeight.w400,
      fontFamily: "ReaderStyle",
    );
  }
}
image
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