cpdf_outline_data.dart 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. class CPDFOutlineData {
  9. int level = 1;
  10. String title = '';
  11. int pageIndex = 0;
  12. bool expanded = false;
  13. List<CPDFOutlineData>? childOutline;
  14. CPDFOutlineData(
  15. {this.level = 1, this.title = '', this.pageIndex = 0, this.childOutline});
  16. CPDFOutlineData.formJson(Map<String, dynamic> json) {
  17. level = json['level'];
  18. title = json['title'];
  19. pageIndex = json['pageIndex'];
  20. childOutline = parse(json['childOutline']);
  21. }
  22. List<CPDFOutlineData> parse(List<dynamic> list) {
  23. List<CPDFOutlineData> datas = List.empty(growable: true);
  24. for (var value in list) {
  25. datas.add(CPDFOutlineData.formJson(value));
  26. }
  27. return datas;
  28. }
  29. @override
  30. String toString() {
  31. return 'title: $title, level: $level, pageIndex:$pageIndex, childOutline:${childOutline.toString()} ';
  32. }
  33. }