Add FilamentModel with all properties and refactor notes as optional
This commit is contained in:
38
lib/widgets/outlined_text.dart
Normal file
38
lib/widgets/outlined_text.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Rendert Text mit einer farbigen Kontur (Stroke) via Stack.
|
||||
class OutlinedText extends StatelessWidget {
|
||||
final String text;
|
||||
final TextStyle style;
|
||||
final Color fillColor;
|
||||
final Color strokeColor;
|
||||
final double strokeWidth;
|
||||
|
||||
const OutlinedText(
|
||||
this.text, {
|
||||
super.key,
|
||||
required this.style,
|
||||
required this.fillColor,
|
||||
this.strokeColor = Colors.black,
|
||||
this.strokeWidth = 2.0,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final strokeStyle = style.copyWith(
|
||||
foreground: Paint()
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeWidth = strokeWidth
|
||||
..strokeJoin = StrokeJoin.round
|
||||
..color = strokeColor,
|
||||
);
|
||||
final fillStyle = style.copyWith(color: fillColor);
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
Text(text, style: strokeStyle),
|
||||
Text(text, style: fillStyle),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user