danfe 2.0.2
danfe: ^2.0.2 copied to clipboard
Package para parsear e transformar um arquivo de danfe xml em objeto ou buffer para impressao
import 'package:flutter/material.dart';
import 'screens/danfe_screen.dart';
import 'screens/nfse_screen.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Danfe & NFSe Demo',
theme: ThemeData(primarySwatch: Colors.blue),
home: const HomeScreen(),
);
}
}
class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Escolha o tipo de documento'),
centerTitle: true,
),
body: Center(
child: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(
Icons.receipt_long,
size: 80,
color: Colors.blue,
),
const SizedBox(height: 32),
const Text(
'Selecione o tipo de documento fiscal',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 48),
SizedBox(
width: double.infinity,
height: 60,
child: ElevatedButton.icon(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const DanfeScreen(),
),
);
},
icon: const Icon(Icons.description, size: 28),
label: const Text(
'NFC-E / SAT / DANFE',
style: TextStyle(fontSize: 18),
),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
elevation: 4,
),
),
),
const SizedBox(height: 20),
SizedBox(
width: double.infinity,
height: 60,
child: ElevatedButton.icon(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const NfseScreen(),
),
);
},
icon: const Icon(Icons.receipt, size: 28),
label: const Text(
'NFSe Nacional',
style: TextStyle(fontSize: 18),
),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.purple,
foregroundColor: Colors.white,
elevation: 4,
),
),
),
],
),
),
),
);
}
}