Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map Control #3093

Merged
merged 37 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7729bb3
Map: initial commit
ndonkoHenri Apr 23, 2024
4a779ad
SafeArea: deprecate minimum and rename to minimum_padding
ndonkoHenri Apr 23, 2024
436df3f
parseDoubleFromJson, parseIntFromJson, parseBoolFromJson
ndonkoHenri Apr 24, 2024
0e05af0
parseColorFromJson
ndonkoHenri Apr 24, 2024
0731446
Map utils: parseMapOptions, parseMapChildren
ndonkoHenri Apr 24, 2024
7ec3193
Map: MapOption, MapTileLayer
ndonkoHenri Apr 24, 2024
23b9ce0
RichAttribution: initial commit
ndonkoHenri Apr 25, 2024
9dd3e53
TextSourceAttribution: initial commit
ndonkoHenri Apr 25, 2024
695eae4
MapTileLayer: separate from map
ndonkoHenri Apr 25, 2024
06b215b
Map: update create_control.dart
ndonkoHenri Apr 25, 2024
be3c1d0
alignment utils: add defValue
ndonkoHenri Apr 28, 2024
f033449
Stack: create before_update()
ndonkoHenri Apr 28, 2024
4a51563
MapSimpleAttribution: initial commit
ndonkoHenri Apr 28, 2024
d615e40
MapRichAttribution: renamed
ndonkoHenri Apr 28, 2024
50bdfab
MapCircleLayer: initial commit
ndonkoHenri Apr 28, 2024
17828b6
MapMarkerLayer: initial commit
ndonkoHenri Apr 28, 2024
150537a
MapTileLayer: update props
ndonkoHenri Apr 28, 2024
c9d3ed3
MapTextSourceAttribution: renamed
ndonkoHenri Apr 28, 2024
a55ba78
Cleanup
ndonkoHenri Apr 28, 2024
1238766
MapOption: renamed to MapConfiguration
ndonkoHenri Apr 28, 2024
c3cf4d3
Create map module
ndonkoHenri Apr 29, 2024
bcc9608
TileLayer: error_image_src, on_image_error
ndonkoHenri Apr 29, 2024
072a2e5
MapConfiguration: implemented as control separate module
ndonkoHenri Apr 30, 2024
f0f31ff
MapEventSource enum
ndonkoHenri Apr 30, 2024
6fa464a
rename point to location
ndonkoHenri Apr 30, 2024
95345e9
Merge branch 'main' into map
ndonkoHenri Apr 30, 2024
a203d61
Merge branch 'main' into map
ndonkoHenri May 1, 2024
5eb46d3
rename Circle to CircleMarker, add docstrings, remove opacity
ndonkoHenri May 1, 2024
34fb8d5
remove parseIntFromJson, parseBoolFromJson, parseDoubleFromJson
ndonkoHenri May 8, 2024
c181e4b
MapInteractionConfiguration and parseInteractionOptions
ndonkoHenri May 8, 2024
4baf36e
add default values
ndonkoHenri May 8, 2024
9f4fb83
TileLayer: enable_retina_mode, tile_bounds, evict_error_tile_strategy…
ndonkoHenri May 9, 2024
5ae4c2e
MapInteractionConfiguration: flags, rotation_win_gestures, pinch_move…
ndonkoHenri May 9, 2024
d953536
move StrokeCap to types.py | create StrokeJoin
ndonkoHenri May 9, 2024
f53bf0e
implement Polyline* and Polygon*
ndonkoHenri May 9, 2024
6aa1cce
Merge branch 'main' into map
ndonkoHenri May 9, 2024
d8a2acd
Bump deps
FeodorFitsner May 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions client/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ PODS:
- record_darwin (1.0.0):
- Flutter
- FlutterMacOS
- rive_common (0.0.1):
- Flutter
- screen_brightness_ios (0.1.0):
- Flutter
- SDWebImage (5.13.2):
Expand Down Expand Up @@ -83,6 +85,7 @@ DEPENDENCIES:
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- record_darwin (from `.symlinks/plugins/record_darwin/ios`)
- rive_common (from `.symlinks/plugins/rive_common/ios`)
- screen_brightness_ios (from `.symlinks/plugins/screen_brightness_ios/ios`)
- sensors_plus (from `.symlinks/plugins/sensors_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
Expand Down Expand Up @@ -119,6 +122,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
record_darwin:
:path: ".symlinks/plugins/record_darwin/ios"
rive_common:
:path: ".symlinks/plugins/rive_common/ios"
screen_brightness_ios:
:path: ".symlinks/plugins/screen_brightness_ios/ios"
sensors_plus:
Expand Down Expand Up @@ -147,6 +152,7 @@ SPEC CHECKSUMS:
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
record_darwin: 1f6619f2abac4d1ca91d3eeab038c980d76f1517
rive_common: c537b4eed761e903a9403d93c347b69bd7a4762f
screen_brightness_ios: 715ca807df953bf676d339f11464e438143ee625
SDWebImage: 72f86271a6f3139cc7e4a89220946489d4b9a866
sensors_plus: 42b9de1b8237675fa8d8121e4bb93be0f79fa61d
Expand Down
3 changes: 3 additions & 0 deletions client/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flet_audio/flet_audio.dart' as flet_audio;
import 'package:flet_audio_recorder/flet_audio_recorder.dart'
as flet_audio_recorder;
import 'package:flet_lottie/flet_lottie.dart' as flet_lottie;
import 'package:flet_map/flet_map.dart' as flet_map;
import 'package:flet_rive/flet_rive.dart' as flet_rive;
import 'package:flet_video/flet_video.dart' as flet_video;
import 'package:flet_webview/flet_webview.dart' as flet_webview;
Expand All @@ -26,6 +27,7 @@ void main([List<String>? args]) async {
flet_audio.ensureInitialized();
flet_audio_recorder.ensureInitialized();
flet_lottie.ensureInitialized();
flet_map.ensureInitialized();
flet_rive.ensureInitialized();
flet_video.ensureInitialized();
flet_webview.ensureInitialized();
Expand Down Expand Up @@ -89,6 +91,7 @@ void main([List<String>? args]) async {
flet_audio.createControl,
flet_audio_recorder.createControl,
flet_lottie.createControl,
flet_map.createControl,
flet_rive.createControl,
flet_video.createControl,
flet_webview.createControl
Expand Down
109 changes: 94 additions & 15 deletions client/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,13 @@ packages:
relative: true
source: path
version: "0.22.1"
flet_map:
dependency: "direct main"
description:
path: "../packages/flet_map"
relative: true
source: path
version: "0.23.0"
flet_rive:
dependency: "direct main"
description:
Expand Down Expand Up @@ -313,6 +320,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_map:
dependency: transitive
description:
name: flutter_map
sha256: cda8d72135b697f519287258b5294a57ce2f2a5ebf234f0e406aad4dc14c9399
url: "https://pub.dev"
source: hosted
version: "6.1.0"
flutter_markdown:
dependency: transitive
description:
Expand Down Expand Up @@ -409,10 +424,10 @@ packages:
dependency: transitive
description:
name: intl
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev"
source: hosted
version: "0.18.1"
version: "0.19.0"
js:
dependency: transitive
description:
Expand All @@ -429,30 +444,38 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.8.1"
latlong2:
dependency: transitive
description:
name: latlong2
sha256: "98227922caf49e6056f91b6c56945ea1c7b166f28ffcd5fb8e72fc0b453cc8fe"
url: "https://pub.dev"
source: hosted
version: "0.9.1"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
version: "10.0.4"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.1"
lints:
dependency: transitive
description:
Expand All @@ -461,6 +484,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.1"
lists:
dependency: transitive
description:
name: lists
sha256: "4ca5c19ae4350de036a7e996cdd1ee39c93ac0a2b840f4915459b7d0a7d4ab27"
url: "https://pub.dev"
source: hosted
version: "1.0.1"
logger:
dependency: transitive
description:
name: logger
sha256: "8c94b8c219e7e50194efc8771cd0e9f10807d8d3e219af473d89b06cc2ee4e04"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
logging:
dependency: transitive
description:
Expand Down Expand Up @@ -577,10 +616,18 @@ packages:
dependency: transitive
description:
name: meta
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
source: hosted
version: "1.12.0"
mgrs_dart:
dependency: transitive
description:
name: mgrs_dart
sha256: fb89ae62f05fa0bb90f70c31fc870bcbcfd516c843fb554452ab3396f78586f7
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "2.0.0"
package_info_plus:
dependency: transitive
description:
Expand Down Expand Up @@ -693,6 +740,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.7.4"
polylabel:
dependency: transitive
description:
name: polylabel
sha256: "41b9099afb2aa6c1730bdd8a0fab1400d287694ec7615dd8516935fa3144214b"
url: "https://pub.dev"
source: hosted
version: "1.0.1"
process:
dependency: transitive
description:
Expand All @@ -701,6 +756,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.0.2"
proj4dart:
dependency: transitive
description:
name: proj4dart
sha256: c8a659ac9b6864aa47c171e78d41bbe6f5e1d7bd790a5814249e6b68bc44324e
url: "https://pub.dev"
source: hosted
version: "2.1.0"
record:
dependency: transitive
description:
Expand Down Expand Up @@ -990,10 +1053,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.7.0"
typed_data:
dependency: transitive
description:
Expand All @@ -1002,6 +1065,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.2"
unicode:
dependency: transitive
description:
name: unicode
sha256: "0f69e46593d65245774d4f17125c6084d2c20b4e473a983f6e21b7d7762218f1"
url: "https://pub.dev"
source: hosted
version: "0.3.1"
universal_platform:
dependency: transitive
description:
Expand Down Expand Up @@ -1134,10 +1205,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
version: "13.0.0"
version: "14.2.1"
volume_controller:
dependency: transitive
description:
Expand Down Expand Up @@ -1242,6 +1313,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.0.3"
wkt_parser:
dependency: transitive
description:
name: wkt_parser
sha256: "8a555fc60de3116c00aad67891bcab20f81a958e4219cc106e3c037aa3937f13"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
xdg_directories:
dependency: transitive
description:
Expand All @@ -1268,4 +1347,4 @@ packages:
version: "3.1.2"
sdks:
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.16.6"
flutter: ">=3.18.0-18.0.pre.54"
2 changes: 2 additions & 0 deletions client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ dependencies:
path: ../packages/flet_audio
flet_lottie:
path: ../packages/flet_lottie
flet_map:
path: ../packages/flet_map
flet_rive:
path: ../packages/flet_rive
flet_audio_recorder:
Expand Down
4 changes: 3 additions & 1 deletion packages/flet/lib/src/controls/safe_area.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class SafeAreaControl extends StatelessWidget {
bottom: control.attrBool("bottom", true)!,
maintainBottomViewPadding:
control.attrBool("maintainBottomViewPadding", false)!,
minimum: parseEdgeInsets(control, "minimum") ?? EdgeInsets.zero,
minimum: parseEdgeInsets(control, "minimumPadding") ??
parseEdgeInsets(control, "minimum") ??
EdgeInsets.zero,
child: contentCtrls.isNotEmpty
? createControl(control, contentCtrls.first.id, disabled,
parentAdaptive: adaptive)
Expand Down
5 changes: 3 additions & 2 deletions packages/flet/lib/src/utils/alignment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ WrapCrossAlignment parseWrapCrossAlignment(
orElse: () => defValue);
}

Alignment? parseAlignment(Control control, String propName) {
Alignment? parseAlignment(Control control, String propName,
[Alignment? defValue]) {
var v = control.attrString(propName, null);
if (v == null) {
return null;
return defValue;
}

final j1 = json.decode(v);
Expand Down
3 changes: 3 additions & 0 deletions packages/flet/lib/src/utils/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,6 @@ MaterialStateProperty<Color?>? parseMaterialStateColor(
return getMaterialStateProperty<Color?>(
j1, (jv) => HexColor.fromString(theme, jv as String), null);
}

Color? parseColorFromJson(ThemeData? theme, [String? colorString = ""]) =>
colorString != null ? HexColor.fromString(theme, colorString ?? "") : null;
65 changes: 30 additions & 35 deletions packages/flet/lib/src/utils/text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,39 +177,34 @@ TextStyle textStyleFromJson(ThemeData theme, Map<String, dynamic> json) {
}

return TextStyle(
fontSize: json["size"] != null ? parseDouble(json["size"]) : null,
fontWeight: fontWeight != null ? getFontWeight(fontWeight) : null,
fontStyle: (json["italic"] != null)
? (parseBool(json["italic"]) ? FontStyle.italic : null)
: null,
fontFamily: json["font_family"],
fontVariations: variations,
height: json["height"] != null ? parseDouble(json["height"]) : null,
decoration:
decorations.isNotEmpty ? TextDecoration.combine(decorations) : null,
decorationStyle: json["decoration_style"] != null
? TextDecorationStyle.values.firstWhereOrNull((v) =>
v.name.toLowerCase() == json["decoration_style"].toLowerCase())
: null,
decorationColor: json["decoration_color"] != null
? HexColor.fromString(theme, json["decoration_color"] ?? "")
: null,
decorationThickness: json["decoration_thickness"] != null
? parseDouble(json["decoration_thickness"])
: null,
color: json["color"] != null
? HexColor.fromString(theme, json["color"] ?? "")
: null,
backgroundColor: json["bgcolor"] != null
? HexColor.fromString(theme, json["bgcolor"] ?? "")
: null,
shadows: json["shadow"] != null
? boxShadowsFromJSON(theme, json["shadow"])
: null,
foreground: json["foreground"] != null
? paintFromJSON(theme, json["foreground"])
: null,
letterSpacing: json['letter_spacing'] != null
? parseDouble(json['letter_spacing'])
: null);
fontSize: json["size"] != null ? parseDouble(json["size"]) : null,
fontWeight: fontWeight != null ? getFontWeight(fontWeight) : null,
fontStyle: (json["italic"] != null)
? (parseBool(json["italic"]) ? FontStyle.italic : null)
: null,
fontFamily: json["font_family"],
fontVariations: variations,
height: json["height"] != null ? parseDouble(json["height"]) : null,
decoration:
decorations.isNotEmpty ? TextDecoration.combine(decorations) : null,
decorationStyle: json["decoration_style"] != null
? TextDecorationStyle.values.firstWhereOrNull((v) =>
v.name.toLowerCase() == json["decoration_style"].toLowerCase())
: null,
decorationColor: parseColorFromJson(theme, json["decoration_color"] ?? ""),
decorationThickness: json["decoration_thickness"] != null
? parseDouble(json["decoration_thickness"])
: null,
color: parseColorFromJson(theme, json["color"]),
backgroundColor: parseColorFromJson(theme, json["bgcolor"] ?? ""),
shadows: json["shadow"] != null
? boxShadowsFromJSON(theme, json["shadow"])
: null,
foreground: json["foreground"] != null
? paintFromJSON(theme, json["foreground"])
: null,
letterSpacing: json['letter_spacing'] != null
? parseDouble(json['letter_spacing'])
: null,
);
}
Loading