default_text 0.0.5 copy "default_text: ^0.0.5" to clipboard
default_text: ^0.0.5 copied to clipboard

helping you to simplify text in your project and categorizing between size, and now include auto resize with your screen width

example/lib/main.dart

import 'package:default_text/default_text.dart';
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: 'DefText',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'DefText'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
        ),
        body: ListView(
          children: [
            ListTile(title: DefText("Lorem ipsum dolor sit amet").extraSmall),
            ListTile(title: DefText("Lorem ipsum dolor sit amet").small),
            ListTile(title: DefText("Lorem ipsum dolor sit amet").semiSmall),
            ListTile(title: DefText("Lorem ipsum dolor sit amet").normal),
            ListTile(title: DefText("Lorem ipsum dolor sit amet").semilarge),
            ListTile(title: DefText("Lorem ipsum dolor sit amet").large),
            ListTile(title: DefText("Lorem ipsum dolor sit amet").extraLarge),
            const Divider(),
            Container(
              margin: const EdgeInsets.symmetric(horizontal: 20),
              child: Row(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Expanded(
                      child: DefText(
                              "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur",
                              maxLine: 2)
                          .normal),
                  const SizedBox(width: 10),
                  Expanded(
                      child: DefText(
                              "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur",
                              maxLine: 4)
                          .normal),
                ],
              ),
            )
          ],
        ));
  }
}
4
likes
130
pub points
17%
popularity

Publisher

verified publisherozip.co.id

helping you to simplify text in your project and categorizing between size, and now include auto resize with your screen width

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on default_text