Skip to content

no1seman/frontend-stub-flutter

Repository files navigation

Tarantool Front-end stub for Flutter Web App

Since Google Flutter is already in Beta it will be nice to amplify Tarantool Cartridge with the ease and power of Google Flutter for Web.

This simple stub project allows to embed Flutter Web application into Tarantool Cartridge Web UI.

Its look like:

tarantool-flutter

This repo has a preconfigured webpack config and setup for generate rock and lua bundle in it. Also it has a simple Flutter Web Application.

Based on:

Known issues:

  • Flutter Web Application iframe reloads when navigating by main menu, so your Flutter Web Application must persist the state. For example you may use: hydrated or/and hydrated_bloc packages to persist Webb App state.
  • No integration tests
  • Building is not tested on non-GNU environments (may be some problems with sed)

Usage

0. Prerequisities

1. Clone repo and install nodejs dependencies (use npm ci NOT npm i)

git clone git@github.com:tarantool/frontend-stub.git name-as-you-wish
cd name-as-you-wish
npm ci

2. Configure you project

Run the following command to setup your project's: "name", "Git repository path", and "path to Fluter Web App Project" (Note: Flutter App project must be in "name-as-you-wish" folder):

npm run config

3. Generate bundle

npm run build-rock

For developing purposes use the following command:

npm run start

Don't forget change package.json name of your project.

4. Install rock and configure Tarantool Cartridge App

cd <Tarantool Cartridge application dir>
tarantoolctl rocks install <path to rock file>/graphqlide-scm-1.all.rock

To get it work just add to Tarantool Cartridge application init.lua the following code:

require('flutter').init()

After it - reload your Tarantool Cartridge:

cartridge stop && cartridge start -d