wheel_spinner 0.7.3 copy "wheel_spinner: ^0.7.3" to clipboard
wheel_spinner: ^0.7.3 copied to clipboard

A simple Flutter widget for updating a number using a pitch bender-like spinner

example/example.dart

import 'dart:math';

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

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

  @override
  State<MyWidget> createState() => _MyWidgetState();
}

class _MyWidgetState extends State<MyWidget> {
  late double value;

  @override
  void initState() {
    value = Random().nextDouble() * 100;
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Center(
      child: SizedBox(
        width: 100,
        height: 60,
        child: WheelSpinnerTheme(
          data: WheelSpinnerThemeData.light().copyWith(
            borderRadius: BorderRadius.circular(10),
            dividerColor: Colors.black,
          ),
          child: WheelSpinner(
            value: value,
            min: 0.0,
            max: 100.0,
            onSlideUpdate: (val) => setState(() => value = val),
          ),
        ),
      ),
    );
  }
}
14
likes
160
pub points
51%
popularity

Publisher

verified publishercasraf.dev

A simple Flutter widget for updating a number using a pitch bender-like spinner

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (license)

Dependencies

flutter

More

Packages that depend on wheel_spinner