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

My widget looks like this in 2.0.2: #36

Open
apgapg opened this issue Dec 21, 2023 · 1 comment
Open

My widget looks like this in 2.0.2: #36

apgapg opened this issue Dec 21, 2023 · 1 comment
Assignees

Comments

@apgapg
Copy link
Owner

apgapg commented Dec 21, 2023

          My widget looks like this in 2.0.2:
AvatarGlow(
     glowColor: const Color.fromARGB(255,69, 4,129),
     endRadius: 50.0,
     duration: const Duration(milliseconds: 2000),
     repeat: true,
     showTwoGlows:true,
     animate: false,
     startDelay: const Duration( milliseconds: 100),
     child: InkWell(
             child: SizedBox(
                  width: min(70 * chargingStationController.ratio.value, 70 / chargingStationController.scaleValue.value),
                  height: min(70 * chargingStationController.ratio.value, 70 / chargingStationController.scaleValue.value),
                  child: Stack(children: [
                              const CustomSvgAsset(  menuSvgPath.backgroundMap,  ),
                              CustomSvgAsset(  getIcon(spaceMap.spaceUse),  color: getColor(spaceMap),  ),
                                 ], )),
              onTap: () {})),

So basically it's an AvatarGlow with SvgPicture.asset (from 'package:flutter_svg/flutter_svg.dart') as child.
When animate is set to false, it shows "only" the svg without any painting around it.
When animate is set to true, it shows the svg with the expected glow effect.

Now, in 3.0.1, my widget looked like this :

AvatarGlow(
     glowColor: const Color.fromARGB(255,69, 4,129),
     duration: const Duration(milliseconds: 2000),
     repeat: true,
     glowCount:2,
     animate: false,
     child: InkWell(
             child: SizedBox(
                  width: min(70 * chargingStationController.ratio.value, 70 / chargingStationController.scaleValue.value),
                  height: min(70 * chargingStationController.ratio.value, 70 / chargingStationController.scaleValue.value),
                  child: Stack(children: [
                              const CustomSvgAsset(  menuSvgPath.backgroundMap,  ),
                              CustomSvgAsset(  getIcon(spaceMap.spaceUse),  color: getColor(spaceMap),  ),
                                 ], )),
              onTap: () {})),

Now, when animate is set to false, it shows the svg with a circle around it painted in glowColor.
When animate is set to true, it shows the svg with the expected glow effect.

Another issue with 3.0.1 is that destroys the position of the widget when put in Stack.

In fact, my main widget is a constrained InteractiveViewer with Center as child, then Stack with background image as a first child and then X Positionned widget with AvatarGlow as child. In 2.0.2 the widget are displayed at the expected position. In 3.0.1 there are not anymore. I could maybe dive more into it to make it work but that mean i would have to refactor a lot and don't have much time, so i keep 2.0.2 for now.

SizedBox(child : 
  InteractiveViewer(child : 
    Center(child:
      Stack(children : [
        Image(),
        Positionned(child:AvatarGlow(....)),
        Positionned(child:AvatarGlow(....)),
        Positionned(child:AvatarGlow(....)),
      ])
    )
  )
)
IMG_20231221_132114 1 IMG_20231221_133148 1

First image (on left) is 2.0.2
Second image (on right) is 3.0.1

Same AvatarGlow are animated, you can see the Widget are not on the good position.
Non animated AvatarGlow have a static circle painted around it.

I think my case is really special with the positionned thing. But the circle painted when non animated should touch more user.

Originally posted by @Fourchettedev in #21 (comment)

@apgapg apgapg self-assigned this Dec 21, 2023
@Albertbol
Copy link

Same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants