zatca_flutter 0.1.2 copy "zatca_flutter: ^0.1.2" to clipboard
zatca_flutter: ^0.1.2 copied to clipboard

A Flutter plugin that fully and perfectly implements with Zatca/Fatoora E-Invoicing Phase 1 & 2 requirements.

example/lib/main.dart

import 'package:einvoice/invoice_view.dart';
import 'package:flutter/material.dart';
import 'package:einvoice/setup.dart';
import 'package:zatca_flutter/request.dart';
import 'package:zatca_flutter/zatca_flutter.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  ZatcaFlutter.init(mode: Mode.sandbox);
  runApp(const App());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(useMaterial3: false),
      home: const HomePage(),
      debugShowCheckedModeBanner: false, // Removes the debug banner.
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Padding(
        padding: const EdgeInsets.all(30),
        child: Row(
          children: [
            ElevatedButton.icon(
              icon: const Icon(Icons.receipt),
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => const InvoiceView(),
                  ),
                );
              },
              label: const Text('Invoice'),
            ),
            const SizedBox(
              width: 10,
            ),
            // ElevatedButton.icon(
            //   icon: const Icon(Icons.receipt),
            //   onPressed: () {
            //     // Add functionality for the Invoice button here.
            //   },
            //   label: const Text('Invoice'),
            // ),
            // const SizedBox(
            //   width: 10,
            // ),
            ElevatedButton.icon(
              icon: const Icon(Icons.settings),
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => const Setup(),
                  ),
                );
              },
              label: const Text('Setup'),
            ),
          ],
        ),
      ),
    );
  }
}
2
likes
160
points
75
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin that fully and perfectly implements with Zatca/Fatoora E-Invoicing Phase 1 & 2 requirements.

Repository (GitHub)

Topics

#zatca #fatoora #phase2 #einvoice #xml

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

asn1lib, flutter, http, path_provider, qr_flutter, xml

More

Packages that depend on zatca_flutter