VoiceClassicStyle class
A classic style voice recording widget that provides:
- A circular recording button with animated state changes.
- Optional swipe-to-cancel hint text.
- Optional timer display or cancellation message.
Example usage:
VoiceClassicStyle(
isRecording: true,
showCancelHint: true,
showSwipeLeftToCancel: true,
dragToLeftText: 'Swipe left to cancel',
showTimerText: true,
isCancelled: false,
cancelDoneText: 'Cancelled',
seconds: 10,
cancelHintColor: Colors.red,
timerFontSize: 16.0,
iconSize: 60.0,
backgroundColorSecond: Colors.grey.shade300,
backgroundColorFirst: Colors.red.shade400,
stopRecordingWidget: Icon(Icons.stop, color: Colors.white),
startRecordingWidget: Icon(Icons.mic, color: Colors.white),
iconColor: Colors.white,
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- VoiceClassicStyle
Constructors
- VoiceClassicStyle.new({Key? key, required bool isRecording, required bool showCancelHint, required bool showSwipeLeftToCancel, required String dragToLeftText, required TextStyle? dragToLeftTextStyle, required bool showTimerText, required bool isCancelled, required String cancelDoneText, required TextStyle? timerTextStyle, required int seconds, required Color cancelHintColor, required double timerFontSize, required double iconSize, required Color backgroundColorSecond, required Color backgroundColorFirst, required Widget? stopRecordingWidget, required Widget? startRecordingWidget, required Color iconColor})
-
Creates a VoiceClassicStyle widget.
const
Properties
- backgroundColorFirst → Color
-
Background color when recording.
final
- backgroundColorSecond → Color
-
Background color when not recording.
final
- cancelDoneText → String
-
Text shown when recording is cancelled.
final
- cancelHintColor → Color
-
Color used for cancel hint and shadow.
final
- dragToLeftText → String
-
Hint text shown when swipe-to-cancel is enabled.
final
- dragToLeftTextStyle → TextStyle?
-
Optional style for the drag hint text.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- iconColor → Color
-
Color of the default mic/stop icon.
final
- iconSize → double
-
Diameter of the recording button.
final
- isCancelled → bool
-
If true, displays cancelDoneText instead of timer.
final
- isRecording → bool
-
Flag indicating active recording state.
final
- 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
- seconds → int
-
Elapsed recording duration in seconds.
final
- showCancelHint → bool
-
Whether to show cancel hint text.
final
- showSwipeLeftToCancel → bool
-
Controls swipe-to-cancel functionality.
final
- showTimerText → bool
-
Whether to display the timer text.
final
- startRecordingWidget → Widget?
-
Custom widget for start recording state.
final
- stopRecordingWidget → Widget?
-
Custom widget for stop recording state.
final
- timerFontSize → double
-
Font size for the timer text.
final
- timerTextStyle → TextStyle?
-
Optional style for timer or cancel text.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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