fable_flow_lite 0.0.1 copy "fable_flow_lite: ^0.0.1" to clipboard
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 identifier
  • name: Display name
  • image: (Optional) Character sprite URL or path
  • position: (Optional) "left", "right", or "center"

Example #

Check out the /example directory for a complete working example.

Additional Information #

For more advanced features like branching, variables, and save systems, consider using the fable_flow_engine package directly.

1
likes
140
points
71
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight visual novel player for Flutter.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

fable_flow_engine, flutter, flutter_cache_manager, http

More

Packages that depend on fable_flow_lite