Skip to content
pubscout

animated_toggle

0.1.3, released 3 years ago by an unverified publisher

Custom animated toggle widget for Flutter

WASM-ready
$ flutter pub add animated_toggle
Source repository

What it does

Provides horizontal and vertical animated toggle with customizable colors, padding, text styles, and callbacks.

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

Use it when

  • Need a simple animated toggle
  • Require RTL support
  • Want quick UI customization
  • Need both horizontal and vertical variants

Skip it when

  • Need complex state management
  • Require extensive testing
  • Need accessibility features beyond basic

Strengths

  • Easy to integrate
  • Highly customizable
  • Supports RTL alignment
  • Includes both horizontal and vertical styles

Weaknesses

  • Limited documentation examples
  • No unit tests
  • No advanced accessibility support

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
import 'package:animated_toggle/animated_toggle.dart';

AnimatedHorizontalToggle(
  taps: const ['First', 'Second', 'Last'],
  width: 300,
  height: 48,
  duration: const Duration(milliseconds: 300),
  initialIndex: 0,
  background: Colors.black.withOpacity(0.1),
  activeColor: Colors.deepPurple,
  activeTextStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white),
  inActiveTextStyle: const TextStyle(fontSize: 14, fontWeight: FontWeight.w400, color: Colors.deepPurple),
  horizontalPadding: 4,
  verticalPadding: 4,
  activeHorizontalPadding: 2,
  activeVerticalPadding: 4,
  radius: 14,
  activeButtonRadius: 14,
  onChange: (int currentIndex, int targetIndex) {},
  showActiveButtonColor: true,
  local: 'en',
);

Alternatives

Packages that do the same job and could replace animated_toggle.

Works with

Packages commonly used together with animated_toggle: ones it builds on, ones built on it, and its own family.