1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- import 'package:ConversionFlutterDemo/states/convert_options_provider.dart';
- import 'package:flutter/material.dart';
- import 'package:provider/provider.dart';
- /// convert_rtf_options_widget.dart
- /// Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
- ///
- /// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
- /// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
- /// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
- /// This notice may not be removed from this file.
- class ConvertRTFOptionsWidget extends StatefulWidget {
- const ConvertRTFOptionsWidget({Key? key}) : super(key: key);
- @override
- State<ConvertRTFOptionsWidget> createState() =>
- _ConvertRTFOptionsWidgetState();
- }
- class _ConvertRTFOptionsWidgetState extends State<ConvertRTFOptionsWidget> {
- @override
- Widget build(BuildContext context) {
- bool containImages = context.select<ConvertOptionsProvider, bool>(
- (value) => value.rtfOptions.containImages);
- bool containAnnotations = context.select<ConvertOptionsProvider, bool>(
- (value) => value.rtfOptions.containAnnotations);
- return Padding(
- padding: EdgeInsets.all(8),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- const Text('ContainImages'),
- Switch(
- value: containImages,
- onChanged: (value) {
- context
- .read<ConvertOptionsProvider>()
- .changeRTFOptions(containImages: value);
- })
- ],
- ),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- const Text('ContainAnnotations'),
- Switch(
- value: containAnnotations,
- onChanged: (value) {
- context
- .read<ConvertOptionsProvider>()
- .changeRTFOptions(containAnnotations: value);
- })
- ],
- )
- ],
- ));
- }
- }
|