Fidelitas University π‘ π΅
Costa Rica π¨π·
Professor Ariel Ramos
For this project I used following dependencies:
//------CUSTOM CODE----//
The custom code was easy to make, you just need send from view a UserDoc form parametres
import 'package:firebase_auth/firebase_auth.dart';
import 'package:pdf/pdf.dart';
import 'package:pdf/widgets.dart' as pw;
import 'package:printing/printing.dart';
Future exportPDF(UsersRecord userDoc) async {
// Add your function code here!
final pdf = pw.Document();
pdf.addPage(pw.Page(
build: (pw.Context context) => pw.Column(
children: [
pw.Text('Data User'),
pw.Divider(thickness: 2),
pw.Text('User email: ' + userDoc.email),
pw.Text('User UID : ' + userDoc.uid),
],
)));
await Printing.layoutPdf(
onLayout: (PdfPageFormat format) async => pdf.save());
}
//----PREVIEW----///
When you log into the app the administrator will be able to see a list of all the users registered in it. They would be able to slide to the right, and it will show a button named 'edit'.
After clicking on it, the information of the selected user will show, and the user will be able to download it as a PDF file.