cpdf_reader_widget_dark_theme_example.dart 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright © 2014-2024 PDF Technologies, Inc. All Rights Reserved.
  3. *
  4. * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  5. * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  6. * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  7. * This notice may not be removed from this file.
  8. *
  9. */
  10. /// Copyright © 2014-2024 PDF Technologies, Inc. All Rights Reserved.
  11. ///
  12. /// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  13. /// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  14. /// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  15. /// This notice may not be removed from this file.
  16. ///
  17. import 'package:compdfkit_flutter/cpdf_configuration.dart';
  18. import 'package:compdfkit_flutter/cpdf_options.dart';
  19. import 'package:compdfkit_flutter/widgets/cpdf_reader_widget.dart';
  20. import 'package:compdfkit_flutter_example/theme/themes.dart';
  21. import 'package:flutter/material.dart';
  22. class CPDFDarkThemeExample extends StatefulWidget {
  23. final String documentPath;
  24. const CPDFDarkThemeExample({super.key, required this.documentPath});
  25. @override
  26. State<CPDFDarkThemeExample> createState() => _CPDFDarkThemeExampleState();
  27. }
  28. class _CPDFDarkThemeExampleState extends State<CPDFDarkThemeExample> {
  29. @override
  30. Widget build(BuildContext context) {
  31. return MaterialApp(
  32. theme: darkTheme,
  33. home: Scaffold(
  34. resizeToAvoidBottomInset: false,
  35. appBar: AppBar(
  36. title: const Text('Dark Theme Example'),
  37. ),
  38. body: CPDFReaderWidget(
  39. document: widget.documentPath,
  40. configuration: CPDFConfiguration(
  41. readerViewConfig:
  42. const ReaderViewConfig(themes: CPDFThemes.dark),
  43. globalConfig: const CPDFGlobalConfig(
  44. themeMode: CPDFThemeMode.dark)),
  45. onCreated: (controller) {
  46. },)));
  47. }
  48. }