Skip to content
pubscout

flutter_switch

0.3.2, released 5 years ago by nickromero.dev

A custom switch widget with configurable height, width, colors, borders, text, and toggle icons.

WASM-ready
$ flutter pub add flutter_switch
Source repository

What it does

Provides a customizable switch widget for Flutter applications. Allows developers to modify dimensions, border radius, colors, toggle size, and display custom on/off text and toggle icons.

AI-written summary of version 0.3.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a switch widget with custom styling that goes beyond standard Material or Cupertino switches.
  • You want to display custom text or icons inside the switch toggle.

Skip it when

  • You strictly require platform-native switch visuals without any custom styling.
  • You are not using Flutter.

Strengths

  • Highly customizable dimensions, colors, borders, and border radius.
  • Supports custom text and icons (including images and font awesome icons) inside the toggle.
  • Smooth toggle and opacity animations.

Weaknesses

  • Limited to a single custom switch widget and its variations.
  • No complex form state management built-in beyond the standard onToggle callback.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
FlutterSwitch(
  width: 125.0,
  height: 55.0,
  valueFontSize: 25.0,
  toggleSize: 45.0,
  value: status,
  borderRadius: 30.0,
  padding: 8.0,
  showOnOff: true,
  onToggle: (val) {
    setState(() {
      status = val;
    });
  },
)

Alternatives

Packages that do the same job and could replace flutter_switch.