仿旧版微信浏览页面,侧滑添加至浮窗功能。
Add flutter_floating_window
as a dependency in your pubspec.yaml file.
- Import Flutter Floating Window:
import 'package:flutter_floating_window/flutter_floating_window.dart';
- Init Flutter Floating Window.
var routeTable = {
"/floating": (context) => WithFloatingPage(),
};
initFloatingWindow(
routeTable,
);
- Open the page.
openFloatingWindowPage(
context,
'/floating',
icon:
'https://cdn.jsdelivr.net/gh/flutterchina/website@1.0/images/flutter-mark-square-100.png',
);
The icon shoud be a network url or an instance of ImageProvider.