Add adaptive() after Material widget

Inspired by the build-in adaptive widget like CircularProgressIndicator.adaptive(). All you need to get Cupertino widgets, add adaptive() after Material Widget.

    onPressed: showAdaptiveSnackbar,
    child: const Text('Adaptive TextButton'),





Find material widgets and add adaptive() after them.

The extensions are automatically convert to Cupertino widgets only if the platform is IOS or MacOS.

final TextButton textbutton = TextButton(your code).adaptive();
final FilledButton filledButton = FilledButton(your code).adaptive();

// if you want to use TextButton.icon add icon inside the adaptive
final textbutton = TextButton(your code).adaptive(icon:Icon(;

Design Concept

This package is composed with extentions of MaterialWidget. So these extensions are return material widget 'this'.

extension Adaptive on Material {
    dynamic adaptive({}){
        if (forceCupertino || Platform.isIOS || Platform.isMacOS) {
            return Cupertino;
        } else {
            return this; // Material;

Available Widgets

Widget Material Cupertino adaptive_extensions
TextButton TextButton CupertinoButton TextButton.adaptive
TextButton with icon TextButton.icon CupertinoButton TextButton.adaptive(icon:Icon)
FilledButton FilledButton CupertinoButton.filled FilledButton.adaptive
FilledButton with icon FilledButton.icon CupertinoButton.filled FilledButton.adaptive(icon:Icon)
ListTile ListTile CupertinoListTile ListTile.adaptive
SnackBar or Toast SnackBar Toast-like SnackBar SnackBar.adaptive

on progress: segmentbutton

Available ThemeData

Theme Material Cupertino adaptive_extensions
SnackBar or Toast SnackBarThemeData Toast-like SnackBarThemeData SnackBarThemeData.adaptive
AppBarTheme AppBarTheme Cupertino-like AppBarTheme AppBarTheme.adaptive

See also

If you are looking for Switch,Slider,CircularProgressIndicator,CheckBox, or Radio, visit the Official document Automatic platform adaptations.

If you are looking for some adaptive dialogs, I suggest you to use adaptive_dialog package written by

If you need more platform adaptive widgets, also see flutter_platform_widgets of