Skip to content

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

Open
@RomanSoviak

Description

@RomanSoviak

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions