first commit
This commit is contained in:
75
lib/Screens/PDF/pdf.dart
Normal file
75
lib/Screens/PDF/pdf.dart
Normal file
@@ -0,0 +1,75 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_pdfview/flutter_pdfview.dart';
|
||||
import 'package:mobile_pos/generated/l10n.dart' as lang;
|
||||
|
||||
class PDFViewerPage extends StatefulWidget {
|
||||
final String path;
|
||||
|
||||
const PDFViewerPage({super.key, required this.path});
|
||||
|
||||
@override
|
||||
PDFViewerPageState createState() => PDFViewerPageState();
|
||||
}
|
||||
|
||||
class PDFViewerPageState extends State<PDFViewerPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
lang.S.of(context).invoiceViewr,
|
||||
),
|
||||
iconTheme: const IconThemeData(color: Colors.black),
|
||||
centerTitle: true,
|
||||
backgroundColor: Colors.white,
|
||||
elevation: 0.0,
|
||||
),
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: PDFView(
|
||||
filePath: widget.path,
|
||||
// onViewCreated: (PDFViewController controller) {
|
||||
// _pdfViewController = controller;
|
||||
// },
|
||||
// onPageChanged: (int page, int total) {
|
||||
// setState(() {
|
||||
// _currentPage = page;
|
||||
// _pages = total;
|
||||
// });
|
||||
// },
|
||||
),
|
||||
),
|
||||
// Container(
|
||||
// padding: EdgeInsets.all(8.0),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: <Widget>[
|
||||
// IconButton(
|
||||
// icon: Icon(Icons.chevron_left),
|
||||
// // onPressed: () {
|
||||
// // _pdfViewController.previousPage(
|
||||
// // duration: Duration(milliseconds: 250),
|
||||
// // curve: Curves.ease,
|
||||
// // );
|
||||
// // },
|
||||
// ),
|
||||
// Text('$_currentPage/$_pages'),
|
||||
// IconButton(
|
||||
// icon: const Icon(Icons.chevron_right),
|
||||
// onPressed: () {
|
||||
// _pdfViewController.setPage(
|
||||
//
|
||||
// duration: Duration(milliseconds: 250),
|
||||
// curve: Curves.ease,
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user