JackJonson / flutter_styled_toast

A Styled Toast Flutter package.
Apache License 2.0
76 stars 43 forks source link

Selection Handle Color #35

Open TEGRAXD opened 9 months ago

TEGRAXD commented 9 months ago

I'm having an issue that using styled toast globally, this widget changing selection handle (droplet-like shape cursor under selected text) color that does not match with app theme. Yet StyledToast does not have option to changing its theme.

return StyledToast(
      locale: const Locale('en', 'US'),
      toastAnimation: StyledToastAnimation.slideFromTopFade,
      reverseAnimation: StyledToastAnimation.slideToTopFade,
      animDuration: const Duration(milliseconds: 350),
      duration: const Duration(milliseconds: 2500),
      child: MaterialApp(
      // ...
);

While changing textSelectionTheme or cupertinoOverrideTheme in ThemeData.textSelectionTheme will not fix this issue.

theme: ThemeData(
          colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
          textSelectionTheme: TextSelectionThemeData(
            // ...
            selectionHandleColor: Colors.red,
          ),
          cupertinoOverrideTheme: CupertinoThemeData(
            primaryColor: Colors.red,
          ),
        ),
        // ...

Expected Output

Color of the selection handle match with app theme color. (Dark blue)

Actual Output

Color of the selection handle changed to purple. image