how to add border radius to google maps in flutter?
I added a google map widget into a container with a border radius but google maps corners not rounded .
Container(
height: 100,
width: double.infinity,
margin: EdgeInsets.only(left: 30, right: 30),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
border: Border.all(
style: BorderStyle.solid,
),
),
child: GoogleMap(),)
flutter flutter-layout
add a comment |
I added a google map widget into a container with a border radius but google maps corners not rounded .
Container(
height: 100,
width: double.infinity,
margin: EdgeInsets.only(left: 30, right: 30),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
border: Border.all(
style: BorderStyle.solid,
),
),
child: GoogleMap(),)
flutter flutter-layout
add a comment |
I added a google map widget into a container with a border radius but google maps corners not rounded .
Container(
height: 100,
width: double.infinity,
margin: EdgeInsets.only(left: 30, right: 30),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
border: Border.all(
style: BorderStyle.solid,
),
),
child: GoogleMap(),)
flutter flutter-layout
I added a google map widget into a container with a border radius but google maps corners not rounded .
Container(
height: 100,
width: double.infinity,
margin: EdgeInsets.only(left: 30, right: 30),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
border: Border.all(
style: BorderStyle.solid,
),
),
child: GoogleMap(),)
Container(
height: 100,
width: double.infinity,
margin: EdgeInsets.only(left: 30, right: 30),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
border: Border.all(
style: BorderStyle.solid,
),
),
child: GoogleMap(),)
Container(
height: 100,
width: double.infinity,
margin: EdgeInsets.only(left: 30, right: 30),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
border: Border.all(
style: BorderStyle.solid,
),
),
child: GoogleMap(),)
flutter flutter-layout
flutter flutter-layout
edited Dec 29 '18 at 19:24
a7me63azza8
asked Dec 29 '18 at 19:05
a7me63azza8a7me63azza8
237
237
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
probably an expensive solution but you could use ClipRRect
. Something like this:
Widget build(BuildContext context) {
return Center(
child: ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
bottomRight: Radius.circular(30),
bottomLeft: Radius.circular(30),
),
child: Align(
alignment: Alignment.bottomRight,
heightFactor: 0.3,
widthFactor: 2.5,
child: GoogleMap(),
),
),
);
}
if you're happy with the answer you should mark it correct and up vote it,,thanks
– flutter
Dec 30 '18 at 16:23
Hmm doing this doesn't seem to work for me. I am still left with a rectangular google maps
– john.zli
Jan 20 at 5:39
add a comment |
Keep in mind that the google_maps_flutter
plugin is only a developer preview. I'm sure a lot more work will be added to this before they release version 1.0. So don't stress too much about missing features. File tickets. :)
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53972558%2fhow-to-add-border-radius-to-google-maps-in-flutter%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
probably an expensive solution but you could use ClipRRect
. Something like this:
Widget build(BuildContext context) {
return Center(
child: ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
bottomRight: Radius.circular(30),
bottomLeft: Radius.circular(30),
),
child: Align(
alignment: Alignment.bottomRight,
heightFactor: 0.3,
widthFactor: 2.5,
child: GoogleMap(),
),
),
);
}
if you're happy with the answer you should mark it correct and up vote it,,thanks
– flutter
Dec 30 '18 at 16:23
Hmm doing this doesn't seem to work for me. I am still left with a rectangular google maps
– john.zli
Jan 20 at 5:39
add a comment |
probably an expensive solution but you could use ClipRRect
. Something like this:
Widget build(BuildContext context) {
return Center(
child: ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
bottomRight: Radius.circular(30),
bottomLeft: Radius.circular(30),
),
child: Align(
alignment: Alignment.bottomRight,
heightFactor: 0.3,
widthFactor: 2.5,
child: GoogleMap(),
),
),
);
}
if you're happy with the answer you should mark it correct and up vote it,,thanks
– flutter
Dec 30 '18 at 16:23
Hmm doing this doesn't seem to work for me. I am still left with a rectangular google maps
– john.zli
Jan 20 at 5:39
add a comment |
probably an expensive solution but you could use ClipRRect
. Something like this:
Widget build(BuildContext context) {
return Center(
child: ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
bottomRight: Radius.circular(30),
bottomLeft: Radius.circular(30),
),
child: Align(
alignment: Alignment.bottomRight,
heightFactor: 0.3,
widthFactor: 2.5,
child: GoogleMap(),
),
),
);
}
probably an expensive solution but you could use ClipRRect
. Something like this:
Widget build(BuildContext context) {
return Center(
child: ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
bottomRight: Radius.circular(30),
bottomLeft: Radius.circular(30),
),
child: Align(
alignment: Alignment.bottomRight,
heightFactor: 0.3,
widthFactor: 2.5,
child: GoogleMap(),
),
),
);
}
edited Dec 29 '18 at 20:56
answered Dec 29 '18 at 20:49
flutterflutter
4223821
4223821
if you're happy with the answer you should mark it correct and up vote it,,thanks
– flutter
Dec 30 '18 at 16:23
Hmm doing this doesn't seem to work for me. I am still left with a rectangular google maps
– john.zli
Jan 20 at 5:39
add a comment |
if you're happy with the answer you should mark it correct and up vote it,,thanks
– flutter
Dec 30 '18 at 16:23
Hmm doing this doesn't seem to work for me. I am still left with a rectangular google maps
– john.zli
Jan 20 at 5:39
if you're happy with the answer you should mark it correct and up vote it,,thanks
– flutter
Dec 30 '18 at 16:23
if you're happy with the answer you should mark it correct and up vote it,,thanks
– flutter
Dec 30 '18 at 16:23
Hmm doing this doesn't seem to work for me. I am still left with a rectangular google maps
– john.zli
Jan 20 at 5:39
Hmm doing this doesn't seem to work for me. I am still left with a rectangular google maps
– john.zli
Jan 20 at 5:39
add a comment |
Keep in mind that the google_maps_flutter
plugin is only a developer preview. I'm sure a lot more work will be added to this before they release version 1.0. So don't stress too much about missing features. File tickets. :)
add a comment |
Keep in mind that the google_maps_flutter
plugin is only a developer preview. I'm sure a lot more work will be added to this before they release version 1.0. So don't stress too much about missing features. File tickets. :)
add a comment |
Keep in mind that the google_maps_flutter
plugin is only a developer preview. I'm sure a lot more work will be added to this before they release version 1.0. So don't stress too much about missing features. File tickets. :)
Keep in mind that the google_maps_flutter
plugin is only a developer preview. I'm sure a lot more work will be added to this before they release version 1.0. So don't stress too much about missing features. File tickets. :)
answered Jan 1 at 0:23
Randal SchwartzRandal Schwartz
21k22950
21k22950
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53972558%2fhow-to-add-border-radius-to-google-maps-in-flutter%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown