✨ Audio recorder
This commit is contained in:
@@ -15,14 +15,14 @@ import 'package:island/services/file.dart';
|
||||
import 'package:island/services/compose_storage_db.dart';
|
||||
import 'package:island/widgets/alert.dart';
|
||||
import 'package:island/widgets/content/sheet.dart';
|
||||
import 'package:island/widgets/post/compose_recorder.dart';
|
||||
import 'package:material_symbols_icons/symbols.dart';
|
||||
import 'package:pasteboard/pasteboard.dart';
|
||||
import 'package:styled_widget/styled_widget.dart';
|
||||
import 'package:textfield_tags/textfield_tags.dart';
|
||||
import 'dart:async';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:textfield_tags/textfield_tags.dart';
|
||||
|
||||
class ComposeState {
|
||||
final TextEditingController titleController;
|
||||
final TextEditingController descriptionController;
|
||||
@@ -399,6 +399,26 @@ class ComposeLogic {
|
||||
];
|
||||
}
|
||||
|
||||
static Future<void> recordAudioMedia(
|
||||
WidgetRef ref,
|
||||
ComposeState state,
|
||||
BuildContext context,
|
||||
) async {
|
||||
final audioPath = await showModalBottomSheet<String?>(
|
||||
context: context,
|
||||
builder: (context) => ComposeRecorder(),
|
||||
);
|
||||
if (audioPath == null) return;
|
||||
|
||||
state.attachments.value = [
|
||||
...state.attachments.value,
|
||||
UniversalFile(
|
||||
data: XFile(audioPath, mimeType: 'audio/m4a'),
|
||||
type: UniversalFileType.audio,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
static Future<void> linkAttachment(
|
||||
WidgetRef ref,
|
||||
ComposeState state,
|
||||
|
Reference in New Issue
Block a user