mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 09:47:35 +08:00
@ -2,6 +2,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:path/path.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
|
||||
class RenameDialog extends StatefulWidget {
|
||||
final String oldPath;
|
||||
@ -42,6 +43,10 @@ class _RenameDialogState extends State<RenameDialog> {
|
||||
return 'Please enter a name';
|
||||
}
|
||||
|
||||
if (value.contains(p.separator)) {
|
||||
return 'Cannot contain ${p.separator}';
|
||||
}
|
||||
|
||||
var newPath = join(dirname(widget.oldPath), value);
|
||||
if (FileSystemEntity.typeSync(newPath) !=
|
||||
FileSystemEntityType.notFound) {
|
||||
|
Reference in New Issue
Block a user