balanced_text 0.0.3
balanced_text: ^0.0.3 copied to clipboard
A Flutter widget that simply balances the lines of two-line text
import 'package:balanced_text/balanced_text.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const App());
}
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData.dark(),
home: Scaffold(
body: Padding(
padding: const EdgeInsets.all(32),
child: Center(
child: SizedBox(
width: 256,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: const [
Text(
'Regular Text',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 16),
Text('The quick brown fox jumps over the lazy dog'),
Divider(height: 32),
Text(
'Balanced Text',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 16),
BalancedText('The quick brown fox jumps over the lazy dog'),
],
),
),
),
),
),
);
}
}