I do need to consume a package called SwipeTo
(https://pub.dev/packages/swipe_to) in my app and for that have created a Custom Widget by adding this dependancy in it and want to accept a Widget as child parameter to it with other parameters.
Below is my Custom Widget.
// Automatic FlutterFlow imports
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/widgets/index.dart'; // Imports other custom widgets
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom widget code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
import 'package:swipe_to/swipe_to.dart';
import 'dart:developer';
class SwipableWidget extends StatelessWidget {
const SwipableWidget({
super.key,
this.width,
this.height,
required this.child,
});
final double? width;
final double? height;
final Widget child;
@override
Widget build(BuildContext context) {
return SwipeTo(
key: UniqueKey(),
iconOnLeftSwipe: Icons.arrow_forward,
iconOnRightSwipe: Icons.arrow_back,
onRightSwipe: (details) {
log("Swiping on Right");
},
swipeSensitivity: 20,
child: Container(
width: width,
height: height,
child: child,
),
);
}
}
When added on page there is nothing like Add child to this...
like we have for Container
or similar widgets on FlutterFlow. If anyone has done similar thing before, would like to know how we can and give some direction so can move in that wat. Thank you in advance.