cpdf_tool_bar.dart 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. final String titleText;
  10. final VoidCallback? onPressed;
  11. final Widget? leadingIcon;
  12. CPDFToolbar(
  13. {super.key,
  14. this.titleText = '',
  15. super.actions,
  16. super.backgroundColor,
  17. this.leadingIcon,
  18. super.bottom,
  19. this.onPressed})
  20. : super(
  21. leading: leadingIcon != null
  22. ? IconButton(
  23. onPressed: onPressed,
  24. icon: leadingIcon,
  25. splashRadius: 24,
  26. )
  27. : null,
  28. elevation: 2,
  29. title: Text(titleText,
  30. style: const TextStyle(
  31. fontFamily: 'sans-serif-medium', fontSize: 22)),
  32. titleSpacing: titleText.isEmpty ? 15 : 0,
  33. );
  34. }