wheel_picker 0.3.0 copy "wheel_picker: ^0.3.0" to clipboard
wheel_picker: ^0.3.0 copied to clipboard

A value/time picking widget using input wheels. Customizable and light weight.

example/lib/main.dart

import 'package:example/wheel_picker_example1.dart';
import 'package:example/wheel_picker_example2.dart';
import 'package:flutter/material.dart';

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

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final List<ButtonSegment<WidgetBuilder>> _examples = [
    ButtonSegment(
      label: Text('time'),
      value: (context) => WheelPickerExample1(),
    ),
    ButtonSegment(
      label: Text('infinite and 0-1000'),
      value: (context) => WheelPickerExample2(),
    ),
  ];
  late WidgetBuilder _selectedExample = _examples.first.value;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Example',
      theme: ThemeData.dark(useMaterial3: true),
      home: Scaffold(
        body: SafeArea(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              Center(
                child: SegmentedButton<WidgetBuilder>(
                  segments: _examples,
                  selected: {_selectedExample},
                  onSelectionChanged: (selection) {
                    final first = selection.firstOrNull;
                    if (first == null) return;
                    setState(() {
                      _selectedExample = first;
                    });
                  },
                ),
              ),
              Expanded(child: Center(child: _selectedExample(context))),
            ],
          ),
        ),
      ),
    );
  }
}
76
likes
160
points
11.2k
downloads

Documentation

API reference

Publisher

verified publisherstavgafny.com

Weekly Downloads

A value/time picking widget using input wheels. Customizable and light weight.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on wheel_picker