conversion_sdk_info_widget.dart 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /// conversion_sdk_info_widget.dart
  2. ///
  3. /// Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
  4. ///
  5. /// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  6. /// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  7. /// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  8. /// This notice may not be removed from this file.
  9. import 'package:flutter/material.dart';
  10. import 'package:kmpdfkit_conversion_flutter/cpdf_converter.dart';
  11. import 'package:provider/provider.dart';
  12. import '../states/convert_task_queue_provider.dart';
  13. class ConversionSdkInfoWidget extends StatefulWidget {
  14. const ConversionSdkInfoWidget({Key? key}) : super(key: key);
  15. @override
  16. State<ConversionSdkInfoWidget> createState() =>
  17. _ConversionSdkInfoWidgetState();
  18. }
  19. class _ConversionSdkInfoWidgetState extends State<ConversionSdkInfoWidget> {
  20. String conversionSDKVersion = "Version:";
  21. String convertFileOutputPath = "";
  22. @override
  23. void initState() {
  24. super.initState();
  25. CPDFConverter.getSDKBuildTag().then((value) {
  26. setState(() {
  27. conversionSDKVersion = "Version:$value";
  28. });
  29. });
  30. context.read<ConvertTaskQueueProvider>().getOutputDir().then((value) {
  31. setState(() {
  32. convertFileOutputPath = value ?? "";
  33. });
  34. });
  35. }
  36. @override
  37. Widget build(BuildContext context) {
  38. return Column(
  39. crossAxisAlignment: CrossAxisAlignment.start,
  40. children: [
  41. Text(
  42. conversionSDKVersion,
  43. style: const TextStyle(fontSize: 13),
  44. ),
  45. Text(
  46. 'OutputPath:$convertFileOutputPath',
  47. style: const TextStyle(fontSize: 13),
  48. )
  49. ],
  50. );
  51. }
  52. }