Skip to content

Latest commit

 

History

History
77 lines (63 loc) · 1.83 KB

README.md

File metadata and controls

77 lines (63 loc) · 1.83 KB

example

A new Flutter UI Example application.

Getting Started

  1. ActionSheet

normal action sheet

    _pressed() {
        CActionSheet.show(
            title: 'yes or no',
            subTitle: 'please choose',
            context: context,
            callback: () {
              Navigator.pop(context);
              print('you choosed Yes');
            });
          }

custom action sheet

        var actions = [
          SheetAction(
              title: 'Apple',
              pressCallback: () {
                {
                  Navigator.of(context).pop();
                  MToast.show(msg: 'apple');
                }
              }),
          SheetAction(
              title: 'Banana',
              pressCallback: () {
                Navigator.of(context).pop();
                MToast.show(msg: 'Banana');
              }),
          SheetAction(
              title: 'Orange',
              pressCallback: () {
                Navigator.of(context).pop();
                MToast.show(msg: 'Orange');
              }),
          SheetAction(
              title: 'Watermelon',
              pressCallback: () {
                Navigator.of(context).pop();
                MToast.show(msg: 'Watermelon');
              }),
        ];
      

      _onPressed(){
      	ActionSheet.showCustom(
            context: context,
            actions: actions,
            title: 'fruits',
            subTitle: 'please choosed one of them');
      }
  1. Toast
  // where you want to show toast,please do like this.
  void _pressed(String message, MPosition position) {
      MToast.show(
          msg: message, position: position, length: MToastLength.SHORT);
    }