floating_bubbles 2.1.0 floating_bubbles: ^2.1.0 copied to clipboard
A Flutter Package for adding Floating bubbles on the Foreground to any Flutter widget.
import 'package:example/fps.dart';
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,
showPerformanceOverlay: true,
home: Scaffold(
body: HomePage(),
),
);
}
}
// Simple example.
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
eachFrame().take(10000).transform(const ComputeFps()).listen((fps) => print('fps: $fps'));
return Stack(
children: [
Positioned.fill(
child: Container(
color: Colors.blue,
),
),
Positioned.fill(
child: FloatingBubbles.alwaysRepeating(
noOfBubbles: 10,
colorOfBubbles: Colors.white,
sizeFactor: 0.2,
opacity: 70,
paintingStyle: PaintingStyle.fill,
shape: BubbleShape.circle, //This is the default
),
),
],
);
}
}