flutter_touch_spin 2.0.0-nullsafety.1 copy "flutter_touch_spin: ^2.0.0-nullsafety.1" to clipboard
flutter_touch_spin: ^2.0.0-nullsafety.1 copied to clipboard

outdated

Simple number input spinner Widget for Flutter. Inspired by Bootstrap Touchspin

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_touch_spin/flutter_touch_spin.dart';
import 'package:intl/intl.dart';

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

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

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter TouchSpin Example',
      theme: ThemeData(
        brightness: Brightness.dark,
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Flutter TouchSpin Example'),
        ),
        body: Center(
          child: TouchSpin(
            value: 10,
            min: 5,
            max: 100,
            step: 5,
            displayFormat: NumberFormat.currency(locale: 'en_US', symbol: '\$'),
            textStyle: const TextStyle(fontSize: 36),
            iconSize: 48.0,
            addIcon: const Icon(Icons.add_circle_outline),
            subtractIcon: const Icon(Icons.remove_circle_outline),
            iconActiveColor: Colors.green,
            iconDisabledColor: Colors.grey,
            iconPadding: const EdgeInsets.all(20),
            onChanged: (val) {
              print(val);
            },
            enabled: true,
          ),
        ),
      ),
    );
  }
}
45
likes
0
pub points
75%
popularity

Publisher

verified publisherdanvickmiller.dev

Simple number input spinner Widget for Flutter. Inspired by Bootstrap Touchspin

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, intl

More

Packages that depend on flutter_touch_spin