optimal_wrap_text 1.0.5
optimal_wrap_text: ^1.0.5 copied to clipboard
A Flutter Text replacement that wraps short multi-line text over similarly sized lines for better visual balance.
import 'package:flutter/material.dart';
import 'package:optimal_wrap_text/optimal_wrap_text.dart';
void main() {
runApp(const MyApp());
}
final class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('OptimalWrapText Example')),
body: Center(
child: OptimalWrapText(
'My slightly longer text that will span 2 or 3 lines',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18),
),
),
),
);
}
}
copied to clipboard