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 belirten Color tipinde bir değişken.
  • backgroundColor: İlerleme çubuğunun arka plan rengini belirten Color tipinde bir değişken.
  • duration: İlerleme çubuğunun animasyon süresini belirten Duration tipinde 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. AnimatedBuilder widget'ı, animasyonun tetiklenmesini ve çubuğun ilerleme değerini takip eder. AnimationController ve Tween kullanılarak ilerleme çubuğunun animasyonlu bir şekilde güncellenmesi sağlanır. Kodun çalışması şu şekildedir:
  1. AnimatedProgressBar oluşturulurken foregroundColor, backgroundColor ve duration değerleri parametre olarak alınır.
  2. initState metodu, AnimationController ve diğer animasyon nesnelerinin oluşturulmasını ve ilerleme çubuğunun animasyonunun başlatılmasını sağlar.
  3. didUpdateWidget metodu, ilerleme çubuğunun ilerleme değeri (value) değiştirildiğinde animasyonun güncellenmesini sağlar.
  4. build metodu, AnimatedBuilder içinde LinearProgressIndicator widget'ı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 called AnimatedProgressBar. A progress bar is used to visually indicate the progress of a task or loading status to the user. The AnimatedProgressBar class has the following properties:
  • foregroundColor: A Color variable that defines the foreground color of the progress bar.
  • backgroundColor: A Color variable that defines the background color of the progress bar.
  • duration: A Duration variable 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 the LinearProgressIndicator. The AnimatedBuilder widget is used to trigger the animation and track the progress value of the bar. The progress bar is animated using an AnimationController and Tween. Here's how the code works:
  1. When an AnimatedProgressBar is created, it takes foregroundColor, backgroundColor, and duration as parameters.
  2. The initState method initializes the AnimationController and other animation objects and starts the animation of the progress bar.
  3. The didUpdateWidget method updates the animation when the progress value (value) of the progress bar is changed.
  4. The build method returns the LinearProgressIndicator widget wrapped inside an AnimatedBuilder, 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

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