createFloating static method
Floating
createFloating({
- required String key,
- required Widget child,
- double? top,
- double? right,
- double? left,
- double? bottom,
- FloatingSlideType? slideType,
- FloatingAnimationType? animationType,
创建一个浮窗
Implementation
static Floating createFloating({
required String key,
required Widget child,
double? top,
double? right,
double? left,
double? bottom,
FloatingSlideType? slideType,
FloatingAnimationType? animationType,
}) {
final containsKeys = _floatingKeys.contains(key);
if (containsKeys) {
return _floatingCache[key]!;
} else {
_floatingKeys.add(key);
final floating = Floating(
FloatingComponent(child: child),
isSnapToEdge: false,
slideType: slideType ?? FloatingSlideType.onRightAndBottom,
openAnimationType: animationType ?? FloatingAnimationType.scale,
isShowLog: false,
top: top,
right: right,
left: left,
bottom: bottom,
);
_floatingCache[key] = floating;
return floating;
}
}