Releases: khlebobul/use_scramble
Releases · khlebobul/use_scramble
v 0.0.10
- Refactored the
TextScramblewidget:- Removed the
styleandtextAlignproperties. - Added a required
builder: (BuildContext, String) => Widgetproperty. This allows users to define their own rendering logic for the displayed text, providing greater flexibility in customizing its appearance. Text styling and alignment should now be implemented within thebuilderfunction.
- Removed the
TextScramble(
text: 'Hello World!',
speed: Duration(milliseconds: 50),
chars: '!<>-_\\/[]{}—=+*^?#________',
correctCharProbability: 0.1, // Correct character probability in [0, 1]
scrambleCycles: 4, // Number of times to scramble the text
builder: (context, scrambledText) {
// Use the builder to define how the text is displayed
return Text(
scrambledText,
textAlign: TextAlign.center, // Text alignment is now within the builder
style: TextStyle( // Text style is now within the builder
fontSize: 40,
color: Colors.green,
fontFamily: 'JetBrainsMono',
),
);
},
),This change enhances the widget's flexibility by decoupling the scrambling logic from the text rendering, enabling users to use any widget to display the scrambled text.
Thanks eibaan for the recommendations
v 0.0.8
v 0.0.7
- Add
textAlignparameter
TextScramble(
text: 'Hello World!',
speed: Duration(milliseconds: 50),
chars: '!<>-_\\/[]{}—=+*^?#________',
correctCharProbability: 0.1, // Correct character probability in [0, 1]
scrambleCycles: 4, // Number of times to scramble the text
textAlign: TextAlign.center, // Optional text alignment
style: TextStyle(
fontSize: 40,
color: Colors.green,
fontFamily: 'JetBrainsMono',
),
),