kat_common 0.1.3 copy "kat_common: ^0.1.3" to clipboard
kat_common: ^0.1.3 copied to clipboard

PlatformAndroid

Plugin common for kat

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:kat_common/utils/extension_methods.dart';
import 'package:kat_common/utils/utils.dart';

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

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

  @override
  Widget build(BuildContext context) {
    // A couple of kat_common utils, just to show the package wired up
    // end-to-end from the example app.
    var amount = 1234567.0;
    var formattedAmount = KatUtils.valDecimal(amount, digits: 0);
    var amountInWords = amount.toInt().toVietnameseWords();

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('kat_common utils example')),
        body: Center(
          child: Padding(
            padding: const EdgeInsets.all(16),
            child: Column(
              mainAxisSize: MainAxisSize.min,
              children: [
                Text('KatUtils.valDecimal: $formattedAmount'),
                const SizedBox(height: 8),
                Text('IntegerExtensions.toVietnameseWords: $amountInWords'),
              ],
            ),
          ),
        ),
      ),
    );
  }
}