cpdf_scaffold.dart 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. ///
  2. /// Copyright © 2014-2023 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. import 'package:flutter/material.dart';
  9. import '../../../theme/colors.dart';
  10. import '../../../theme/themes.dart';
  11. class CPDFScaffold extends StatelessWidget {
  12. final bool isDark;
  13. final PreferredSizeWidget? appBar;
  14. final Widget? body;
  15. const CPDFScaffold({Key? key, this.isDark = false, this.appBar, this.body})
  16. : super(key: key);
  17. @override
  18. Widget build(BuildContext context) {
  19. return Theme(
  20. data: isDark
  21. ? comPDFKitDarkTheme
  22. : comPDFKitLightTheme.copyWith(
  23. colorScheme: comPDFKitLightTheme.colorScheme
  24. .copyWith(primary: CPDFColors.backgroundLight)),
  25. child: Scaffold(
  26. appBar: appBar,
  27. body: body,
  28. ),
  29. );
  30. }
  31. }