Flutter Adaptive Action Sheet Versions Save

A action bottom sheet that adapts to the platform (Android/iOS).

v2.0.3

3 months ago

In this version:

  • Add useRootNavigator parameter (optional) to set useRootNavigator of showCupertinoModalPopup (Default true) and useRootNavigator of showModalBottomSheet (Default false)
    showAdaptiveActionSheet(
      context: context,
      title: const Text('Title'),
      useRootNavigator: true,
      actions: <BottomSheetAction>[
        BottomSheetAction(title: const Text('Item 1'), onPressed: (context) {}),
        BottomSheetAction(title: const Text('Item 2'), onPressed: (context) {}),
        BottomSheetAction(title: const Text('Item 3'), onPressed: (context) {}),
      ],
      cancelAction: CancelAction(title: const Text('Cancel')),// onPressed parameter is optional by default will dismiss the ActionSheet
    );
    
  • Wrap the content of showMaterialBottomSheet with a SafeArea

2.0.2

1 year ago

In this version:

  • Add context to 'onPressed' for BottomSheetAction.
    showAdaptiveActionSheet(
      context: context,
      title: const Text('Title'),
      actions: <BottomSheetAction>[
      BottomSheetAction(title: const Text('Item 1'), onPressed: (context) {}),
      BottomSheetAction(title: const Text('Item 2'), onPressed: (context) {}),
      BottomSheetAction(title: const Text('Item 3'), onPressed: (context) {}),
      ],
      cancelAction: CancelAction(title: const Text('Cancel')),// onPressed parameter is optional by default will dismiss the ActionSheet
    );
    

v2.0.0

3 years ago

In this version:

  • Migrated to null safety

v1.1.0

3 years ago

In this version:

Breaking change:

  • Change title type from String to Widget
Version 1.1.0 or later Version 1.0.12 or earlier
  BottomSheetAction(
    title: const Text(
      'Title',
      style: TextStyle(
        fontSize: 18,
        fontWeight: FontWeight.w500,
      ),
    ),
    onPressed: () {},
    leading: const Icon(Icons.add, size: 25),
  ),
 BottomSheetAction(
   title: 'Title',
   textStyle: TextStyle(
     fontSize: 18,
     fontWeight: FontWeight.w500,
   ),
   onPressed: () {},
   leading: const Icon(Icons.add, size: 25),
 ),

v1.0.12

3 years ago

In this version:

  • Fix issues when trailing or leading widget require a Material widget ancestor.

v1.0.11

3 years ago

In this version:

  • Add options for leading and trailing widget
  • Add options for text align
    showAdaptiveActionSheet(
      context: context,
      actions: <BottomSheetAction>[
        BottomSheetAction(
          title: 'Add',
          onPressed: () {},
          leading: const Icon(
            Icons.add,
            size: 25,
          ),
          trailing: const Icon(
            Icons.delete,
            size: 25,
            color: Colors.red,
          ),
          textAlign: TextAlign.start,
        ),        
      ],
      cancelAction: CancelAction(title: 'Cancel'),
    );
    

v1.0.10

3 years ago

In this version:

  • Support web platform

v1.0.9

3 years ago

In this version:

  • [Android] Fix default material background color.
  • [Android] Fix the padding on the top if title not set.
  • [iOS] Use showCupertinoModalPopup instead of showModalBottomSheet

v1.0.8

3 years ago

In this version:

  • Update documentation
  • Format project

v1.0.7

3 years ago

In this version:

  • Add optional textStyle parameter for each action.
    showAdaptiveActionSheet(
       context: context,
       actions: <BottomSheetAction>[
          BottomSheetAction(
             title: 'Item 1', 
             onPressed: () {}, 
             textStyle: const TextStyle(
                fontSize: 25,
                color: Colors.blueAccent,
             ),
          ),
          BottomSheetAction(title: 'Item 2', onPressed: () {}),
       ],
       cancelAction: CancelAction(// onPressed parameter is optional by default will dismiss the ActionSheet
          title: 'Cancel', 
          textStyle: const TextStyle(
             fontSize: 25,
             color: Colors.blueAccent,
          ),
       ),
    );