TxtFilePre.dart 426 B

12345678910111213141516
  1. import 'dart:io';
  2. import 'package:neofilemanager/Item/Preview/Impl/FilePreDecrator.dart';
  3. import 'package:neofilemanager/Item/Preview/Impl/ProxyFilePre.dart';
  4. class TxtFilePre extends FilePreDecrator{
  5. TxtFilePre(ProxyFilePre filePre) : super(filePre);
  6. // 读取txt内容
  7. String getContent(){
  8. File file=File(filePre.file.path);
  9. var content=file.readAsStringSync();
  10. print(content);
  11. return content;
  12. }
  13. }