sooxt98 / google_nav_bar

A modern google style nav bar for flutter.
MIT License
749 stars 114 forks source link

feat: color background gradient #11

Closed Kiruel closed 4 years ago

Kiruel commented 4 years ago

Close https://github.com/sooxt98/google_nav_bar/issues/9

Adding an option tabBackgroundGradient in the GNav and backgroundGradient to the GButton. You need to pass a Gradient. Example:

For the GNav:

tabBackgroundGradient: LinearGradient(
    begin: Alignment.centerLeft,
    end: Alignment.centerRight,
    colors: [
        const Color(0xFFCC0000),
        const Color(0xFFFFAD01),
    ],
    stops: [
        0.0,
        1.0,
    ],
),

For the GButton:

backgroundGradient: LinearGradient(
    begin: Alignment.centerLeft,
    end: Alignment.centerRight,
    colors: [
        const Color(0xFFCC0000),
        const Color(0xFFFFAD01),
    ],
    stops: [
        0.0,
        1.0,
    ],
),
sooxt98 commented 4 years ago

LGTM!