47 lines
1.1 KiB
Dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:manager_app/Helpers/PDFHelper.dart';
import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart';
import 'package:provider/provider.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) {
final appContext = Provider.of<AppContext>(context);
Size size = MediaQuery.of(context).size;
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.cloud_download, color: kPrimaryColor)
),
);
}
}