Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions lib/views/screens/create_chapter_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ class CreateChapterScreenState extends State<CreateChapterScreen> {
],
);

if (!mounted) return;

if (result != null) {
setState(() {
audioFile = File(result.files.single.path!);
});
final path = result.files.single.path;
if (path != null) {
setState(() => audioFile = File(path));
}
}
}

Expand All @@ -68,11 +71,15 @@ class CreateChapterScreenState extends State<CreateChapterScreen> {
allowedExtensions: ['txt'],
);

if (result != null) {
setState(() {
lyricsFile = File(result.files.single.path!);
});
}

if (result != null) {
if(result.files.single.path!=null){
setState(() {
lyricsFile = File(result.files.single.path!);
});
}

}
}

void createChapter() async {
Expand Down Expand Up @@ -110,6 +117,13 @@ class CreateChapterScreenState extends State<CreateChapterScreen> {
Navigator.pop(Get.context!);
}

@override
void dispose() {
titleController.dispose();
aboutController.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
return GestureDetector(
Expand Down
Loading