sticky_footer_scrollview 1.1.1 sticky_footer_scrollview: ^1.1.1 copied to clipboard
A Flutter Widget that is scrollable with a sticky footer either stick to the bottom of screen of the end of the scroll body.
import 'package:flutter/material.dart';
import 'package:sticky_footer_scrollview/sticky_footer_scrollview.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: HomePage(),
);
}
}
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: StickyFooterScrollView(
itemCount: 5,
itemBuilder: (context, index) {
return Card(
child: ListTile(
title: Text('content $index'),
),
color: Colors.pinkAccent,
);
},
footer: AppBar(
title: Text('i stick at bottom'),
),
),
),
);
}
}