main.dart 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import 'dart:io';
  2. import 'package:compdfkit_flutter/compdfkit.dart';
  3. import 'package:compdfkit_flutter/widgets/cpdf_readerview_page.dart';
  4. import 'package:flutter/material.dart';
  5. import 'package:flutter/services.dart';
  6. void main() {
  7. runApp(const MyApp());
  8. if (Platform.isAndroid) {
  9. SystemUiOverlayStyle systemUiOverlayStyle = const SystemUiOverlayStyle(
  10. statusBarColor: Colors.transparent
  11. );
  12. SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
  13. }
  14. }
  15. class MyApp extends StatefulWidget {
  16. const MyApp({super.key});
  17. @override
  18. State<MyApp> createState() => _MyAppState();
  19. }
  20. class _MyAppState extends State<MyApp> {
  21. String _version = '';
  22. String _buildTag = '';
  23. @override
  24. void initState() {
  25. super.initState();
  26. _init();
  27. }
  28. void _init() async {
  29. ComPDFKit.init(
  30. 'rgFNqsZykKZ9g+uUEl59uYolfyQQha7hfKF3ojzs41pP3PBGfzPS/9CMwsBkJsqNBfULy7kBiUGXelugMdloJ+DWqE5Zjt4+xP6t2paXuFOPX/uXy6G/9vZkuEGSIFfBpUzrCgcXs4xxh8k5+sAfW+EA7DvUgt7u0CcPRyqr1Jg=',
  31. 'mG0c3O3Mzeu5dkZJW3gpqiAYrD3HuVAh2a+2rjOsIRhyTBaXPgPRGke3LtDII3XZqZRGhToxzSR51pXlzib4f0WpLOaOv47bs7x+UqfQzn9hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBwyVLBY93oKLBB8UJg4t07605BGbaBKUlDopA0iGq1HSncUNNe38VRnoTm6ibgXyIGz5dhD0tvZsf2Vt2my9XP/2scnSpUeS12jwHQXiCsaaK/oKTJGcYKLPGdXenrzHolQ==');
  32. String ver = await ComPDFKit.getVersionCode();
  33. setState(() {
  34. _version = ver;
  35. });
  36. ComPDFKit.getSDKBuildTag().then((value) {
  37. setState(() {
  38. _buildTag = value;
  39. });
  40. });
  41. ComPDFKit.getTemporaryDirectory().then((value) {
  42. });
  43. }
  44. @override
  45. Widget build(BuildContext context) {
  46. return const CPDFReaderViewPage(isDark: false);
  47. }
  48. }