Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coingaming/rfw_formats
https://github.com/coingaming/rfw_formats
Last synced: about 15 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/coingaming/rfw_formats
- Owner: coingaming
- License: mit
- Created: 2024-11-06T23:39:33.000Z (14 days ago)
- Default Branch: main
- Last Pushed: 2024-11-15T11:54:43.000Z (5 days ago)
- Last Synced: 2024-11-15T12:33:16.986Z (5 days ago)
- Language: Elixir
- Size: 222 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RfwFormats
RfwFormats is an Elixir implementation of Flutter's Remote Flutter Widgets (RFW) template parser and binary converter.
## Features
* Parse RFW text format library templates and data files
* Encode and decode RFW binary format data and library blobs
* Full compatibility with Flutter's RFW specification## Installation
Add `rfw_formats` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:rfw_formats, "~> 0.1.0"}
]
end
```## Usage
The most common use-case is parsing a widget template from text format and converting it to binary format for use with Flutter:
```elixir
alias RfwFormats.{Text, Binary}# Parse a widget template from text format
template = Text.parse_library_file("""
import core.widgets;widget myButton = ElevatedButton(
onPressed: callback,
child: Text("Click me")
);
""")# Convert the template to binary format for Flutter
binary_blob = Binary.encode_library_blob(template)
```