mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-23 15:08:07 +02:00
feat(recording): add immediate record button to recording modal
This commit is contained in:
1 parent
f217622e4a
commit
238cb8f407
1 file changed
+33
-2
@@ -31,6 +31,13 @@ class _RecordingModalState extends State<RecordingModal> {
|
|||||||
int _durationMinutes = 60;
|
int _durationMinutes = 60;
|
||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
|
|
||||||
|
Future<void> _recordNow() async {
|
||||||
|
setState(() {
|
||||||
|
_startTime = DateTime.now();
|
||||||
|
});
|
||||||
|
await _scheduleRecording();
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> _scheduleRecording() async {
|
Future<void> _scheduleRecording() async {
|
||||||
setState(() => _isLoading = true);
|
setState(() => _isLoading = true);
|
||||||
|
|
||||||
@@ -305,11 +312,35 @@ class _RecordingModalState extends State<RecordingModal> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 16),
|
const SizedBox(width: 16),
|
||||||
|
TvFocusableCard(
|
||||||
|
onTap: _isLoading ? () {} : _recordNow,
|
||||||
|
borderRadius: 8,
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.redAccent.withOpacity(0.8),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: _isLoading
|
||||||
|
? const SizedBox(
|
||||||
|
width: 20, height: 20,
|
||||||
|
child: CircularProgressIndicator(color: Colors.white, strokeWidth: 2),
|
||||||
|
)
|
||||||
|
: Text(
|
||||||
|
'Enregistrer de suite',
|
||||||
|
style: GoogleFonts.inter(
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
TvFocusableCard(
|
TvFocusableCard(
|
||||||
onTap: _isLoading ? () {} : _scheduleRecording,
|
onTap: _isLoading ? () {} : _scheduleRecording,
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColors.primary,
|
color: AppColors.primary,
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
@@ -320,7 +351,7 @@ class _RecordingModalState extends State<RecordingModal> {
|
|||||||
child: CircularProgressIndicator(color: Colors.white, strokeWidth: 2),
|
child: CircularProgressIndicator(color: Colors.white, strokeWidth: 2),
|
||||||
)
|
)
|
||||||
: Text(
|
: Text(
|
||||||
'Enregistrer',
|
'Programmer',
|
||||||
style: GoogleFonts.inter(
|
style: GoogleFonts.inter(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
|||||||
Reference in new issue
Block a user