Lower voice recording minimum duration
This commit is contained in:
@@ -270,6 +270,8 @@ class AddExperienceFlow extends ConsumerStatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _AddExperienceFlowState extends ConsumerState<AddExperienceFlow> {
|
class _AddExperienceFlowState extends ConsumerState<AddExperienceFlow> {
|
||||||
|
static const _minimumVoiceSeconds = 30;
|
||||||
|
|
||||||
Timer? _timer;
|
Timer? _timer;
|
||||||
var _step = 0;
|
var _step = 0;
|
||||||
var _seconds = 0;
|
var _seconds = 0;
|
||||||
@@ -341,9 +343,10 @@ class _AddExperienceFlowState extends ConsumerState<AddExperienceFlow> {
|
|||||||
_ => _VoiceStep(
|
_ => _VoiceStep(
|
||||||
place: _selectedGooglePlace,
|
place: _selectedGooglePlace,
|
||||||
seconds: _seconds,
|
seconds: _seconds,
|
||||||
|
minimumSeconds: _minimumVoiceSeconds,
|
||||||
time: time,
|
time: time,
|
||||||
isRecording: _recording,
|
isRecording: _recording,
|
||||||
canContinue: _seconds >= 60,
|
canContinue: _seconds >= _minimumVoiceSeconds,
|
||||||
onToggleRecording: _toggleRecording,
|
onToggleRecording: _toggleRecording,
|
||||||
onNext: () {
|
onNext: () {
|
||||||
final coordinate =
|
final coordinate =
|
||||||
@@ -486,6 +489,7 @@ class _VoiceStep extends StatelessWidget {
|
|||||||
const _VoiceStep({
|
const _VoiceStep({
|
||||||
required this.place,
|
required this.place,
|
||||||
required this.seconds,
|
required this.seconds,
|
||||||
|
required this.minimumSeconds,
|
||||||
required this.time,
|
required this.time,
|
||||||
required this.isRecording,
|
required this.isRecording,
|
||||||
required this.canContinue,
|
required this.canContinue,
|
||||||
@@ -495,6 +499,7 @@ class _VoiceStep extends StatelessWidget {
|
|||||||
|
|
||||||
final _GooglePlaceStub? place;
|
final _GooglePlaceStub? place;
|
||||||
final int seconds;
|
final int seconds;
|
||||||
|
final int minimumSeconds;
|
||||||
final String time;
|
final String time;
|
||||||
final bool isRecording;
|
final bool isRecording;
|
||||||
final bool canContinue;
|
final bool canContinue;
|
||||||
@@ -515,7 +520,7 @@ class _VoiceStep extends StatelessWidget {
|
|||||||
).textTheme.titleLarge?.copyWith(fontWeight: FontWeight.w900),
|
).textTheme.titleLarge?.copyWith(fontWeight: FontWeight.w900),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
const Text('Минимум 60 секунд', textAlign: TextAlign.center),
|
Text('Минимум $minimumSeconds секунд', textAlign: TextAlign.center),
|
||||||
const SizedBox(height: 26),
|
const SizedBox(height: 26),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 132,
|
width: 132,
|
||||||
@@ -534,7 +539,9 @@ class _VoiceStep extends StatelessWidget {
|
|||||||
).textTheme.headlineMedium?.copyWith(fontWeight: FontWeight.w900),
|
).textTheme.headlineMedium?.copyWith(fontWeight: FontWeight.w900),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
LinearProgressIndicator(value: (seconds / 60).clamp(0.0, 1.0)),
|
LinearProgressIndicator(
|
||||||
|
value: (seconds / minimumSeconds).clamp(0.0, 1.0),
|
||||||
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user