Skip to content

Commit e4b81cf

Browse files
committed
Refactor: Simplify progressSemantic call
The ternary operator in the `progressSemantic` call within the `DotsIndicator` widget has been simplified. Instead of checking if `widget.progressSemantic` is not null and then calling it, it now uses the null-aware operator `?.` for a more concise and readable conditional call. The unused import `dart:nativewrappers/_internal/vm/lib/ffi_allocation_patch.dart` has also been removed.
1 parent 830b4b7 commit e4b81cf

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/src/introduction_screen.dart

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ library introduction_screen;
22

33
import 'dart:async';
44
import 'dart:math';
5-
import 'dart:nativewrappers/_internal/vm/lib/ffi_allocation_patch.dart';
65

76
import 'package:collection/collection.dart';
87
import 'package:dots_indicator/dots_indicator.dart';
@@ -684,12 +683,10 @@ class IntroductionScreenState extends State<IntroductionScreen> {
684683
child: widget.isProgress
685684
? widget.customProgress ??
686685
Semantics(
687-
label: widget.progressSemantic != null
688-
? widget.progressSemantic!(
689-
getCurrentPage() + 1,
690-
getPagesLength())
691-
.call()
692-
: "Page ${getCurrentPage() + 1} of ${getPagesLength()}",
686+
label: widget.progressSemantic?.call(
687+
getCurrentPage() + 1,
688+
getPagesLength()) ??
689+
"Page ${getCurrentPage() + 1} of ${getPagesLength()}",
693690
excludeSemantics: true,
694691
child: DotsIndicator(
695692
reversed: widget.rtl,

0 commit comments

Comments
 (0)