auto_size_styled_text 1.1.0 copy "auto_size_styled_text: ^1.1.0" to clipboard
auto_size_styled_text: ^1.1.0 copied to clipboard

Text widget with formatted text using tags. Makes it easier to use formatted text in multilingual applications.Automatically resizes text to fit perfectly within its bounds.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:auto_size_styled_text/auto_size_styled_text.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'AutoSizeStyledText Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const Home(),
    );
  }
}

class Home extends StatefulWidget {
  const Home({Key? key}) : super(key: key);

  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("AutoSizeStyledText Example"),
      ),
      body: Center(
        child: Container(
          height: 200,
          width: 200,
          padding: const EdgeInsets.all(25),
          decoration: BoxDecoration(
            color: Colors.green,
            borderRadius: BorderRadius.circular(20),
          ),
          child: AutoSizeStyledText(
            text:
                "Lorem <b>Ipsum</b> is simply dummy text of the printing and typesetting industry. <b>Lorem</b> Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
            style: const TextStyle(
              fontWeight: FontWeight.bold,
              fontSize: 16,
            ),
            minFontSize: 8,
            tags: {
              'b': AutoSizeStyledTextTag(
                style: const TextStyle(
                  color: Colors.red,
                  fontWeight: FontWeight.w900,
                  fontSize: 16,
                ),
              ),
            },
          ),
        ),
      ),
    );
  }
}
14
likes
90
pub points
60%
popularity

Publisher

unverified uploader

Text widget with formatted text using tags. Makes it easier to use formatted text in multilingual applications.Automatically resizes text to fit perfectly within its bounds.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause, MIT (LICENSE)

Dependencies

auto_size_text_pk, flutter, xmlstream

More

Packages that depend on auto_size_styled_text