๐Ÿ“ž Call Slider Button

pub package pub points likes Flutter License: MIT

A beautiful, fully customizable incoming-call slider for Flutter. Swipe right to accept, swipe left to decline โ€” with smooth animations, haptic feedback and built-in screen-reader support.

Slide right to accept    Slide left to decline

Slide to accept  ยท  Slide to decline


โœจ Features

  • ๐Ÿ‘‰ Swipe to accept / decline with a pulsing call button
  • ๐ŸŽจ Fully customizable โ€” text, colors, icons, size, radius and drag threshold
  • ๐Ÿ“ณ Haptic feedback when the drag passes the threshold
  • ๐ŸŒ€ Smooth animations โ€” color glow while dragging, springs back to center on release
  • โ™ฟ Accessible โ€” TalkBack and VoiceOver users get Accept / Decline actions, no dragging needed
  • ๐Ÿงฉ Material 3 ready โ€” built on Flutter's standalone material_ui package
  • ๐Ÿ“ฑ Every platform โ€” Android, iOS, web, macOS, Windows and Linux (pure Dart, no native code)

๐Ÿš€ Getting started

Install

flutter pub add call_slider_button

or add it to your pubspec.yaml manually:

dependencies:
  call_slider_button: ^3.0.0

Requirements

call_slider_button Flutter Dart
3.x >=3.47.0 ^3.13.0
2.x >=3.27.0 <3.47.0 >=3.6.0

Version 3 works in apps that have migrated to material_ui and in apps still using the SDK's built-in package:flutter/material.dart.


๐Ÿ“ฆ Usage

import 'package:call_slider_button/call_slider_button.dart';

CallSliderButton(
  onAccept: () => debugPrint('Call accepted'),
  onDecline: () => debugPrint('Call declined'),
);

Customized

CallSliderButton(
  onAccept: () => debugPrint('Call accepted'),
  onDecline: () => debugPrint('Call declined'),
  acceptText: 'Answer',
  declineText: 'Reject',
  acceptColor: Colors.teal,
  declineColor: Colors.orange,
  backgroundColor: const Color(0xFF1E1E1E),
  iconColor: Colors.tealAccent,
  callBtnBackgroundColor: Colors.black87,
  height: 80,
  width: 320,
  borderRadius: 40,
  iconSize: 30,
  iconRadius: 28,
  dragThreshold: 100,
);

โš™๏ธ Parameters

Callbacks

Parameter Type Description Default
onAccept VoidCallback Called when the button is dragged right past dragThreshold. required
onDecline VoidCallback Called when the button is dragged left past dragThreshold. required

Text

Parameter Type Description Default
acceptText String Label on the right side while idle. 'Accept'
declineText String Label on the left side while idle. 'Decline'
textStyle TextStyle? Style for both labels. white, 20 px, medium weight

Colors

Parameter Type Description Default
acceptColor Color Track glow while dragging right. Colors.green
declineColor Color Track glow while dragging left. Colors.red
backgroundColor Color Track color while idle. Color(0x33FFFFFF) (translucent white)
iconColor Color Color of the default accept icon. Colors.green
borderColor Color Border color of the track. Color(0xFFEBEBEB)
callBtnBackgroundColor Color Background of the round call button. Colors.white

Icons

Parameter Type Description Default
acceptIcon Widget? Shown while idle or dragging right. Icon(Icons.call)
declineIcon Widget? Shown while dragging left. Icon(Icons.call_end)

Size & behavior

Parameter Type Description Default
width double? Track width. 80 % of screen width
height double Track height. 70
borderRadius double Track corner radius. 50
iconSize double Size of the icon inside the call button. 35
iconRadius double Radius of the round call button. 30
dragThreshold double Distance (logical px) needed to accept or decline. 80.0

โ™ฟ Accessibility

The slider is exposed to screen readers as a single element with two custom actions named after your acceptText and declineText:

  • VoiceOver (iOS): select the slider, swipe up/down to pick Accept or Decline, then double-tap.
  • TalkBack (Android): select the slider, open the TalkBack menu โ†’ Actions, then choose Accept or Decline.

No extra code is needed โ€” the actions call your onAccept / onDecline.


โฌ†๏ธ Upgrading from 2.x

3.0.0 moves the package to Flutter's standalone material_ui library. The widget API is unchanged โ€” just make sure your project is on Flutter 3.47 or newer, then bump the version:

dependencies:
  call_slider_button: ^3.0.0

To migrate your own app to material_ui as well, run:

dart fix --apply --code=migrate_design_widgets

๐Ÿ“‚ Example

A complete Android & iOS demo app lives in the example folder:

cd example
flutter run

๐Ÿž Issues & contributions

Found a bug or have an idea? Please open an issue on GitHub โ€” pull requests are welcome.

๐Ÿ“„ License

MIT โ€” see the LICENSE file.

๐Ÿ”— Author

Built with โค๏ธ by Omer Jahangir

Libraries

call_slider_button
A customizable Flutter widget that mimics an incoming call slider button.