flet-printing 0.2.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (19) hide show
  1. {flet_printing-0.2.0 → flet_printing-0.3.0}/PKG-INFO +11 -12
  2. {flet_printing-0.2.0 → flet_printing-0.3.0}/README.md +5 -6
  3. {flet_printing-0.2.0 → flet_printing-0.3.0}/pyproject.toml +5 -5
  4. {flet_printing-0.2.0 → flet_printing-0.3.0}/src/flet_printing/__init__.py +1 -1
  5. {flet_printing-0.2.0 → flet_printing-0.3.0}/src/flet_printing/printing.py +2 -2
  6. {flet_printing-0.2.0 → flet_printing-0.3.0}/src/flet_printing.egg-info/PKG-INFO +11 -12
  7. flet_printing-0.3.0/src/flet_printing.egg-info/requires.txt +1 -0
  8. flet_printing-0.3.0/src/flutter/flet_printing/lib/src/pdf_preview_control.dart +88 -0
  9. {flet_printing-0.2.0 → flet_printing-0.3.0}/src/flutter/flet_printing/pubspec.yaml +5 -4
  10. flet_printing-0.2.0/src/flet_printing.egg-info/requires.txt +0 -1
  11. flet_printing-0.2.0/src/flutter/flet_printing/lib/src/pdf_preview_control.dart +0 -39
  12. {flet_printing-0.2.0 → flet_printing-0.3.0}/setup.cfg +0 -0
  13. {flet_printing-0.2.0 → flet_printing-0.3.0}/src/flet_printing/pdf_preview.py +0 -0
  14. {flet_printing-0.2.0 → flet_printing-0.3.0}/src/flet_printing.egg-info/SOURCES.txt +0 -0
  15. {flet_printing-0.2.0 → flet_printing-0.3.0}/src/flet_printing.egg-info/dependency_links.txt +0 -0
  16. {flet_printing-0.2.0 → flet_printing-0.3.0}/src/flet_printing.egg-info/top_level.txt +0 -0
  17. {flet_printing-0.2.0 → flet_printing-0.3.0}/src/flutter/flet_printing/lib/flet_printing.dart +0 -0
  18. {flet_printing-0.2.0 → flet_printing-0.3.0}/src/flutter/flet_printing/lib/src/extension.dart +0 -0
  19. {flet_printing-0.2.0 → flet_printing-0.3.0}/src/flutter/flet_printing/lib/src/printing_service.dart +0 -0
@@ -1,16 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-printing
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Native print dialog, share sheet and PDF preview for Flet apps — wraps the Flutter printing package
5
5
  Author: aiseed-dev
6
- Project-URL: Homepage, https://github.com/aiseed-dev/flet-printing
7
- Project-URL: Documentation, https://github.com/aiseed-dev/flet-printing
8
- Project-URL: Repository, https://github.com/aiseed-dev/flet-printing
9
- Project-URL: Issues, https://github.com/aiseed-dev/flet-printing/issues
6
+ Project-URL: Homepage, https://github.com/aiseed-dev/flet-tools/tree/main/flet-printing
7
+ Project-URL: Documentation, https://github.com/aiseed-dev/flet-tools/tree/main/flet-printing
8
+ Project-URL: Repository, https://github.com/aiseed-dev/flet-tools/tree/main/flet-printing
9
+ Project-URL: Issues, https://github.com/aiseed-dev/flet-tools/issues
10
10
  Keywords: flet,flutter,printing,print,pdf
11
11
  Requires-Python: >=3.10
12
12
  Description-Content-Type: text/markdown
13
- Requires-Dist: flet>=0.85.3
13
+ Requires-Dist: flet>=1.1.0
14
14
 
15
15
  # flet-printing
16
16
 
@@ -28,7 +28,7 @@ package — was closed as "completed" without a shipped solution, and the
28
28
  follow-up question *"What's the completed solution for this?"* (Feb
29
29
  2024) was never answered. This package is that answer.
30
30
 
31
- 日本語補足: Fletには印刷APIがありません(0.85時点・全API確認済み)。
31
+ 日本語補足: Fletには印刷APIがありません(0.85で全API確認、1.1でも無し)。
32
32
  Flutterの`printing`パッケージ(ネイティブ印刷ダイアログ・共有シート)を
33
33
  Flet拡張として包んだものです。ワープロ的なアプリの「ファイル→印刷…」を
34
34
  Fletで実装できます。
@@ -92,15 +92,14 @@ Add to your app's `pyproject.toml`:
92
92
  ```toml
93
93
  dependencies = [
94
94
  "flet-printing",
95
- "flet>=0.85.3",
95
+ "flet>=1.1.0",
96
96
  ]
97
97
  ```
