Skip to content

Latest commit

 

History

History
61 lines (49 loc) · 1.25 KB

example.md

File metadata and controls

61 lines (49 loc) · 1.25 KB

DragHelper

Basic Use:

TKMDragHelper(
  animationController: animationController,
  maxSlide: 255,
  maxDragStartEdge: MediaQuery.of(context).size.width - 255,
  minDragStartEdge: 60,
  dissableDrag: true,
  orientation: DragOrientation.RigthtToLeft
);

After define the TKMDragHelper

GestureDetector(
 onHorizontalDragStart: dragHelper.onDragStart,
 onHorizontalDragUpdate: dragHelper.onDragUpdate,
 onHorizontalDragEnd: dragHelper.onDragEnd,
 child: ...,
);

TKMController

Basic Use:

Wrap the mixin functions in the CustomController functions

class CustomController extends TKMController with ForwardFunction, ReverseFunction {
  
  void close() => reverseFunction();

  void open() {
    print('Show me a custom open print');  
    forwardFunction();
  }
}

After define the CustomController Initialize animationController from Mixin and attached the state

class _CustomState extends State<CustomWidget>
   with SingleTickerProviderStateMixin, AnimationControllerMixin {
 @override
   void initState() {
     super.initState();

     animationController = AnimationController(
       vsync: this,
       duration: settings.duration,
     );

     widget.controller?.addState = this;
   }
}