flet-flashlight 0.2.0.dev42__py3-none-any.whl → 0.2.0.dev504__py3-none-any.whl

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.

Potentially problematic release.


This version of flet-flashlight might be problematic. Click here for more details.

@@ -1,4 +1,3 @@
1
- import asyncio
2
1
  from typing import Optional
3
2
 
4
3
  import flet as ft
@@ -39,11 +38,11 @@ class Flashlight(ft.Service):
39
38
  contains information on the error.
40
39
  """
41
40
 
42
- async def turn_on_async(self):
41
+ async def turn_on(self):
43
42
  """
44
43
  Turns the flashlight on.
45
44
  """
46
- r = await self._invoke_method_async("on")
45
+ r = await self._invoke_method("on")
47
46
  if r is True:
48
47
  self.on = True
49
48
  else: # error occured
@@ -56,17 +55,11 @@ class Flashlight(ft.Service):
56
55
  else:
57
56
  raise FlashlightEnableException(error_msg)
58
57
 
59
- def turn_on(self):
60
- """
61
- Turns the flashlight on.
62
- """
63
- asyncio.create_task(self.turn_on_async())
64
-
65
- async def turn_off_async(self):
58
+ async def turn_off(self):
66
59
  """
67
60
  Turns the flashlight off.
68
61
  """
69
- r = await self._invoke_method_async("off")
62
+ r = await self._invoke_method("off")
70
63
  if r is True:
71
64
  self.on = False
72
65
  else: # error occured
@@ -79,32 +72,21 @@ class Flashlight(ft.Service):
79
72
  else:
80
73
  raise FlashlightDisableException(error_msg)
81
74
 
82
- def turn_off(self):
83
- """
84
- Turns the flashlight off.
85
- """
86
- asyncio.create_task(self.turn_off_async())
87
-
88
- async def toggle_async(self):
75
+ async def toggle(self):
89
76
  """
90
77
  Toggles the flashlight on and off.
91
78
  """
92
79
  if self.on:
93
- await self.turn_off_async()
94
- await self.turn_on_async()
95
-
96
- def toggle(self):
97
- """
98
- Toggles the flashlight on and off.
99
- """
100
- asyncio.create_task(self.toggle_async())
80
+ await self.turn_off()
81
+ else:
82
+ await self.turn_on()
101
83
 
102
- async def is_available_async(self):
84
+ async def is_available(self):
103
85
  """
104
86
  Checks if the flashlight is available on the device.
