Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import 'package:flutter/material.dart';
class Demo extends StatefulWidget {
@override
DemoState createState() => new DemoState();
}
class DemoState extends State<Demo> with TickerProviderStateMixin {
@override
Widget build(BuildContext context) {
ThemeData themeData = Theme.of(context);
return new ListView.builder(
itemBuilder: (BuildContext context, int index) {
return new Container(
child: new Text("Foo $index", style: themeData.textTheme.display2),
);
},
);
}
}
void main() {
ScrollController _scrollController = new ScrollController(
initialScrollOffset: 150.0,
);
runApp(new MaterialApp(
home: new NestedScrollView(
controller: _scrollController,
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
new SliverAppBar(
title: new Text('NestedScrollView demo'),
expandedHeight: 300.0,
pinned: true,
),
];
},
body: new Material(
child: new Demo(),
),
)
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.