floating_bubbles 2.0.0-nullsafety.0 floating_bubbles: ^2.0.0-nullsafety.0 copied to clipboard
A Flutter Package for adding Floating bubbles on the Foreground to any Flutter widget.
import 'package:floating_bubbles/floating_bubbles.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: HomePage(),
),
);
}
}
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Stack(
children: [
Positioned.fill(
child: Container(
color: Colors.blue,
),
),
Positioned.fill(
child: FloatingBubbles(
noOfBubbles: 40,
colorOfBubbles: Colors.white.withAlpha(70),
sizeFactor: 0.2,
duration: 360, //if this value is zero then the animation keeps playing forever.
),
),
],
);
}
}