105
87
  """
106
- r = await self._invoke_method_async("is_available")
107
- if r is bool:
88
+ r = await self._invoke_method("is_available")
89
+ if isinstance(r, bool):
108
90
  return r
109
91
  else: # error occured
110
92
  error_msg = r.get("error_msg")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-flashlight
3
- Version: 0.2.0.dev42
3
+ Version: 0.2.0.dev504
4
4
  Summary: A Flet extension to manage the device torch/flashlight.
5
5
  Author-email: Flet contributors <hello@flet.dev>
6
6
  License-Expression: Apache-2.0
@@ -41,7 +41,9 @@ This package supports the following platforms:
41
41
  | Android | ✅ |
42
42
  | Web | ❌ |
43
43
 
44
- ## Installation
44
+ ## Usage
45
+
46
+ ### Installation
45
47
 
46
48
  To install the `flet-flashlight` package and add it to your project dependencies:
47
49
 
@@ -60,3 +62,7 @@ To install the `flet-flashlight` package and add it to your project dependencies
60
62
  ```bash
61
63
  poetry add flet-flashlight
62
64
  ```
65
+
66
+ ### Examples
67
+
68
+ For examples, see [these](./examples).
@@ -1,17 +1,17 @@
1
1
  flet_flashlight/__init__.py,sha256=HeAGCDBu6m5xIHk9J5RwTwLsx78T295V_g6NPgTQLCw,634
2
2
  flet_flashlight/exceptions.py,sha256=GZyn_wUgu9n9iR4Z5955ql1dILRY6Tk9huJGOiI5BAQ,1917
3
- flet_flashlight/flashlight.py,sha256=qXNru4bv_7l6PBABOZU9zhPntRuskY2tS1u8nyK1i1g,3256
4
- flet_flashlight-0.2.0.dev42.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
3
+ flet_flashlight/flashlight.py,sha256=qGazTCIQlZINS0SeIN9g515Rsfa1kXWi4tWaCp4WPIU,2811
4
+ flet_flashlight-0.2.0.dev504.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
5
5
  flutter/flet_flashlight/CHANGELOG.md,sha256=66sWepPaeTc9_lzcYIGU55AlxSU5Z1XVtknXpzd_-p8,40
6
6
  flutter/flet_flashlight/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
7
7
  flutter/flet_flashlight/README.md,sha256=OCxLYGKGbpyTQOxMCbVoxLjrY1pdVVGGxtp0OBx23IA,70
8
8
  flutter/flet_flashlight/analysis_options.yaml,sha256=tNXU6s4EJ4KmXROObwPetH5vkzRTVG4AH4gpMw85_EY,154
9
- flutter/flet_flashlight/pubspec.lock,sha256=E4xyDSVnyIxklvHeLaTR0BFwqJ1IOPZllAo1BsXxddk,23059
9
+ flutter/flet_flashlight/pubspec.lock,sha256=OTEgjNKwiyNMe_TMZ9ASBxAh4YAWKqNO4BL4w6bkfFU,23519
10
10
  flutter/flet_flashlight/pubspec.yaml,sha256=RIBc9yNy9daBOTJLCYnfKddIkweyN7i9huwN2vHbFkc,529
11
11
  flutter/flet_flashlight/lib/flet_flashlight.dart,sha256=66hr4Shizat1MIyu957NiJI_xXYOSeOJbFI489qw7ok,70
12
12
  flutter/flet_flashlight/lib/src/extension.dart,sha256=hAXduLLxlX9YmQYcYO8O-dXN7QEybmM2OiRScUUZOXE,314
13
13
  flutter/flet_flashlight/lib/src/flashlight.dart,sha256=WnUQo7IcXmEAeQDZnhwEgizU4AinxzJ_SLSTfGszIe0,3453
14
- flet_flashlight-0.2.0.dev42.dist-info/METADATA,sha256=rf6nER2IZmzfh15Zi7fn89lcjMeZfpJ3LLN7913yaPU,1963
15
- flet_flashlight-0.2.0.dev42.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
- flet_flashlight-0.2.0.dev42.dist-info/top_level.txt,sha256=C3-VxFNdp8KnPIGb_CRsg2BPEtDQN0NEcbotjs3cUv4,24
17
- flet_flashlight-0.2.0.dev42.dist-info/RECORD,,
14
+ flet_flashlight-0.2.0.dev504.dist-info/METADATA,sha256=2Iub9xP2FraV0gvwPLkztszCbDtNX4Q_yh3DaZ6jd-o,2029
15
+ flet_flashlight-0.2.0.dev504.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ flet_flashlight-0.2.0.dev504.dist-info/top_level.txt,sha256=C3-VxFNdp8KnPIGb_CRsg2BPEtDQN0NEcbotjs3cUv4,24
17
+ flet_flashlight-0.2.0.dev504.dist-info/RECORD,,
@@ -13,10 +13,10 @@ packages:
13
13
  dependency: transitive
14
14
  description:
15
15
  name: async
16
- sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
16
+ sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
17
17
  url: "https://pub.dev"
18
18
  source: hosted
19
- version: "2.12.0"
19
+ version: "2.13.0"
20
20
  boolean_selector:
21
21
  dependency: transitive
22
22
  description:
@@ -65,6 +65,14 @@ packages:
65
65
  url: "https://pub.dev"
66
66
  source: hosted
67
67
  version: "3.0.6"
68
+ dbus:
69
+ dependency: transitive
70
+ description:
71
+ name: dbus
72
+ sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c"
73
+ url: "https://pub.dev"
74
+ source: hosted
75
+ version: "0.7.11"
68
76
  device_info_plus:
69
77
  dependency: transitive
70
78
  description:
@@ -93,10 +101,10 @@ packages:
93
101
  dependency: transitive
94
102
  description:
95
103
  name: fake_async
96
- sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
104
+ sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
97
105
  url: "https://pub.dev"
98
106
  source: hosted
99
- version: "1.3.2"
107
+ version: "1.3.3"
100
108
  ffi:
101
109
  dependency: transitive
102
110
  description:
@@ -117,16 +125,16 @@ packages:
117
125
  dependency: transitive
118
126
  description:
119
127
  name: file_picker
120
- sha256: ef9908739bdd9c476353d6adff72e88fd00c625f5b959ae23f7567bd5137db0a
128
+ sha256: e7e16c9d15c36330b94ca0e2ad8cb61f93cd5282d0158c09805aed13b5452f22
121
129
  url: "https://pub.dev"
122
130
  source: hosted
123
- version: "10.2.0"
131
+ version: "10.3.2"
124
132
  flet:
125
133
  dependency: "direct main"
126
134
  description:
127
135
  path: "packages/flet"
128
136
  ref: main
129
- resolved-ref: cf8823c5d766ea7866480986aa3ee871f4091e78
137
+ resolved-ref: "27cea68736639eff49200813838bba3b2bd4e2b0"
130
138
  url: "https://github.com/flet-dev/flet.git"
131
139
  source: git
132
140
  version: "0.70.0"
@@ -168,10 +176,10 @@ packages:
168
176
  dependency: transitive
169
177
  description:
170
178
  name: flutter_plugin_android_lifecycle
171
- sha256: f948e346c12f8d5480d2825e03de228d0eb8c3a737e4cdaa122267b89c022b5e
179
+ sha256: "6382ce712ff69b0f719640ce957559dde459e55ecd433c767e06d139ddf16cab"
172
180
  url: "https://pub.dev"
173
181
  source: hosted
174
- version: "2.0.28"
182
+ version: "2.0.29"
175
183
  flutter_svg:
176
184
  dependency: transitive
177
185
  description:
@@ -218,10 +226,10 @@ packages:
218
226
  dependency: transitive
219
227
  description:
220
228
  name: intl
221
- sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
229
+ sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
222
230
  url: "https://pub.dev"
223
231
  source: hosted
224
- version: "0.19.0"
232
+ version: "0.20.2"
225
233
  json_annotation:
226
234
  dependency: transitive
227
235
  description:
@@ -234,26 +242,26 @@ packages:
234
242
  dependency: transitive
235
243
  description:
236
244
  name: leak_tracker
237
- sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
245
+ sha256: "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0"
238
246
  url: "https://pub.dev"
239
247
  source: hosted
240
- version: "10.0.8"
248
+ version: "11.0.1"
241
249
  leak_tracker_flutter_testing:
242
250
  dependency: transitive
243
251
  description:
244
252
  name: leak_tracker_flutter_testing
245
- sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
253
+ sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
246
254
  url: "https://pub.dev"
247
255
  source: hosted
248
- version: "3.0.9"
256
+ version: "3.0.10"
249
257
  leak_tracker_testing:
250
258
  dependency: transitive
251
259
  description:
252
260
  name: leak_tracker_testing
253
- sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
261
+ sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
254
262
  url: "https://pub.dev"
255
263
  source: hosted
256
- version: "3.0.1"
264
+ version: "3.0.2"
257
265
  lints:
258
266
  dependency: transitive
259
267
  description:
@@ -354,10 +362,10 @@ packages:
354
362
  dependency: transitive
355
363
  description:
356
364
  name: path_provider_foundation
357
- sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942"
365
+ sha256: "16eef174aacb07e09c351502740fa6254c165757638eba1e9116b0a781201bbd"
358
366
  url: "https://pub.dev"
359
367
  source: hosted
360
- version: "2.4.1"
368
+ version: "2.4.2"
361
369
  path_provider_linux:
362
370
  dependency: transitive
363
371
  description:
@@ -410,10 +418,10 @@ packages:
410
418
  dependency: transitive
411
419
  description:
412
420
  name: provider
413
- sha256: "4abbd070a04e9ddc287673bf5a030c7ca8b685ff70218720abab8b092f53dd84"
421
+ sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272"
414
422
  url: "https://pub.dev"
415
423
  source: hosted
416
- version: "6.1.5"
424
+ version: "6.1.5+1"
417
425
  screen_retriever:
418
426
  dependency: transitive
419
427
  description:
@@ -454,14 +462,22 @@ packages:
454
462
  url: "https://pub.dev"
455
463
  source: hosted
456
464
  version: "0.2.0"
465
+ screenshot:
466
+ dependency: transitive
467
+ description:
468
+ name: screenshot
469
+ sha256: "63817697a7835e6ce82add4228e15d233b74d42975c143ad8cfe07009fab866b"
470
+ url: "https://pub.dev"
471
+ source: hosted
472
+ version: "3.0.0"
457
473
  sensors_plus:
458
474
  dependency: transitive
459
475
  description:
460
476
  name: sensors_plus
461
- sha256: "905282c917c6bb731c242f928665c2ea15445aa491249dea9d98d7c79dc8fd39"
477
+ sha256: "89e2bfc3d883743539ce5774a2b93df61effde40ff958ecad78cd66b1a8b8d52"
462
478
  url: "https://pub.dev"
463
479
  source: hosted
464
- version: "6.1.1"
480
+ version: "6.1.2"
465
481
  sensors_plus_platform_interface:
466
482
  dependency: transitive
467
483
  description:
@@ -482,10 +498,10 @@ packages:
482
498
  dependency: transitive
483
499
  description:
484
500
  name: shared_preferences_android
485
- sha256: "20cbd561f743a342c76c151d6ddb93a9ce6005751e7aa458baad3858bfbfb6ac"
501
+ sha256: "5bcf0772a761b04f8c6bf814721713de6f3e5d9d89caf8d3fe031b02a342379e"
486
502
  url: "https://pub.dev"
487
503
  source: hosted
488
- version: "2.4.10"
504
+ version: "2.4.11"
489
505
  shared_preferences_foundation:
490
506
  dependency: transitive
491
507
  description:
@@ -575,10 +591,10 @@ packages:
575
591
  dependency: transitive
576
592
  description:
577
593
  name: test_api
578
- sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
594
+ sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
579
595
  url: "https://pub.dev"
580
596
  source: hosted
581
- version: "0.7.4"
597
+ version: "0.7.6"
582
598
  torch_light:
583
599
  dependency: "direct main"
584
600
  description:
@@ -607,18 +623,18 @@ packages:
607
623
  dependency: transitive
608
624
  description:
609
625
  name: url_launcher_android
610
- sha256: "8582d7f6fe14d2652b4c45c9b6c14c0b678c2af2d083a11b604caeba51930d79"
626
+ sha256: "0aedad096a85b49df2e4725fa32118f9fa580f3b14af7a2d2221896a02cd5656"
611
627
  url: "https://pub.dev"
612
628
  source: hosted
613
- version: "6.3.16"
629
+ version: "6.3.17"
614
630
  url_launcher_ios:
615
631
  dependency: transitive
616
632
  description:
617
633
  name: url_launcher_ios
618
- sha256: "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb"
634
+ sha256: d80b3f567a617cb923546034cc94bfe44eb15f989fe670b37f26abdb9d939cb7
619
635
  url: "https://pub.dev"
620
636
  source: hosted
621
- version: "6.3.3"
637
+ version: "6.3.4"
622
638
  url_launcher_linux:
623
639
  dependency: transitive
624
640
  description:
@@ -631,10 +647,10 @@ packages:
631
647
  dependency: transitive
632
648
  description:
633
649
  name: url_launcher_macos
634
- sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2"
650
+ sha256: c043a77d6600ac9c38300567f33ef12b0ef4f4783a2c1f00231d2b1941fea13f
635
651
  url: "https://pub.dev"
636
652
  source: hosted
637
- version: "3.2.2"
653
+ version: "3.2.3"
638
654
  url_launcher_platform_interface:
639
655
  dependency: transitive
640
656
  description:
@@ -679,26 +695,26 @@ packages:
679
695
  dependency: transitive
680
696
  description:
681
697
  name: vector_graphics_compiler
682
- sha256: "557a315b7d2a6dbb0aaaff84d857967ce6bdc96a63dc6ee2a57ce5a6ee5d3331"
698
+ sha256: ca81fdfaf62a5ab45d7296614aea108d2c7d0efca8393e96174bf4d51e6725b0
683
699
  url: "https://pub.dev"
684
700
  source: hosted
685
- version: "1.1.17"
701
+ version: "1.1.18"
686
702
  vector_math:
687
703
  dependency: transitive
688
704
  description:
689
705
  name: vector_math
690
- sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
706
+ sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
691
707
  url: "https://pub.dev"
692
708
  source: hosted
693
- version: "2.1.4"
709
+ version: "2.2.0"
694
710
  vm_service:
695
711
  dependency: transitive
696
712
  description:
697
713
  name: vm_service
698
- sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
714
+ sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60"
699
715
  url: "https://pub.dev"
700
716
  source: hosted
701
- version: "14.3.1"
717
+ version: "15.0.2"
702
718
  web:
703
719
  dependency: transitive
704
720
  description:
@@ -727,10 +743,10 @@ packages:
727
743
  dependency: transitive
728
744
  description:
729
745
  name: win32
730
- sha256: "329edf97fdd893e0f1e3b9e88d6a0e627128cc17cc316a8d67fda8f1451178ba"
746
+ sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03"
731
747
  url: "https://pub.dev"
732
748
  source: hosted
733
- version: "5.13.0"
749
+ version: "5.14.0"
734
750
  win32_registry:
735
751
  dependency: transitive
736
752
  description:
@@ -772,5 +788,5 @@ packages:
772
788
  source: hosted
773
789
  version: "6.5.0"
774
790
  sdks:
775
- dart: ">=3.7.0 <4.0.0"
791
+ dart: ">=3.8.0 <4.0.0"
776
792
  flutter: ">=3.29.0"