main.dart 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import 'package:ConversionFlutterDemo/states/convert_options_provider.dart';
  2. import 'package:ConversionFlutterDemo/states/convert_provider.dart';
  3. import 'package:ConversionFlutterDemo/widgets/conversion_sdk_info_widget.dart';
  4. import 'package:ConversionFlutterDemo/widgets/convert_config.dart';
  5. import 'package:ConversionFlutterDemo/widgets/convert_list_widget.dart';
  6. import 'package:flutter/material.dart';
  7. import 'package:provider/provider.dart';
  8. void main() {
  9. runApp(MultiProvider(
  10. providers: [
  11. ChangeNotifierProvider(create: (_) => ConvertProvider()),
  12. ChangeNotifierProvider(create: (_) => ConvertOptionsProvider())
  13. ],
  14. child: const MyApp(),
  15. ));
  16. }
  17. class MyApp extends StatelessWidget {
  18. const MyApp({super.key});
  19. @override
  20. Widget build(BuildContext context) {
  21. return MaterialApp(
  22. title: 'ComPDFKitConversionDemo',
  23. theme: ThemeData(
  24. primarySwatch: Colors.blue,
  25. ),
  26. home: const MyHomePage(title: 'ComPDFKitConversionDemo'));
  27. }
  28. }
  29. class MyHomePage extends StatefulWidget {
  30. const MyHomePage({super.key, required this.title});
  31. final String title;
  32. @override
  33. State<MyHomePage> createState() => _MyHomePageState();
  34. }
  35. class _MyHomePageState extends State<MyHomePage> {
  36. @override
  37. Widget build(BuildContext context) {
  38. return Scaffold(
  39. appBar: AppBar(
  40. title: Text(widget.title),
  41. ),
  42. body: Padding(
  43. padding: EdgeInsets.all(8),
  44. child: Column(
  45. crossAxisAlignment: CrossAxisAlignment.start,
  46. children: const <Widget>[
  47. ConversionSdkInfoWidget(),//conversion sdk info widget
  48. ConvertConfigWidget(), //convert options widget,
  49. Expanded(child: ConvertListWidget())
  50. ],
  51. ),
  52. ));
  53. }
  54. }