cutout_text_effect 0.0.2 cutout_text_effect: ^0.0.2 copied to clipboard
Make cutout effect of your text in an easy way.
import 'package:cutout_text_effect/cutout_text_effect.dart';
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: darkBlue),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Container(
alignment: Alignment.center,
decoration: const BoxDecoration(
image: DecorationImage(
image: NetworkImage("https://picsum.photos/1080/1080"),
fit: BoxFit.cover,
),
),
child: const MyWidget(),
),
),
);
}
}
class MyWidget extends StatelessWidget {
const MyWidget({super.key});
@override
Widget build(BuildContext context) {
return CustomPaint(
painter: CutOutText(
text: 'Hello World',
textDirection: TextDirection.rtl,
boxRadius: 10,
boxBackgroundColor: Colors.white,
textStyle: const TextStyle(
fontSize: 200.0,
fontWeight: FontWeight.bold,
),
),
);
}
}