Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
change text direction to layout direction
  • Loading branch information
bparrishMines committed Aug 17, 2021
commit be87b94172a1ad4f434f748b71c6eba75f67b747
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class GoogleMap extends StatefulWidget {
this.tiltGesturesEnabled = true,
this.myLocationEnabled = false,
this.myLocationButtonEnabled = true,
this.textDirection,
this.layoutDirection,

/// If no padding is specified default padding will be 0.
this.padding = const EdgeInsets.all(0),
Expand Down Expand Up @@ -101,11 +101,11 @@ class GoogleMap extends StatefulWidget {
/// Type of map tiles to be rendered.
final MapType mapType;

/// The text direction to use for the embedded view.
/// The layout direction to use for the embedded view.
///
/// If this is null, the ambient [Directionality] is used instead. If there is
/// no ambient [Directionality], [TextDirection.ltr] is used.
final TextDirection? textDirection;
final TextDirection? layoutDirection;

/// Preferred bounds for the camera zoom level.
///
Expand Down Expand Up @@ -260,7 +260,7 @@ class _GoogleMapState extends State<GoogleMap> {
return GoogleMapsFlutterPlatform.instance.buildViewWithTextDirection(
_mapId,
onPlatformViewCreated,
textDirection: widget.textDirection ??
textDirection: widget.layoutDirection ??
Directionality.maybeOf(context) ??
Copy link
Contributor Author

@bparrishMines bparrishMines Aug 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may return null if there is no Directionality ancestor. This was the case with one of the tests, so I also added a default TextDirection.ltr.

TextDirection.ltr,
initialCameraPosition: widget.initialCameraPosition,
Expand Down