flutter fragment transaction
a simple fragment transaction effect in flutter.
getting started
add this to your package’s pubspec.yaml file:
dependencies:
flutter_fragments: ^0.02
example
default effect
class fragmentsdemo extends statefulwidget {
static final string title = "fragments";
@override
_fragmentsdemostate createstate() => _fragmentsdemostate();
}
class _fragmentsdemostate extends state<fragmentsdemo> {
fragmentscontroller controller = fragmentscontroller();
offset startingoffset = offset.zero;
@override
widget build(buildcontext context) {
return scaffold(
body: center(
child: gesturedetector(
ontapup: (tapupdetails detail) {
setstate(() {
startingoffset = detail.localposition;
});
controller.start();
},
child: container(
width: 300,
height: 300,
child: fragments(
fragmentscontroller: controller,
startingoffset: startingoffset,
delegate: defaultfragmentsdraw(disabletransition: true),
child: const fragmentsexample(),
),
),
),
),
);
}
}
transition effects.
fragments(
fragmentscontroller: controller,
startingoffset: startingoffset,
duration: duration(milliseconds: 3000),
child: const fragmentsexample(),
),
number of custom fragment
fragments(
fragmentscontroller: controller,
startingoffset: startingoffset,
duration: duration(milliseconds: 3000),
delegate: defaultfragmentsdraw(rowlength: 25, columnlength: 25),
child: const fragmentsexample(),
),
Comments are closed.