formatted_text 1.0.0+2 copy "formatted_text: ^1.0.0+2" to clipboard
formatted_text: ^1.0.0+2 copied to clipboard

outdated

A simple text formatting package. Use to format text in TextField and Text widgets

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Formatted Text Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const HomePage(),
    );
  }
}

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

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  final textEditingController = FormattedTextEditingController();

  String _value = '';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Formatted Text Demo'),
      ),
      body: Column(
        children: <Widget>[
          Expanded(
            child: Center(
              child: FormattedText(
                _value,
              ),
            ),
          ),
          Expanded(
            child: Center(
              child: TextField(
                controller: textEditingController,
                onChanged: (value) {
                  setState(() {
                    _value = value;
                  });
                },
              ),
            ),
          ),
        ],
      ),
    );
  }
}
9
likes
0
pub points
81%
popularity

Publisher

verified publishernirmalcode.com

A simple text formatting package. Use to format text in TextField and Text widgets

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on formatted_text