cpdf_reader_widget_dark_theme_example.dart 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. import 'package:flutter/services.dart';
  23. class CPDFDarkThemeExample extends StatefulWidget {
  24. final String documentPath;
  25. const CPDFDarkThemeExample({super.key, required this.documentPath});
  26. @override
  27. State<CPDFDarkThemeExample> createState() => _CPDFDarkThemeExampleState();
  28. }
  29. class _CPDFDarkThemeExampleState extends State<CPDFDarkThemeExample> {
  30. @override
  31. Widget build(BuildContext context) {
  32. return MaterialApp(
  33. theme: darkTheme,
  34. home: Scaffold(
  35. resizeToAvoidBottomInset: false,
  36. appBar: AppBar(
  37. title: const Text('Dark Theme Example'),
  38. ),
  39. body: CPDFReaderWidget(
  40. document: widget.documentPath,
  41. configuration: CPDFConfiguration(
  42. readerViewConfig:
  43. const ReaderViewConfig(themes: CPDFThemes.dark),
  44. globalConfig: const CPDFGlobalConfig(
  45. themeMode: CPDFThemeMode.dark)),
  46. onCreated: (controller) {
  47. },)));
  48. }
  49. }