Content-Length: 250191 | pFad | http://github.com/aagarwal1012/Animated-Text-Kit/issues/361

74 Text not aligning to center properly with AnimatedTextKit and DefaultTextStyle · Issue #361 · aagarwal1012/Animated-Text-Kit · GitHub
Skip to content

Text not aligning to center properly with AnimatedTextKit and DefaultTextStyle #361

@echo-shahzad

Description

@echo-shahzad

I'm encountering an issue with aligning text to the center when using the AnimatedTextKit widget along with the DefaultTextStyle widget in Flutter. Despite specifying textAlign: TextAlign.center in DefaultTextStyle, the text isn't being aligned in the center of the widget.

Steps to Reproduce:

  • Wrap an AnimatedTextKit widget inside DefaultTextStyle with textAlign: TextAlign.center.
  • Set the style of the DefaultTextStyle and use TyperAnimatedText as one of the animated texts.
  • The text appears misaligned or not centered as expected.
DefaultTextStyle(
  textAlign: TextAlign.center,
  style: contentTextStyle ??
      AppTextStyle.kInter19x400.copyWith(
        fontSize: 20.sp,
        color: Colors.white,
      ),
  child: AnimatedTextKit(
    isRepeatingAnimation: false,
    animatedTexts: [
      TyperAnimatedText(
        "${controller.chats[index].content?.toLowerCase()}",
        speed: const Duration(
          milliseconds: 30,
        ),
      ),
    ],
  ),
),

Expected Behavior:
The text should be properly centered within the AnimatedTextKit widget, respecting the textAlign: TextAlign.center property.

Actual Behavior:
The text is not aligned to the center as expected, even with textAlign: TextAlign.center set in the DefaultTextStyle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: http://github.com/aagarwal1012/Animated-Text-Kit/issues/361

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy