-
Notifications
You must be signed in to change notification settings - Fork 28.6k
StarBorder does not lerp to Oval #108707
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
Comments
Hi @bernaferrari, Thanks for filing the issue. Can you please share a code sample or confirm if this code sample is right? import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Material(
child: SizedBox(
height: 100,
width: 100,
child: Container(
alignment: Alignment.center,
decoration: ShapeDecoration(
color: Colors.white,
shape: StarBorder(
side: BorderSide(
color: Colors.yellow.withOpacity(0.5), width: 10),
).lerpTo(
RoundedRectangleBorder(
side: BorderSide(
color: Colors.red.withOpacity(0.5), width: 10)),
0.5)!),
),
),
));
}
}
|
I knew by the time I went to answer this, there would be a PR already. Nice work @gspencergoog! lol |
Yes, seems like a great sample @maheshmnj. Thanks! |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Uh oh!
There was an error while loading. Please reload this page.
The new StarBorder has a genius 2-3 step lerp for most shapes, except Circle, where it works well except when
eccentricity != 0
. I think it was forgotten in the implementation, as Oval is only a few weeks old. I propose adding the 2-way lerp to circle, so oval works. cc @gspencergoogRelated: in the upcoming
BoderSide.only
PR, which may or may not be accepted, Star -> Circle is the only lerp that doesn't work, as it draws a path all the time. The other shapes draw a path until 50%, then their shape until 100%, so lerp is good (not great, might need a few fixes). I see two potential solutions:If you fix oval only, in a hypothetical future, we might need to do
if (multiBorder) 2-step lerp
for circle, which is also fine. Just telling you the plan.Screen.Recording.2022-07-31.at.17.45.57.mov
Simple sample:
The text was updated successfully, but these errors were encountered: