Skip to content
Snippets Groups Projects
Commit 02dfa588 authored by vjrj's avatar vjrj
Browse files

Create CustomBanner widget for displaying banners

parent 0fa20791
No related branches found
No related tags found
No related merge requests found
import 'package:flutter/material.dart';
class CustomBanner extends StatelessWidget {
const CustomBanner({
super.key,
required this.child,
required this.message,
this.color = Colors.red,
this.location = BannerLocation.topEnd,
});
final Widget child;
final String message;
final Color color;
final BannerLocation location;
@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
child,
CustomPaint(
painter: BannerPainter(
textDirection: Directionality.of(context),
layoutDirection: Directionality.of(context),
location: BannerLocation.bottomEnd,
color: color,
textStyle: const TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0,
),
message: message,
),
child: Container(),
),
],
);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment