wfile 0.4.2
wfile: ^0.4.2 copied to clipboard
Convenient work with files and their content across multiple platforms.
WFile #
The well-tested package for convenient work with files and their contents across multiple platforms. Independent of the various system delimiters. Feel free to use it in your awesome projects.
Android | iOS | Linux | MacOS | Web | Windows | |
---|---|---|---|---|---|---|
✅ | ✅ | ✅ | ✅ | ✘ | ✅ | platform |
Dart | Flutter | |
---|---|---|
✅ | ✅ | SDK |
Share some ❤️ and star repo to support the project.
Usage #
Read Files #
const sourcePath = 'path/prefix';
// const sourcePath = ['path', 'prefix'];
final f = WFile(sourcePath);
// get a varios content from files with respect to [sourcePath]
content = f.readAsText('text.txt');
content = f.readAsBytes('bytes.bin');
content = f.readAsImage('images/1/happy.png'); // path/prefix/images/1/happy.png
content = f.readAsImage(['images', 1, 'happy.png']); // path/prefix/images/1/happy.png
content = f.readAsJsonMap('map.json'); // <- { ... }
content = f.readAsJsonList('list.json'); // <- [ ... ]
content = f.readAsXml('data.xml'); // <- <data attr="...">...</data>
Write Files #
const sourcePath = 'path/prefix';
// const sourcePath = ['path', 'prefix'];
final f = WFile(sourcePath);
// get a varios content from files with respect to [sourcePath]
f.writeAsText(content, 'text.txt');
f.writeAsBytes(content, 'bytes.bin');
f.writeAsImage(content, 'images/1/happy.png'); // path/prefix/images/1/happy.png
f.writeAsImage([content, 'images', 1, 'happy.png']); // path/prefix/images/1/happy.png
f.writeAsJsonMap(content, 'map.json'); // { ... }
f.writeAsJsonList(content, 'list.json'); // [ ... ]
f.writeAsXml(content, 'data.xml'); // <data attr="...">...</data>
Welcome to Inspiration #
Requests and suggestions are warmly welcome.
Contributions are what make the open-source community such a great place to learn, create, and be inspired.
If this is your first contribution, I'll leave you with some of the best links I've found: they will help you get started or/and become even more efficient.
- Guide to Making a First Contribution. You will find the guide in your native language.
- How to Contribute to Open Source. Longread for deep diving for first-timers and for veterans.
- Summer Guide from Google.
The package WFile is open-source, stable and well-tested. Development happens on GitHub. Feel free to report issues or create a pull-request there.
General questions are best asked on StackOverflow.
And here is a curated list of how you can help:
- Report parts of the documentation that are unclear.
- Fix typos/grammar mistakes.
- Update the documentation or add examples.
- Report bugs and scenarios that are difficult to implement.
- Implement new features by making a pull-request (look below).
TODO (perhaps) #
Once you start using the WFile, it will become easy to choose the functionality to contribute. But if you already get everything you need from this package but have some free time, let me write here what I have planned:
- All feautures for this package into README.
- Support Web platform.
- Examples with filesystem brokers.
- An example with creating own broker.
It's just a habit of mine: writing down ideas that come to mind while working on a project. I confess that I rarely return to these notes. But now, hopefully, even if you don't have an idea yet, the above notes will help you choose the suitable "feature" and become a contributor to the open-source community.
Created with ❤️