98
98
 
99
99
  then `flet build linux` (or `windows` / `macos` / `apk` / `ipa`).
100
-
101
- A runnable example lives in `examples/flet_printing_example`
102
- (build verified on Linux: extension registers, app launches, print
103
- dialog opens from the button).
100
+ The Usage snippets above are complete runnable apps — paste one into
101
+ your app's `main.py` to try it (build verified on Linux: extension
102
+ registers, app launches, print dialog opens).
104
103
 
105
104
  ## Platform support
106
105
 
@@ -14,7 +14,7 @@ package — was closed as "completed" without a shipped solution, and the
14
14
  follow-up question *"What's the completed solution for this?"* (Feb
15
15
  2024) was never answered. This package is that answer.
16
16
 
17
- 日本語補足: Fletには印刷APIがありません(0.85時点・全API確認済み)。
17
+ 日本語補足: Fletには印刷APIがありません(0.85で全API確認、1.1でも無し)。
18
18
  Flutterの`printing`パッケージ(ネイティブ印刷ダイアログ・共有シート)を
19
19
  Flet拡張として包んだものです。ワープロ的なアプリの「ファイル→印刷…」を
20
20
  Fletで実装できます。
@@ -78,15 +78,14 @@ Add to your app's `pyproject.toml`:
78
78
  ```toml
79
79
  dependencies = [
80
80
  "flet-printing",
81
- "flet>=0.85.3",
81
+ "flet>=1.1.0",
82
82
  ]
83
83
  ```
84
84
 
85
85
  then `flet build linux` (or `windows` / `macos` / `apk` / `ipa`).
86
-
87
- A runnable example lives in `examples/flet_printing_example`
88
- (build verified on Linux: extension registers, app launches, print
89
- dialog opens from the button).
86
+ The Usage snippets above are complete runnable apps — paste one into
87
+ your app's `main.py` to try it (build verified on Linux: extension
88
+ registers, app launches, print dialog opens).
90
89
 
91
90
  ## Platform support
92
91
 
@@ -9,7 +9,7 @@ authors = [
9
9
  ]
10
10
  keywords = ["flet", "flutter", "printing", "print", "pdf"]
11
11
  dependencies = [
12
- "flet>=0.85.3",
12
+ "flet>=1.1.0",
13
13
  ]
14
14
 
15
15
  [dependency-groups]
@@ -20,10 +20,10 @@ dev = [
20
20
  ]
21
21
 
22
22
  [project.urls]
23
- Homepage = "https://github.com/aiseed-dev/flet-printing"
24
- Documentation = "https://github.com/aiseed-dev/flet-printing"
25
- Repository = "https://github.com/aiseed-dev/flet-printing"
26
- Issues = "https://github.com/aiseed-dev/flet-printing/issues"
23
+ Homepage = "https://github.com/aiseed-dev/flet-tools/tree/main/flet-printing"
24
+ Documentation = "https://github.com/aiseed-dev/flet-tools/tree/main/flet-printing"
25
+ Repository = "https://github.com/aiseed-dev/flet-tools/tree/main/flet-printing"
26
+ Issues = "https://github.com/aiseed-dev/flet-tools/issues"
27
27
 
28
28
  [tool.setuptools.dynamic]
29
29
  version = { attr = "flet_printing.__version__" }
@@ -1,5 +1,5 @@
1
1
  from flet_printing.pdf_preview import PdfPreview
2
2
  from flet_printing.printing import Printing
3
3
 
4
- __version__ = "0.2.0"
4
+ __version__ = "0.3.0"
5
5
  __all__ = ["Printing", "PdfPreview", "__version__"]
