AnimatedProgressBar class
Bu kod, animasyonlu bir ilerleme çubuğu (progress bar) widget'ı olan AnimatedProgressBar'u tanımlar. İlerleme çubuğu, bir işlemin veya yükleme durumunun görsel bir şekilde kullanıcıya bildirilmesi için kullanılır.
AnimatedProgressBar sınıfı aşağıdaki özelliklere sahiptir:
foregroundColor: İlerleme çubuğunun ön plan rengini belirtenColortipinde bir değişken.backgroundColor: İlerleme çubuğunun arka plan rengini belirtenColortipinde bir değişken.duration: İlerleme çubuğunun animasyon süresini belirtenDurationtipinde bir değişken.value: İlerleme çubuğunun başlangıç değerini belirten ve her zaman 0 olan bir değişken (bu değeri değiştirilebilir). Bu widget,LinearProgressIndicator'ı kullanarak görsel olarak ilerleme çubuğunu gösterir.AnimatedBuilderwidget'ı, animasyonun tetiklenmesini ve çubuğun ilerleme değerini takip eder.AnimationControllerveTweenkullanılarak ilerleme çubuğunun animasyonlu bir şekilde güncellenmesi sağlanır. Kodun çalışması şu şekildedir:
AnimatedProgressBaroluşturulurkenforegroundColor,backgroundColorvedurationdeğerleri parametre olarak alınır.initStatemetodu,AnimationControllerve diğer animasyon nesnelerinin oluşturulmasını ve ilerleme çubuğunun animasyonunun başlatılmasını sağlar.didUpdateWidgetmetodu, ilerleme çubuğunun ilerleme değeri (value) değiştirildiğinde animasyonun güncellenmesini sağlar.buildmetodu,AnimatedBuilderiçindeLinearProgressIndicatorwidget'ını döndürür ve çubuğun ilerleme değerini animasyonlu olarak gösterir. Sonuç olarak, bu kod, animasyonlu bir ilerleme çubuğu oluşturarak işlemlerinizin veya yükleme durumlarının kullanıcılara daha etkileşimli bir şekilde gösterilmesini sağlar. This code defines an animated progress bar widget calledAnimatedProgressBar. A progress bar is used to visually indicate the progress of a task or loading status to the user. TheAnimatedProgressBarclass has the following properties:
foregroundColor: AColorvariable that defines the foreground color of the progress bar.backgroundColor: AColorvariable that defines the background color of the progress bar.duration: ADurationvariable that determines the animation duration of the progress bar.value: A variable that represents the initial value of the progress bar and is always set to 0 (this value can be changed). This widget displays the progress bar visually using theLinearProgressIndicator. TheAnimatedBuilderwidget is used to trigger the animation and track the progress value of the bar. The progress bar is animated using anAnimationControllerandTween. Here's how the code works:
- When an
AnimatedProgressBaris created, it takesforegroundColor,backgroundColor, anddurationas parameters. - The
initStatemethod initializes theAnimationControllerand other animation objects and starts the animation of the progress bar. - The
didUpdateWidgetmethod updates the animation when the progress value (value) of the progress bar is changed. - The
buildmethod returns theLinearProgressIndicatorwidget wrapped inside anAnimatedBuilder, which visually shows the animated progress value of the bar. In conclusion, this code creates an animated progress bar, enhancing user interaction by visually indicating the progress of tasks or loading processes.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- AnimatedProgressBar
Constructors
- AnimatedProgressBar({Key? key, required Duration duration, required Color foregroundColor, required Color backgroundColor})
-
const
Properties
- backgroundColor → Color
-
final
- duration → Duration
-
final
- foregroundColor → Color
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → double
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< AnimatedProgressBar> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited