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 createState() => _ConvertRTFOptionsWidgetState(); } class _ConvertRTFOptionsWidgetState extends State { @override Widget build(BuildContext context) { bool containImages = context.select( (value) => value.rtfOptions.containImages); bool containAnnotations = context.select( (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() .changeRTFOptions(containImages: value); }) ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ const Text('ContainAnnotations'), Switch( value: containAnnotations, onChanged: (value) { context .read() .changeRTFOptions(containAnnotations: value); }) ], ) ], )); } }