wSample2 method
Widget
wSample2(
- dynamic context
)
Implementation
Widget wSample2(context) {
return Scaffold(
backgroundColor: Theme.of(context).primaryColor,
body: SafeArea(
top: true,
bottom: false,
child: ColoredBox(
color: Colors.white,
child: CustomScrollView(
slivers: [
SliverPersistentHeader(
floating: true,
delegate: SliverHeaderDelegate.fixedHeight(
height: 48,
child: Material(
color: Colors.blue,
child: wSearch(),
),
),
),
MediaQuery.removePadding(
context: context,
removeTop: true,
child: const SliverAppBar(
title: Text('示例二'),
pinned: true,
collapsedHeight: 56,
),
),
SliverPersistentHeader(
pinned: true,
delegate: SliverHeaderDelegate.fixedHeight(
height: 50,
child: buildHeader(2),
),
),
buildSliverList(30),
],
),
),
),
);
}