Skip to content

AxonDesigns/sliver_appbar_builder

Repository files navigation

Sliver_appbar_builder

Adds a new widget that allows to use a builder to make custom appbars.

Getting Started

First, add the sliver_appbar_builder package to your pubspec.yaml.

dependencies:
  sliver_appbar_builder: <Package version>

or

dependencies:
  sliver_appbar_builder:
    git: 
      url: https://github.com/AxonDesigns/sliver_appbar_builder.git

then, use flutter pub get.

Now, import the package in your Dart code, use:

import 'package:sliver_appbar_builder/sliver_appbar_builder.dart';

Usage

SliverAppBarBuilder(
  expandedHeight: 150,
  collapsedHeight: 70,
  floating: false,
  pinned: true,
  contentBuilder: (context, shrinkOffset, statusBarHeight, overlapsContent) {
    return Container(
      color: Color.lerp(Colors.amber, Colors.red, shrinkOffset),
      child: Padding(
        padding: EdgeInsets.only(top: statusBarHeight),
        child: const Center(
          child: Text("Home Page"),
        ),
      ),
    );
  },
);

About

A Flutter package to make custom sliver appbars.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published