FLUTTER ECOSYSTEM

amitkot/appbar_elevation

一个 Flutter 小部件,用于 AppBar,初始时与主体对齐,滚动时升高

appbar_elevation 项目封面
Stars
9
Forks
3
最近推送(UTC)
2021年10月15日
项目状态
未归档
Amit Kotlovski GitHub avatar
GITHUB User

Amit Kotlovski ↗

语言DartSwiftKotlinObjective-C

此仓库发布的插件

使用的依赖

依赖清单 2 项
  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

appbar_elevation

pub package

A Flutter Widget for an AppBar that is initially flush with the body and elevated when scrolled.

https://raw.githubusercontent.com/amitkot/appbar_elevation/HEAD/appbar_elevation.gif

Usage

Use the ScrollActivatedAppBarElevation widget to wrap a Scaffold that contains a Scrollable view (e.g. ListView, CustomScrollView). The widget uses a NotificationListener to detect the scroll position and provides an appBarElevation value to be used.

Example

@override
Widget build(BuildContext context) {
  return ScrollActivatedAppBarElevation(
    builder: (BuildContext context, double appBarElevation) {
      return Scaffold(
        appBar: AppBar(
          elevation: appBarElevation,
        ),
        body: ListView(
          children: [
            // ...
          ],
        ),
      );
    },
  );
}

See example for full code.

License

BSD