infinite_scroll 1.1.1 infinite_scroll: ^1.1.1 copied to clipboard
A flutter package which provides List and Grid widgets for infinite scrolling views.
import 'package:example/grid_example.dart';
import 'package:example/list_example.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Infinite Scroll Package',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
elevatedButtonTheme: ElevatedButtonThemeData(
style:
ElevatedButton.styleFrom(minimumSize: const Size(300, 50)))),
home: const HomePage(),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: true,
title: Column(
children: [
Text(
'Infinite Scroll Package',
style: Theme.of(context)
.textTheme
.headline5
?.copyWith(color: Colors.white),
),
Text(
'Example App',
style: Theme.of(context)
.textTheme
.bodyText2
?.copyWith(color: Colors.white),
)
],
),
),
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ElevatedButton.icon(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: ((context) => const ListExample())));
},
icon: const Icon(Icons.list),
label: const Text(
'List Example',
),
),
const SizedBox(
height: 20,
),
ElevatedButton.icon(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: ((context) => const GridExample())));
},
icon: const Icon(Icons.grid_3x3),
label: const Text(
'Grid Example',
),
),
],
),
),
);
}
}