Skip to content

Commit

Permalink
TextFile | Added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Minyewoo committed Feb 29, 2024
1 parent 55aa910 commit f68917d
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/src/core/text_file.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import 'dart:io';
import 'package:flutter/services.dart';
///
abstract class TextFile {
///
/// The interface for reading and writing a text file.
abstract interface class TextFile {
/// Text file from the file system.
///
/// `filePath` - file system valid relative or full path to the file.
const factory TextFile.path(String filePath) = _PathTextFile;
///
/// Text file from application asset bundle.
///
/// `assetPath` - path to the file according to your `assets` section in `pubspec.yaml`.
const factory TextFile.asset(String assetPath) = _AssetTextFile;
///
/// Internal file contents as text.
Future<String> get content;
///
///
/// Rewrites the entire file with provided `text`.
Future<void> write(String text);
}
///
Expand Down

0 comments on commit f68917d

Please sign in to comment.