cpdf_app_bar.dart 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. import 'package:flutter/material.dart';
  11. import 'package:flutter_svg/svg.dart';
  12. import '../page/settings_page.dart';
  13. class CAppBar extends StatelessWidget implements PreferredSizeWidget {
  14. const CAppBar({super.key});
  15. @override
  16. Widget build(BuildContext context) {
  17. return AppBar(
  18. title: const Text('ComPDFKit SDK for Flutter'),
  19. actions: [
  20. IconButton(
  21. padding: const EdgeInsets.all(16),
  22. onPressed: () {
  23. Navigator.push(context, MaterialPageRoute(builder: (context) {
  24. return const SettingsPage();
  25. }));
  26. },
  27. icon: SvgPicture.asset(
  28. 'images/ic_home_setting.svg',
  29. width: 24,
  30. height: 24,
  31. colorFilter: ColorFilter.mode(Theme.of(context).colorScheme.onPrimary, BlendMode.srcIn),
  32. ))
  33. ],
  34. );
  35. }
  36. @override
  37. Size get preferredSize => const Size(double.infinity, 56);
  38. }