41 lines
931 B
Dart
41 lines
931 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:manager_app/Helpers/PDFHelper.dart';
|
|
import 'package:manager_app/constants.dart';
|
|
import 'package:manager_api_new/api.dart';
|
|
|
|
class DownloadPDF extends StatefulWidget {
|
|
final List<SectionDTO> sections;
|
|
const DownloadPDF({
|
|
Key key,
|
|
this.sections,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
_DownloadPDFState createState() => _DownloadPDFState();
|
|
}
|
|
|
|
class _DownloadPDFState extends State<DownloadPDF> {
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return
|
|
InkWell(
|
|
onTap: () async {
|
|
try {
|
|
PDFHelper.downloadPDF(widget.sections);
|
|
} catch(e) {
|
|
print(e);
|
|
}
|
|
},
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(left: 5.0),
|
|
child: Icon(Icons.qr_code, color: kPrimaryColor)
|
|
),
|
|
);
|
|
}
|
|
} |