balanced_text 0.0.3 copy "balanced_text: ^0.0.3" to clipboard
balanced_text: ^0.0.3 copied to clipboard

A Flutter widget that simply balances the lines of two-line text

example/lib/main.dart

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'),
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}
5
likes
160
points
44
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter widget that simply balances the lines of two-line text

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on balanced_text