cpdf_tool_bar.dart 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import 'package:flutter/material.dart';
  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. class CPDFToolbar extends AppBar {
  9. late final Widget? leadingIcon;
  10. CPDFToolbar(
  11. {super.key,
  12. super.title,
  13. super.actions,
  14. super.backgroundColor,
  15. this.leadingIcon,
  16. super.bottom})
  17. : super(
  18. leading: leadingIcon,
  19. elevation: 2,
  20. titleSpacing: title == null ? 15 : 0,
  21. );
  22. CPDFToolbar.normal(
  23. {super.key,
  24. required BuildContext context,
  25. VoidCallback? leadingOnPressed,
  26. required String titleText, super.bottom})
  27. : super(
  28. leading: IconButton(
  29. onPressed: leadingOnPressed,
  30. icon: Icon(Icons.arrow_back,
  31. color: Theme.of(context).colorScheme.onBackground),
  32. ),
  33. title: Text(
  34. titleText,
  35. style: const TextStyle(
  36. fontFamily: 'sans-serif-medium', fontSize: 22),
  37. ),elevation: 2);
  38. }