tools_tkmonkey 0.0.2 copy "tools_tkmonkey: ^0.0.2" to clipboard
tools_tkmonkey: ^0.0.2 copied to clipboard

A simple lib with tools, we use this tools in our libraries.

example/example.md

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;
   }
}
1
likes
160
points
38
downloads

Publisher

unverified uploader

Weekly Downloads

A simple lib with tools, we use this tools in our libraries.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on tools_tkmonkey