formatted_text_hooks 1.0.0 copy "formatted_text_hooks: ^1.0.0" to clipboard
formatted_text_hooks: ^1.0.0 copied to clipboard

outdated

A simple text formatting package. Use to format text in TextField and Text widgets. Hooks version of formattd_text.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:formatted_text_hooks/formatted_text_hooks.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 Hook Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const HomePage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    final _textEditingController = useFormattedTextController();
    final _textValue = useState('');

    return Scaffold(
      appBar: AppBar(
        title: const Text('Formatted Text Hook Demo'),
      ),
      body: Column(
        children: <Widget>[
          Expanded(
            child: Center(
              child: FormattedText(
                _textValue.value,
              ),
            ),
          ),
          Expanded(
            child: Center(
              child: TextField(
                controller: _textEditingController,
                onChanged: (value) {
                  _textValue.value = value;
                },
              ),
            ),
          ),
        ],
      ),
    );
  }
}
2
likes
0
pub points
35%
popularity

Publisher

verified publishernirmalcode.com

A simple text formatting package. Use to format text in TextField and Text widgets. Hooks version of formattd_text.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_hooks

More

Packages that depend on formatted_text_hooks