The Flutter package for changing digit to the Persian word and add separate to an integer
demo:
Add dependency
dependencies:digit_to_persian_word:^2.0.0
Usage
import'package:flutter/material.dart';
import'package:digit_to_persian_word/digit_to_persian_word.dart';
voidmain() => runApp(MyApp());
classMyAppextendsStatelessWidget{
// This widget is the root of your application.@overrideWidgetbuild(BuildContext context) {
returnMaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
debugShowCheckedModeBanner: false,
);
}
}
classMyHomePageextendsStatelessWidget{
@overrideWidgetbuild(BuildContext context) {
returnScaffold(
appBar: AppBar(
title: Text("Flutter Digit To Persian Word'"),
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
//تبدیل رقم به حروف بدون تبدیل اعدادText(DigitToWord.toWord("123456",StrType.NumWord,isMoney: true)),// 123 هزارو 456 تومان//)تبدیل عدد به حروف همراه با تبدیل اعدادText(DigitToWord.toWord("123456",StrType.StrWord),),//صد و بیست و سه هزارو چهارصدو پنجاه و شش//تبدیل رقم به حروف Text(DigitToWord.toWord("123.456",StrType.NumWord,isMoney: true,separator: ".")),// 123 هزارو 456 تومان//جدا سازی سه رقمی اعداد به صورت معمولText(DigitFormat.convert("123456",separator: ","),),//123,456//به جدا سازی سه رقمی اعداد به صورت (TextInputFormatter)TextFormField(inputFormatters: [DigitInputFormat()]),
],
),
);
}
}