How to rotate text in flutter?

This Article is posted by seven.srikanth at 10/2/2021 7:52:19 AM



Here is an example of how to rotate text in flutter. We are going to use RotatedBox widget to achieve this. 
You can experiment more by updating quarterTurns value. It will just rotate more. 
Here is the complete code.

import 'package:flutter/material.dart';
main(List<String> args) {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@ override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(body: MyHomePage()),
);
}
}
class MyHomePage extends StatelessWidget {
@ override
Widget build(BuildContext context) {
return Center(
child: RotatedBox(
quarterTurns: 3,
child: Text(
'Hello World!',
style: TextStyle(fontSize: 50),
),
),
);
}
}
Thanks,
Srikanth

Tags: Rotate text; invert text;








0 Comments
Login to comment.
Recent Comments












© 2018 - Fluttercentral | Email to me - seven.srikanth@gmail.com