Use Platform.pathSeparator to get the separator used by the operating system to separate components in file. Or, use the separator getter in the path Pub package.
import 'dart:io' show Platform; import 'package:path/path.dart' as path; main() { // Prints '\' on Windows and '/' on other platforms. print(Platform.pathSeparator); // This does the same. print(path.separator); }
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did129464