@@ -1,8 +1,8 @@
1
1
  """Printing service control for Flet — native print dialog via the Flutter
2
2
  ``printing`` package.
3
3
 
4
- Flet has no built-in printing API (verified against Flet 0.85: nothing
5
- print/PDF-related is exposed), while Flutter has a mature ``printing``
4
+ Flet has no built-in printing API (verified against Flet 0.85 and 1.1:
5
+ nothing print/PDF-related is exposed), while Flutter has a mature ``printing``
6
6
  package (native print dialog, share sheet, PDF rasterization). This
7
7
  extension bridges the two, the same way official extensions like
8
8
  ``flet-audio`` wrap ``audioplayers``.
@@ -1,16 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-printing
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Native print dialog, share sheet and PDF preview for Flet apps — wraps the Flutter printing package
5
5
  Author: aiseed-dev
6
- Project-URL: Homepage, https://github.com/aiseed-dev/flet-printing
7
- Project-URL: Documentation, https://github.com/aiseed-dev/flet-printing
8
- Project-URL: Repository, https://github.com/aiseed-dev/flet-printing
9
- Project-URL: Issues, https://github.com/aiseed-dev/flet-printing/issues
6
+ Project-URL: Homepage, https://github.com/aiseed-dev/flet-tools/tree/main/flet-printing
7
+ Project-URL: Documentation, https://github.com/aiseed-dev/flet-tools/tree/main/flet-printing
8
+ Project-URL: Repository, https://github.com/aiseed-dev/flet-tools/tree/main/flet-printing
9
+ Project-URL: Issues, https://github.com/aiseed-dev/flet-tools/issues
10
10
  Keywords: flet,flutter,printing,print,pdf
11
11
  Requires-Python: >=3.10
12
12
  Description-Content-Type: text/markdown
13
- Requires-Dist: flet>=0.85.3
13
+ Requires-Dist: flet>=1.1.0
14
14
 
15
15
  # flet-printing
16
16
 
@@ -28,7 +28,7 @@ package — was closed as "completed" without a shipped solution, and the
28
28
  follow-up question *"What's the completed solution for this?"* (Feb
29
29
  2024) was never answered. This package is that answer.
30
30
 
31
- 日本語補足: Fletには印刷APIがありません(0.85時点・全API確認済み)。
31
+ 日本語補足: Fletには印刷APIがありません(0.85で全API確認、1.1でも無し)。
32
32
  Flutterの`printing`パッケージ(ネイティブ印刷ダイアログ・共有シート)を
33
33
  Flet拡張として包んだものです。ワープロ的なアプリの「ファイル→印刷…」を
34
34
  Fletで実装できます。
@@ -92,15 +92,14 @@ Add to your app's `pyproject.toml`:
92
92
  ```toml
93
93
  dependencies = [
94
94
  "flet-printing",
95
- "flet>=0.85.3",
95
+ "flet>=1.1.0",
96
96
  ]
97
97
  ```
98
98
 
99
99
  then `flet build linux` (or `windows` / `macos` / `apk` / `ipa`).
100
-
101
- A runnable example lives in `examples/flet_printing_example`
102
- (build verified on Linux: extension registers, app launches, print
103
- dialog opens from the button).
100
+ The Usage snippets above are complete runnable apps — paste one into
101
+ your app's `main.py` to try it (build verified on Linux: extension
102
+ registers, app launches, print dialog opens).
104
103
 
105
104
  ## Platform support
106
105
 
@@ -0,0 +1 @@
1
+ flet>=1.1.0
@@ -0,0 +1,88 @@
1
+ import 'package:flet/flet.dart';
2
+ // printing's PdfPreview is written against the Flutter SDK's Material library,
3
+ // but since Flet 1.1 an app only provides material_ui ancestors (Theme,
4
+ // Material, MaterialLocalizations), which the SDK widgets do not see. So this
5
+ // control supplies the SDK ones itself, with colors taken from the app's
6
+ // current material_ui theme. Drop this once printing moves to material_ui.
7
+ import 'package:flutter/material.dart' as sdk;
8
+ import 'package:flutter/widgets.dart';
9
+ import 'package:material_ui/material_ui.dart' as mui;
10
+ import 'package:printing/printing.dart';
11
+
12
+ /// Visual PDF preview with built-in print/share actions
13
+ /// (wraps `printing`'s PdfPreview widget).
14
+ class PdfPreviewControl extends StatelessWidget {
15
+ final Control control;
16
+
17
+ const PdfPreviewControl({super.key, required this.control});
18
+
19
+ /// The app's material_ui color scheme, rebuilt as an SDK theme.
20
+ static sdk.ThemeData _sdkTheme(BuildContext context) {
21
+ final c = mui.Theme.of(context).colorScheme;
22
+ return sdk.ThemeData.from(
23
+ colorScheme: sdk.ColorScheme(
24
+ brightness: c.brightness,
25
+ primary: c.primary,
26
+ onPrimary: c.onPrimary,
27
+ primaryContainer: c.primaryContainer,
28
+ onPrimaryContainer: c.onPrimaryContainer,
29
+ secondary: c.secondary,
30
+ onSecondary: c.onSecondary,
31
+ tertiary: c.tertiary,
32
+ onTertiary: c.onTertiary,
33
+ error: c.error,
34
+ onError: c.onError,
35
+ surface: c.surface,
36
+ onSurface: c.onSurface,
37
+ onSurfaceVariant: c.onSurfaceVariant,
38
+ surfaceContainerHighest: c.surfaceContainerHighest,
39
+ outline: c.outline,
40
+ outlineVariant: c.outlineVariant,
41
+ inverseSurface: c.inverseSurface,
42
+ onInverseSurface: c.onInverseSurface,
43
+ inversePrimary: c.inversePrimary,
44
+ shadow: c.shadow,
45
+ scrim: c.scrim,
46
+ ),
47
+ );
48
+ }
49
+
50
+ @override
51
+ Widget build(BuildContext context) {
52
+ final resolvedSrc = control.getSrc("src");
53
+ if (resolvedSrc.error != null) {
54
+ throw Exception("PdfPreview src decode error: ${resolvedSrc.error}");
55
+ }
56
+ final bytes = resolvedSrc.bytes;
57
+ if (bytes == null) {
58
+ throw Exception(
59
+ "PdfPreview must have \"src\" specified as PDF bytes or base64.");
60
+ }
61
+
62
+ final preview = PdfPreview(
63
+ build: (format) async => bytes,
64
+ allowPrinting: control.getBool("allow_printing", true)!,
65
+ allowSharing: control.getBool("allow_sharing", true)!,
66
+ canChangePageFormat: control.getBool("can_change_page_format", false)!,
67
+ canChangeOrientation: control.getBool("can_change_orientation", false)!,
68
+ canDebug: false,
69
+ useActions: control.getBool("use_actions", true)!,
70
+ pdfFileName: control.getString("pdf_file_name"),
71
+ onPrinted: (context) => control.triggerEvent("printed"),
72
+ onShared: (context) => control.triggerEvent("shared"),
73
+ );
74
+
75
+ return LayoutControl(
76
+ control: control,
77
+ child: Localizations.override(
78
+ context: context,
79
+ delegates: const [sdk.DefaultMaterialLocalizations.delegate],
80
+ child: sdk.Theme(
81
+ data: _sdkTheme(context),
82
+ child: sdk.Material(
83
+ type: sdk.MaterialType.transparency, child: preview),
84
+ ),
85
+ ),
86
+ );
87
+ }
88
+ }
@@ -1,18 +1,19 @@
1
1
  name: flet_printing
2
2
  description: Native print dialog / share sheet for Flet apps (wraps the printing package)
3
- version: 0.2.0
3
+ version: 0.3.0
4
4
  publish_to: none
5
5
 
6
6
  environment:
7
7
  sdk: '>=3.3.0 <4.0.0'
8
- flutter: ">=1.17.0"
8
+ flutter: ">=3.47.0"
9
9
 
10
10
  dependencies:
11
- flet: ^0.85.3
11
+ flet: ^1.1.0
12
+ material_ui: ^1.6.0
12
13
  flutter:
13
14
  sdk: flutter
14
15
 
15
- printing: ^5.14.0
16
+ printing: ^5.15.1
16
17
 
17
18
  dev_dependencies:
18
19
  flutter_test:
@@ -1 +0,0 @@
1
- flet>=0.85.3
@@ -1,39 +0,0 @@
1
- import 'package:flet/flet.dart';
2
- import 'package:flutter/material.dart';
3
- import 'package:printing/printing.dart';
4
-
5
- /// Visual PDF preview with built-in print/share actions
6
- /// (wraps `printing`'s PdfPreview widget).
7
- class PdfPreviewControl extends StatelessWidget {
8
- final Control control;
9
-
10
- const PdfPreviewControl({super.key, required this.control});
11
-
12
- @override
13
- Widget build(BuildContext context) {
14
- final resolvedSrc = control.getSrc("src");
15
- if (resolvedSrc.error != null) {
16
- throw Exception("PdfPreview src decode error: ${resolvedSrc.error}");
17
- }
18
- final bytes = resolvedSrc.bytes;
19
- if (bytes == null) {
20
- throw Exception(
21
- "PdfPreview must have \"src\" specified as PDF bytes or base64.");
22
- }
23
-
24
- final preview = PdfPreview(
25
- build: (format) async => bytes,
26
- allowPrinting: control.getBool("allow_printing", true)!,
27
- allowSharing: control.getBool("allow_sharing", true)!,
28
- canChangePageFormat: control.getBool("can_change_page_format", false)!,
29
- canChangeOrientation: control.getBool("can_change_orientation", false)!,
30
- canDebug: false,
31
- useActions: control.getBool("use_actions", true)!,
32
- pdfFileName: control.getString("pdf_file_name"),
33
- onPrinted: (context) => control.triggerEvent("printed"),
34
- onShared: (context) => control.triggerEvent("shared"),
35
- );
36
-
37
- return LayoutControl(control: control, child: preview);
38
- }
39
- }
File without changes