number_paginator 0.0.1 copy "number_paginator: ^0.0.1" to clipboard
number_paginator: ^0.0.1 copied to clipboard

outdated

A paginator to switch between page numbers.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:number_paginator/number_paginator.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  int _numPages = 10;
  int _currentPage = 0;

  @override
  Widget build(BuildContext context) {
    var pages = List.generate(
      _numPages,
      (index) => Center(
        child: Text("Page ${index + 1}"),
      ),
    );

    return MaterialApp(
      theme: ThemeData(primarySwatch: Colors.orange),
      home: Scaffold(
        appBar: AppBar(
          title: Text("Number Paginator Example"),
        ),
        body: Column(
          children: [
            Expanded(
              child: Container(
                color: Theme.of(context).backgroundColor,
                child: pages[_currentPage],
              ),
            ),
            NumberPaginator(
              numberPages: _numPages,
              onPageChange: (int index) {
                setState(() {
                  _currentPage = index;
                });
              },
            ),
          ],
        ),
      ),
    );
  }
}
81
likes
0
pub points
96%
popularity

Publisher

verified publisherwiefel.dev

A paginator to switch between page numbers.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on number_paginator