money_to_text 1.0.4 copy "money_to_text: ^1.0.4" to clipboard
money_to_text: ^1.0.4 copied to clipboard

It converts any double variable you send with this dart package to text as money

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:money_to_text/money_to_text.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Money Text Demo',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: const HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  String moneyText = "";
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("Money to Text")),
      body: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 40),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            TextField(
              onChanged: (value) {
                Future.microtask(() {
                  setState(() {
                    moneyText = moneyToText(value, unit: MoneyUnit.turkishLira
                    , lang: "tr", alwaysShowAfterComma: true);
                    debugPrint(moneyText);
                  });
                });
              },
            ),
            const SizedBox(height: 20),
            Text(moneyText),
          ],
        ),
      ),
    );
  }
}
6
likes
160
points
53
downloads

Documentation

Documentation
API reference

Publisher

verified publisherahmetveysel.com

Weekly Downloads

It converts any double variable you send with this dart package to text as money

Homepage
Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

More

Packages that depend on money_to_text