double_to_words 0.0.4+1 double_to_words: ^0.0.4+1 copied to clipboard
A Flutter package to convert numbers, including decimals, into readable words. Ideal for financial, educational, or accessibility-focused applications.
import 'package:double_to_words/double_to_words.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'double_to_words_example',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'double_to_words_example'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'102.00 in words :${DoubleToWords.convert(102.00)}',
),
Text(
'1234.56 in words :${DoubleToWords.convert(1234.56)}',
),
Text(
'0.99 in words :${DoubleToWords.convert(0.99)}',
),
Text(
'11 in words :${DoubleToWords.convert(11)}',
),
],
),
),
);
}
}