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

Implementation of an hyphenation algorithm, based on TeX definitions.

example/example.dart

import 'package:flutter/material.dart';
import 'package:hyphenatorx/hyphenatorx.dart';
import 'package:hyphenatorx/languages/languageconfig.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: HyphenatorExampleWidget(),
    );
  }
}

class HyphenatorExampleWidget extends StatelessWidget {
  final String text = "subdivision.";

  const HyphenatorExampleWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SingleChildScrollView(
        child: FutureBuilder<Hyphenator>(
            // access a Future-field instead, this is just an example
            future:
                Hyphenator.load(Language.language_en_us, hyphenateSymbol: '_'),
            builder:
                (BuildContext context, AsyncSnapshot<Hyphenator> snapshot) {
              if (snapshot.connectionState == ConnectionState.waiting) {
                return const Center(child: CircularProgressIndicator());
              }

              final Hyphenator hyphernator = snapshot.data!;

              return Text(hyphernator.hyphenate(text));
            }),
      ),
    );
  }
}
4
likes
0
pub points
83%
popularity

Publisher

verified publishernovelplotter.com

Implementation of an hyphenation algorithm, based on TeX definitions.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on hyphenatorx