import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'ClipOval',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePAGE(),
debugShowCheckedModeBanner: false,
);
}
}
class MyHomePAGE extends StatefulWidget {
const MyHomePAGE({Key? key}) : super(key: key);
@override
_MyHomePAGEState createState() => _MyHomePAGEState();
}
class _MyHomePAGEState extends State<MyHomePAGE> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('GeeksforGeeks'),
backgroundColor: Colors.green,
),
body: Center(
child: RichText(
overflow: TextOverflow.clip,
textAlign: TextAlign.end,
textDirection: TextDirection.rtl,
softWrap: true,
maxLines: 1,
textScaleFactor: 1,
text: TextSpan(
text: 'Hello ',
style: DefaultTextStyle.of(context).style,
children: const <TextSpan>[
TextSpan(
text: 'Geeks', style: TextStyle(fontWeight: FontWeight.bold)),
],
),
)),
backgroundColor: Colors.lightBlue[50],
);
}
}
class MyClip extends CustomClipper<Rect> {
@override
Rect getClip(Size size) {
return const Rect.fromLTWH(0, 0, 100, 100);
}
@override
bool shouldReclip(oldClipper) {
return false;
}
}