numeric_to_word 0.0.2
numeric_to_word: ^0.0.2 copied to clipboard
Numeric to word for English Lao Thai Chinese Vietnamese
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:numeric_to_word/numeric_to_word.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final _controller = TextEditingController(text: '987654321');
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Numeric to Word Example'),
),
body: Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
TextField(
controller: _controller,
onChanged: (value) {
setState(() {
// _controller.text = value;
});
},
keyboardType: TextInputType.number,
decoration:
const InputDecoration(label: Text('Input number'))),
SelectableText(
'English: ${NumericToWord.numericToEnglish(_controller.text)}'),
SelectableText(
'Lao: ${NumericToWord.numericToLao(_controller.text)}'),
SelectableText(
'Thai: ${NumericToWord.numericToThai(_controller.text)}'),
SelectableText(
'Vietnamese: ${NumericToWord.numericToVietnamese(_controller.text)}'),
SelectableText(
'Chinese: ${NumericToWord.numericToChinese(_controller.text)}'),
],
),
),
),
),
);
}
}