fable_flow_lite 0.0.1
fable_flow_lite: ^0.0.1 copied to clipboard
A lightweight visual novel player for Flutter.
Lite - FableFlow Player #
A lightweight visual novel player for Flutter. Lite provides a simple, ready-to-use player for linear visual novel stories with minimal setup required.
Features #
- 🎮 Simple Integration: Drop-in visual novel player with just a few lines of code
- 📱 Cross-Platform: Works on iOS, Android, Web, Windows, macOS, and Linux
- 📖 Linear Storytelling: Perfect for straightforward narrative experiences
- 🎨 Customizable UI: Customize dialog boxes, text styles, and colors
- 🖼️ Character Sprites: Display character sprites with positioning
- 🌐 Multiple Sources: Load stories from JSON files, URLs, or assets
- 🎵 Auto-Play: Built-in auto-play functionality
- 💾 Caching: Automatic caching of remote assets
Getting Started #
Add this package to your pubspec.yaml:
dependencies:
lite: ^0.0.1
Usage #
Basic Usage - Load from Assets #
import 'package:flutter/material.dart';
import 'package:lite/lite.dart';
class MyStoryPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: StoryPlayer.fromJson(
jsonContent: myJsonString,
onComplete: () {
print('Story completed!');
},
title: 'My Visual Novel',
),
);
}
}
Load from URL #
StoryPlayer.fromUrl(
url: 'https://example.com/story.json',
onComplete: () {
// Handle completion
},
title: 'My Visual Novel',
)
Customize Appearance #
StoryPlayer.fromJson(
jsonContent: myJsonString,
onComplete: () {},
title: 'My Visual Novel',
dialogBoxDecoration: BoxDecoration(
color: Colors.blue.withOpacity(0.5),
borderRadius: BorderRadius.circular(20),
border: Border.all(color: Colors.white, width: 2),
),
characterNameStyle: TextStyle(
color: Colors.yellow,
fontSize: 20,
fontWeight: FontWeight.bold,
),
dialogTextStyle: TextStyle(
color: Colors.white,
fontSize: 18,
),
)
Story JSON Format #
{
"type": "lite",
"scenes": [
{
"id": "scene_1",
"image": "https://example.com/background.png",
"behaviors": [
{
"type": "speak",
"character": {
"id": "char_1",
"name": "Alice",
"image": "https://example.com/alice.png"
},
"dialog": "Hello, world!",
"position": "left"
}
]
}
]
}
Character Properties #
id: Unique identifiername: Display nameimage: (Optional) Character sprite URL or pathposition: (Optional)"left","right", or"center"
Example #
Check out the /example directory for a complete working example.
Additional Information #
- Homepage: https://gitlab.com/Simirror/fable_flow
- Issues: Please file issues on the GitLab repository
- Engine: Built on fable_flow_engine
For more advanced features like branching, variables, and save systems, consider using the fable_flow_engine package directly.