water_fx 1.0.4 water_fx: ^1.0.4 copied to clipboard
A library for adding water effects to Flutter apps. Wrap any widget with a WaterFXContainer, and it will seem to be under water when touched.
A library for adding water effects to Flutter apps.
Wrap any widget with a WaterFXContainer, and it will appear as if it is under water when touched. You will see water ripples moving across the surface of your widget. Touches can be applied by the pointer, the finger, or by code. E.g. you can use code to simulate rain drops falling on your widget.
Getting started #
To use this plugin, add water_fx
as a dependency in your pubspec.yaml file.
Examples #
Example with an image:
import 'package:water_fx/water_fx.dart';
// ...
@override
Widget build(BuildContext context) => MaterialApp(
home: Center(
child: WaterFXContainer.simpleImageInstanceForPointer(
image: _sourceImage, // _sourceImage is a dart:ui.Image.
),
),
);
Example with a widget.
import 'package:water_fx/water_fx.dart';
// ...
@override
Widget build(BuildContext context) => MaterialApp(
home: Center(
child: WaterFXContainer.simpleWidgetInstanceForPointer(
child: _child, // _child is a Widget.
),
),
);
Additional information #
You can find out more about WaterFX here: https://www.jimmorrison101.com/water_fx
The original idea for WaterFX is based on an algorithm by Neil Wallis: https://www.neilwallis.com/index.php