slinky_view 1.0.1 copy "slinky_view: ^1.0.1" to clipboard
slinky_view: ^1.0.1 copied to clipboard

A sheet that aligns to the bottom of a widget and expands as scroll up.

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'SlinkyView example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  MyHomePageState createState() => MyHomePageState();
}

class MyHomePageState extends State<MyHomePage> {
  final _controller = SlinkyController();

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return SlinkyView(
      controller: _controller,
      panelParameter: SlinkyPanelParameter(
        contents: [
          SliverFixedExtentList(
            delegate: SliverChildBuilderDelegate(
              childCount: 10,
              (context, index) {
                return ColoredBox(
                  color: index % 2 == 0
                      ? Colors.grey.shade400
                      : Colors.grey.shade200,
                );
              },
            ),
            itemExtent: 120,
          ),
          const SliverFillRemaining(
            hasScrollBody: false,
            child: ColoredBox(color: Colors.white),
          ),
        ],
      ),
      body: Container(
        color: Colors.blue.shade100,
        width: double.infinity,
        height: double.infinity,
      ),
    );
  }
}
21
likes
140
pub points
65%
popularity

Publisher

unverified uploader

A sheet that aligns to the bottom of a widget and expands as scroll up.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on slinky_view