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

flutter plugin which gives you a vertical picker that allow users pick item in scollable list

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Home(),
    );
  }
}

class Home extends StatelessWidget {
  const Home({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Vertical Picker"),
      ),
      body: SizedBox(
        height: MediaQuery.of(context).size.height,
        width: MediaQuery.of(context).size.width,
        child: VerticalPicker(
          // give height for eacch item
          itemHeight: MediaQuery.of(context).size.height / 15,

          // margin for border
          leftMargin: 150,
          rightMargin: 150,

          // create list of text for items
          items: List.generate(
              10,
              (index) => Center(
                    child: Text(index.toString()),
                  )),

          // empty void for item selected
          onSelectedChanged: (indexSelected) {},

          // give color to border
          borderColor: Colors.red,

          // thickness of border
          borderThickness: 3,
        ),
      ),
    );
  }
}
copied to clipboard
7
likes
160
points
81
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.29 - 2025.04.13

flutter plugin which gives you a vertical picker that allow users pick item in scollable list

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on vertical_picker