veplex_utils 0.0.3 copy "veplex_utils: ^0.0.3" to clipboard
veplex_utils: ^0.0.3 copied to clipboard

A library for Dart and Flutter development.

example/lib/main.dart

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

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

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

  static const String cpf = '12345678901';
  static const String cnpj = '12345678901234';
  static const String nrTelefone = '54999999999';
  static const String stringDouble = '10.0';
  static const String stringInt = '10';

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Scaffold(
        appBar: AppBar(
          backgroundColor: Theme.of(context).colorScheme.inversePrimary,
          title: Text('Example APP'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              Text('CPF Formatado: ${MyDocument.format(cpf)}'),
              Text('CNPJ Formatado: ${MyDocument.format(cnpj)}'),
              Text('Número Telef. para Link: ${MyPhone.formatForLink(nrTelefone)}'),
              Text('String convertida para Double ${MyInt.parse(stringDouble)}'),
              Text('String convertida para Inteiro ${MyInt.parse(stringInt)}'),
            ],
          ),
        ),
      ),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  static const String cpf = '12345678901';

  @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,
          children: <Widget>[
            Text(
              MyDocument.format(cpf),
            ),
          ],
        ),
      ),
    );
  }
}
2
likes
130
points
--
downloads

Publisher

unverified uploader

Weekly Downloads

A library for Dart and Flutter development.

Repository

Documentation

API reference

License

MIT (license)

Dependencies

decimal, flutter

More

Packages that depend on veplex_utils