Skip to content

Commit d88e508

Browse files
feat: add text align
1 parent 60e97d9 commit d88e508

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ CircularCountDownTimer(
3030
strokeCap: StrokeCap.round,
3131
textStyle: TextStyle(
3232
fontSize: 33.0, color: Colors.white, fontWeight: FontWeight.bold),
33+
textAlign: TextAlign.center,
3334
textFormat: CountdownTextFormat.S,
3435
isReverse: false,
3536
isReverseAnimation: false,

example/example.dart

+3
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ class _MyHomePageState extends State<MyHomePage> {
8686
fontWeight: FontWeight.bold,
8787
),
8888

89+
// Text Align for Countdown Text.
90+
textAlign: TextAlign.justify,
91+
8992
// Format for the Countdown Text.
9093
textFormat: CountdownTextFormat.S,
9194

lib/circular_countdown_timer.dart

+5
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ class CircularCountDownTimer extends StatefulWidget {
5656
/// Text Style for Countdown Text.
5757
final TextStyle? textStyle;
5858

59+
/// Text Align for Countdown Text.
60+
final TextAlign textAlign;
61+
5962
/// Format for the Countdown Text.
6063
final String? textFormat;
6164

@@ -104,6 +107,7 @@ class CircularCountDownTimer extends StatefulWidget {
104107
this.strokeWidth = 5.0,
105108
this.strokeCap = StrokeCap.butt,
106109
this.textStyle,
110+
this.textAlign = TextAlign.left,
107111
super.key,
108112
this.isTimerTextShown = true,
109113
this.autoStart = true,
@@ -307,6 +311,7 @@ class CircularCountDownTimerState extends State<CircularCountDownTimer>
307311
fontSize: 16.0,
308312
color: Colors.black,
309313
),
314+
textAlign: widget.textAlign,
310315
),
311316
)
312317
: Container(),

0 commit comments

Comments
 (0)