diff --git a/example/pubspec.lock b/example/pubspec.lock index ebf6baf..214336f 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,26 +7,33 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.5" + version: "1.2.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.5" + version: "1.16.0" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.6" + version: "1.7.0" pip_view: dependency: "direct main" description: @@ -39,19 +46,12 @@ packages: description: flutter source: sdk version: "0.0.99" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0-nullsafety.5" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.5" + version: "2.1.2" sdks: - dart: ">=2.12.0-0 <3.0.0" + dart: ">=2.14.0 <3.0.0" diff --git a/lib/src/pip_view.dart b/lib/src/pip_view.dart index 0d86222..9d34dfa 100644 --- a/lib/src/pip_view.dart +++ b/lib/src/pip_view.dart @@ -230,36 +230,50 @@ class PIPViewState extends State with TickerProviderStateMixin { return Positioned( left: floatingOffset.dx, top: floatingOffset.dy, - child: GestureDetector( - onPanStart: isFloating ? _onPanStart : null, - onPanUpdate: isFloating ? _onPanUpdate : null, - onPanCancel: isFloating ? _onPanCancel : null, - onPanEnd: isFloating ? _onPanEnd : null, - onTap: isFloating ? stopFloating : null, - child: Material( - elevation: 10, - borderRadius: BorderRadius.circular(borderRadius), - child: Container( - clipBehavior: Clip.antiAlias, - decoration: BoxDecoration( - color: Colors.transparent, + child: Stack( + children: [ + GestureDetector( + onPanStart: isFloating ? _onPanStart : null, + onPanUpdate: isFloating ? _onPanUpdate : null, + onPanCancel: isFloating ? _onPanCancel : null, + onPanEnd: isFloating ? _onPanEnd : null, + onTap: isFloating ? stopFloating : null, + child: Material( + elevation: 10, borderRadius: BorderRadius.circular(borderRadius), - ), - width: width, - height: height, - child: Transform.scale( - scale: scale, - child: OverflowBox( - maxHeight: fullWidgetSize.height, - maxWidth: fullWidgetSize.width, - child: IgnorePointer( - ignoring: isFloating, - child: child, + child: Container( + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.circular(borderRadius), + ), + width: width, + height: height, + child: Transform.scale( + scale: scale, + child: OverflowBox( + maxHeight: fullWidgetSize.height, + maxWidth: fullWidgetSize.width, + child: IgnorePointer( + ignoring: isFloating, + child: child, + ), + ), ), ), ), ), - ), + Positioned( + top: 0, + right: 0, + child: IconButton( + onPressed: (){ + Navigator.of(context).pop(); + }, + icon: Icon(Icons.close) + ), + ) + ], ), ); }, diff --git a/pubspec.lock b/pubspec.lock index 49eea03..db1eaf9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,44 +7,44 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.5" + version: "1.2.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.5" + version: "1.16.0" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.6" + version: "1.7.0" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0-nullsafety.5" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.5" + version: "2.1.2" sdks: - dart: ">=2.12.0-0 <3.0.0" + dart: ">=2.14.0 <3.0.0"