Skip to content

sinanhaci/native_widgets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter Native Widgets

Adaptive Cupertino and Material widgets.



STARTED

final NativeWidgets nativeWidgets = NativeWidgets(context);


Adaptive Refresh Indicator



nativeWidgets.nativeRefreshIndicator(
  constructors: RefreshIndicatorModel(
    onRefresh: ()async{
      await Future.delayed(const Duration(seconds: 2));
    },
    children: [
        //Scroll Items
    ],
  ),
)
-----or-----
nativeWidgets.nativeRefreshIndicator(
  constructors: RefreshIndicatorModel(
    onRefresh: ()async{
      await Future.delayed(const Duration(seconds: 2));
    },
    itemBuilder: (context,index){
      return ListTile(title: Text('$index'),);
    }
  ),
)


Adaptive Ok Dialog



_button(
  title: 'Ok Dialog',
  onTap: () {
    nativeWidgets.nativeDialog(
      constructors: DialogModel(
        dialogType: DialogType.ok,
        title: 'Title',
        content: 'Content',
        okButtonProperties: ButtonProperties(
          buttonText: 'OK',
          onPress: () => Navigator.pop(context),
          isDefaultAction: true
        ),
      ),
    );
  },
),


Adaptive Ok Cancel Dialog



_button(
  title: 'Ok Cancel Dialog',
  onTap: () {
    nativeWidgets.nativeDialog(
      constructors: DialogModel(
        dialogType: DialogType.okCancel,
        title: 'Title',
        content: 'Content',
        okButtonProperties: ButtonProperties(
          buttonText: 'Cancel',
          onPress: () => Navigator.pop(context),
          isDestructiveAction: true
        ),
        cancelButtonProperties: ButtonProperties(
          buttonText: 'Ok',
          onPress: () => Navigator.pop(context),
          isDefaultAction: true
        ),
      ),
    );
  },
),


Adaptive Ok Input Dialog



_button(
  title: 'Ok Input Dialog',
  onTap: () {
    nativeWidgets.nativeDialog(
      constructors: DialogModel(
        dialogType: DialogType.inputOk,
        title: 'Title',
        content: 'Content',
        okButtonProperties: ButtonProperties(
          buttonText: 'OK',
          onPress: () => Navigator.pop(context),
          isDefaultAction: true
        ),
        cancelButtonProperties: ButtonProperties(
          buttonText: 'Ok',
          onPress: () => Navigator.pop(context),
          isDefaultAction: true
        ),
        inputProperties: DialogInputProperties(
          onChanged: (value){}
          //controller,focusNode...
        )
      ),
    );
  },
),


Adaptive Ok Cancel Input Dialog



_button(
  title: 'Ok Input Dialog',
  onTap: () {
    nativeWidgets.nativeDialog(
      constructors: DialogModel(
        dialogType: DialogType.inputOk,
        title: 'Title',
        content: 'Content',
        okButtonProperties: ButtonProperties(
          buttonText: 'OK',
          onPress: () => Navigator.pop(context),
          isDefaultAction: true
        ),
        inputProperties: DialogInputProperties(
          onChanged: (value){}
          //controller,focusNode...
        )
      ),
    );
  },
),


Adaptive Date Time Picker



_button(
   title: 'Date Time Picker',
   onTap: () {
     nativeWidgets.nativeDateTimePicker(
       constructors: DateTimePickerModel(
         pickerType: DateTimePickerType.dateAndTime,
         //DateTimePickerType.dateAndTime,DateTimePickerType.date,DateTimePickerType.time
         time: DateTime.now()
       ),
     );
   },
 ),


Adaptive Action Sheet



_button(
   title: 'Action Sheet Title and Content',
   onTap: () {
     nativeWidgets.nativeActionSheet(
       constructors: ActionSheetModel(
         title: 'Title',
         content: 'Content',
         actions: [
           ButtonProperties(
             buttonText: 'First Action',
             onPress: (){},
             icon: Icons.add
           ),
           ButtonProperties(
             buttonText: 'Second Action',
             onPress: (){},
             icon: Icons.add
           ),
         ]
       ),
     );
   },
 ),


Adaptive Switch and Progress Indicator



nativeWidgets.nativeSwitch(
  constructors: SwitchModel(
    activeColor: Colors.blue,
    value: true,
    onChanged: (value){}
  )
),
nativeWidgets.nativeIndicator(
  constructors: IndicatorModel()
),


About

Flutter adaptive material and cupertino widgets.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages