CLI package manager and template for Flutter

Last update: Jun 26, 2022

Slidy

CLI package manager and template generator for Flutter. Generate Modules, Pages, Widgets, BLoCs, Controllers, tests and more.

Slidy supports mobx, bloc, cubit, rx_notifier and triple.

Why should I use it?

Slidy's goal is to help you structure your project in a standardized way. Organizing your app in Modules formed by pages, repositories, widgets, BloCs, and also create unit tests automatically. The Module gives you a easier way to inject dependencies and blocs, including automatic dispose. Also helps you installing the dependencies and packages, updating and removing them. The best is that you can do all of this running a single command.

Motivations

We realized that the project pattern absence is affecting the productivity of most developers, so we're proposing a development pattern along with a tool that imitates NPM (NodeJS) functionality as well as template generation capabilities (similar to Scaffold ).

About the Proposed Pattern

The structure that slidy offers you, it's similar to MVC, where a page keeps it's own business logic classes(BloC).

We recommend you to use flutter_modular when structuring with slidy. It offers you the module structure(extending the WidgetModule) and dependency/bloc injection, or you will probably get an error.

To understand flutter_modular, take a look at the README.

We also use the Repository Pattern, so the folder structure it's organized in local modules and a global module. The dependencies(repositories, BloCs, models, etc) can be accessed throughout the application.

Sample folder structure generated by slidy:

Installation

You can get Slidy of many ways.

Flutter/Dart directly

 dart pub global activate slidy

choco (only windows)

 choco install slidy

Homebrew (macos and linux)

 brew install slidy

Hello world!

After install, exec the slidy version command. If the command was completed, the slidy was installed.

 slidy --version

Commands:

start: Create a basic structure for your project (confirm that you have no data in the "lib" folder).

slidy start

run: Run scripts placed in the "scripts" parameter in pubspec.yaml

slidy run open_folder

Install: Install (or update) a new package or packages:

slidy install mockito dio modular

You can also install a package as dev_dependency using the flag --dev

slidy i flutter_launcher_icons --dev

Generate:

Create a module, page, widget or repository according to the option.

Options:

Creates a new module with slidy generate module:

slidy generate module manager/product

Creates a new page with slidy generate page:

slidy generate page manager/product/pages/add_product

Creates a new widget with slidy generate widget:

slidy generate widget manager/product/widgets/product_detail

Create a new repository with slidy generate repository

slidy g r manager/product/repositories/product

Create a new rx notifier with slidy generate rx

slidy g rx manager/product/page/my_rx_notifier

Create a new triple with slidy generate t

slidy g t manager/product/page/my_triple

Create a new cubit with slidy generate c

slidy g c manager/product/page/my_cubit

Create a new mobx with slidy generate mbx

slidy g mbx manager/product/page/my_store

For more details Telegram Group Flutterando

GitHub

https://github.com/Flutterando/slidy
Comments
  • 1. Can't load Kernel binary: Invalid SDK hash

    • Operational System: WIndows
    • How to repeat the beheavior:
      1. Install slidy follow the README instructions
      2. Run the command slidy --version
      3. Script print after version Can't load Kernel binary: Invalid SDK hash
    • Severity: non-blocking
    Reviewed by casenvi at 2020-09-03 17:20
  • 2. Pequena atualização no comando pub para instalar o Slidy

    Olá pessoal do Flutterando! Gostaria de agradecer por essa incrível CLI!

    Bom, eu tive um pequeno problema na hora da instalação. Ao utilizar o comando: flutter pub global activate slidy eu obtive o erro Can't load Kernel binary: Invalid kernel binary format version. No active package slidy.

    A solução foi tirar o flutter ficando somente pub global activate slidy

    Reviewed by itsjhonny at 2019-10-27 22:12
  • 3. slidy create projectest error: Undefined name '$AppController'

    Hi there,

    I'm trying to start a new project using: slidy create projectteste, but slidy makes a wrong pubspec.yaml:

    https://user-images.githubusercontent.com/379850/105056714-487eff80-5a53-11eb-97c2-4a7aa89a7383.mov

    After this, i changed the pubspec.yaml and fix the wrong line, but appear a new error:

    https://user-images.githubusercontent.com/379850/105057127-aca1c380-5a53-11eb-83df-e7941dbf1c02.mov

    After run flutter pub run build_runner build --delete-conflicting-outputs and clean the problem persist.

    Captura de Tela 2021-01-19 às 12 36 35

    How can i fix this error in line 9 of home_module.dart?

    Reviewed by hermesalvesbr at 2021-01-19 15:45
  • 4. Slidy won't accept null or unexistent `dependencies`

    The pubspec specification states the following about dependencies:

    [Dependencies] can be omitted if your package has no dependencies.

    Thus, the following file is a valid pubspec.yaml file:

    name: package
    version: 0.01
    description: Lorem ipsum
    
    dev_dependencies:
      flutter_test:
        sdk: flutter
      test: ^1.9.4
    
    environment:
      sdk: ">=2.7.0 <3.0.0"
    

    Inserting an empty dependencies should also work:

    name: package
    version: 0.01
    description: Lorem ipsum
    
    dependencies:
    
    dev_dependencies:
      flutter_test:
        sdk: flutter
      test: ^1.9.4
    
    environment:
      sdk: ">=2.7.0 <3.0.0"
    

    In both cases, however, running slidy install <package> results in an error:

    ERROR: No valid project found in this folder.
    If you haven't created your project yet create with:
    
    slidy create myproject
    
    Or enter your project folder with to use slidy: 
    
    cd myproject && slidy start
    
    

    This error is misleading, because it both exist and it's a valid project.

    Reviewed by mateusfccp at 2020-04-19 11:17
  • 5. Flutter falha em pegar o pacote

    Quando insiro o pacote em dependecies, tanto bloc_pattern: ^2.3.2, quando bloc_pattern: ^2.4.4 da o erro: A package may not list itself as a dependency.

    A saida do console: [bloc_pattern] flutter packages get Running "flutter pub get" in bloc_pattern...
    Error on line 27, column 3 of pubspec.yaml: A package may not list itself as a dependency.

    27 │ bloc_pattern: ^2.3.2

    │ ^^^^^^^^^^^^ ╵ pub get failed (65) exit code 65

    Algum jeito de resolver esse problema?

    Reviewed by pauloantonelli at 2019-11-02 13:42
  • 6. Cmd commands invoked twice

    image

    When trying to invoke a command over the terminal in VS Code, slidy commands run twice, making it impossible to work with.

    Has anyone encountered that problem?

    environment: sdk: ">=2.12.0 <3.0.0"

    `[√] Flutter (Channel stable, 2.0.3, on Microsoft Windows [Version 10.0.19042.867], locale en-US) • Flutter version 2.0.3 at D:\SDKs\flutternullsafe\flutter • Framework revision 4d7946a68d (2 weeks ago), 2021-03-18 17:24:33 -0700 • Engine revision 3459eb2436 • Dart version 2.12.2

    [√] Android toolchain - develop for Android devices (Android SDK version 29.0.3) • Android SDK at C:\Users\roini\AppData\Local\Android\sdk • Platform android-30, build-tools 29.0.3 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04) • All Android licenses accepted.

    [√] Chrome - develop for the web • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

    [√] Android Studio (version 3.6) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 49.0.1 • Dart plugin version 192.8052 • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

    [√] VS Code (version 1.55.0) • VS Code at C:\Users\roini\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.16.0

    [√] Connected device (2 available) • Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.90 • Edge (web) • edge • web-javascript • Microsoft Edge 89.0.774.63

    • No issues found`

    Reviewed by rogasciences at 2021-04-04 11:35
  • 7. slidy start não funciona de forma adequada no Android Studio

    Olá!

    Ao executar o comando "slidy start" (estou usando a versão 1.5.3) não consigo usar as setas do teclado para selecionar as opções. E se apenas aperto enter acontece o seguinte:

    `[2J[0;0H [38;5;10mSlidy CLI Interative [0m [38;5;11mWARN: What Provider System do you want to use?[0m [38;5;10mflutter_modular (default)[0m [38;5;15mbloc_pattern[0m

    Use ↑↓ (keyboard arrows) Press 'q' to quit. [2J[0;0H [38;5;10mSlidy CLI Interative [0m [38;5;11mWARN: Choose a state manager[0m [38;5;10mmobx (default)[0m [38;5;15mflutter_bloc[0m [38;5;15mBLoC with rxdart[0m

    Use ↑↓ (keyboard arrows) Press 'q' to quit. [38;5;9mERROR: The lib folder must be empty[0m ` Ele dá este erro mesmo se eu apagar os arquivos das pastas 'lib' e 'test' manualmente.

    EDIT: Consegui instalar apenas apertando ENTER e usando as configurações default após apagar completamente as pastas 'lib' e 'test' (não apenas os arquivos).

    Reviewed by ThiagoFTelles at 2020-03-04 21:57
  • 8. Apos o ultimo update do dart o slidy fecha o console após executar comando

    Windows 10 λ flutter doctor -v
    [√] Flutter (Channel stable, 1.20.1, on Microsoft Windows [versão 10.0.19041.388], locale pt-BR)
    • Flutter version 1.20.1 at C:\flutter
    • Framework revision 2ae34518b8 (4 days ago), 2020-08-05 19:53:19 -0700
    • Engine revision c8e3b94853
    • Dart version 2.9.0

    [√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\Avell\AppData\Local\Android\Sdk
    • Platform android-29, build-tools 29.0.2
    • ANDROID_HOME = C:\Users\Avell\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    • All Android licenses accepted.

    [√] Android Studio (version 3.6)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

    [√] VS Code (version 1.47.3)
    • VS Code at C:\Users\Avell\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.13.2

    [!] Connected device
    ! No devices available

    ! Doctor found issues in 1 category.

    erro

    Reviewed by toshiossada at 2020-08-10 00:19
  • 9. Adding Linting

    Added Linting to Modular with Lint, which can be changed to pedantic or Effective Dart packages while keeping current lints.

    Improved readability changing functions with multiple parameters to named parameters.

    Also, corrected some undesired typos where a async function wouldn't return Future but actually void.

    Tell me what you guys think if there's something which can be improved.

    Reviewed by Ascenio at 2020-06-10 02:09
  • 10. slidy create version solving failed

    Cannot get packages after creating new project with slidy:

    [mobx_counter] flutter pub get
    Running "flutter pub get" in mobx_counter...                    
    The current Dart SDK version is 2.10.4.
    
    Because modular_codegen >=2.1.0 <3.0.0-nullsafety.1 depends on flutter_modular_annotations >=0.0.2 which requires SDK version >=2.12.0-0 <3.0.0, modular_codegen >=2.1.0 <3.0.0-nullsafety.1 is forbidden.
    
    So, because mobx_counter depends on modular_codegen ^2.1.0, version solving failed.
    pub get failed (1; So, because mobx_counter depends on modular_codegen ^2.1.0, version solving failed.)
    exit code 1
    

    Project was created with slidy create, flutter_modular and mobx. I also tried with slidy start after creating a project with flutter create Everything is freshly installed and up-to-date (Dart, Flutter, Slidy...)

    pubspec.yaml

    name: mobx_counter
    description: A new Flutter project.
    publish_to: 'none' 
    version: 1.0.0+1
    
    vars: 
        clean: flutter clean
        get: flutter pub get
        runner: flutter pub run build_runner
    scripts: 
        mobx_build: $runner build
        mobx_watch: $clean & $get & $runner watch
        mobx_build_clean: $clean & $get & $runner build --delete-conflicting-outputs
    
    environment:
      sdk: ">=2.7.0 <3.0.0"
    
    dependencies:
      dio: ^3.0.10
      flutter_mobx: ^1.1.0+2
      mobx: ^1.2.1+4
      flutter_modular: ^2.0.1
      flutter:
        sdk: flutter
    
    dev_dependencies:
      mockito: ^4.1.3
      modular_codegen: ^2.1.0
      mobx_codegen: ^1.1.2
      build_runner: ^1.10.1
      flutter_test:
        sdk: flutter
    
    flutter:
      uses-material-design: true
    
    Reviewed by FilipKvestak at 2020-12-23 10:03
  • 11. Cannot run slidy...

    I have a problem where after have activated slidy, I get the following error when running ANY command:

    Can't load Kernel binary: Invalid kernel binary format version.

    I am running this latest flutter version:

    Flutter 1.14.2-pre.27 • channel master • https://github.com/flutter/flutter.git Framework • revision 01f19ee6d4 (69 minutes ago) • 2020-01-16 16:41:06 -0500 Engine • revision 6693dd7518 Tools • Dart 2.8.0 (build 2.8.0-dev.2.0 009537bbf0)

    Any ideas?

    Reviewed by GQAdonis at 2020-01-16 22:50
  • 12. Brew installation in docs but not on brew.sh

    The installation of slidy with brew doesn't work.

    Warning: No available formula with the name "slidy". Did you mean slides or solid? ==> Searching for similarly named formulae... These similarly named formulae were found: slides solid To install one of them, run (for example): brew install slides ==> Searching for a previously deleted formula (in the last month)... Error: No previously deleted formula found. ==> Searching taps on GitHub... Error: No formulae found in taps.

    Reviewed by benjaminschreck at 2022-02-24 08:32
  • 13. Separador entre nome da classe e responsabilidade configurável

    Antes de qualquer coisa, gostaria parabenizar aos desenvolvedores por este ótimo trabalho feito entre o Modular e o Slidy.

    Dito isso, gostaria apenas de tocar em um ponto de melhoria para o Slidy:

    É padrão dos frameworks que utilizam a estrutura de escopo modular, definir nomes usando o ponto antes do sufixo de tipo da classe, exemplo:

    Angular e Nest.js

    // nome-classe.tipo-classe
    
    service-providers.module.ts
    service-providers.controller.ts
    service-providers.service.ts 
    

    O Modular traz este conceito de estrutura de escopo modular, e até mesmo faz uso dos sufixos de tipo-clase, porém o detalhe que se perdeu no caminho é que o ponto para separar as responsabilidades, não é seguido pelo Slidy, que mantém tudo separado pelo _, tanto os separadores do nome das classes, quanto o seu sufixo de responsabilidade.

    O ponto que esta issue traz é:

    É possível adicionar uma opção customizável ao Slidy que permita que o time de desenvolvimento possa optar entre usar o _, ou o ponto, que já é o padrão nos outros frameworks, para fazer essa separação entre responsabilidades dentro do nome do arquivo?

    Reviewed by btd1337 at 2022-01-20 19:06
  • 14. slidy generate module modules/name -c

    Slidy não está gerando o modulo completo, apenas o "name_module.dart".

    PS C:[path][app_name]> slidy g module teste -c SUCCESS: teste_module created SUCCESS: teste_module_test created Unhandled exception: Bad state: No element #0 Iterable.firstWhere (dart:core/iterable.dart:516) #1 GenerateModuleSubCommand.run (file:///c:/programdata/chocolatey/lib/slidy/tools/source/bin/commands/sub_command/ generate_module_sub_command.dart) #2 CommandRunner.runCommand (package:args/command_runner.dart:196) #3 main (file:///c:/programdata/chocolatey/lib/slidy/tools/source/bin/main.dart:22)

    Reviewed by lucascorrea30 at 2021-11-10 19:14
  • 15. I get this errors when running slidy start and flutter pub get, there's an incompatibility with flutter_modular_test and mobx_codegen, i had to remove them to flutter pub get run the dependencies // Eu tive esses erros ao rodar o slidy start e depois o flutter pub get, parece haver uma incompatibilidade com as versões do flutter_modular_test e mobx_codegen, precisei remover elas parece instalar as outras dependencias

    $ flutter pub get Because flutter_modular_test >=1.0.2 depends on flutter_modular ^3.4.1+1 and lol depends on flutter_modular ^4.0.1+2, flutter_modular_test >=1.0.2 is forbidden. So, because lol depends on flutter_modular_test ^1.0.4, version solving failed. Running "flutter pub get" in lol... pub get failed (1; So, because lol depends on flutter_modular_test ^1.0.4, version solving failed.)

    $ flutter pub get Because mobx_codegen >=2.0.3 depends on analyzer ^2.0.0 which depends on meta ^1.7.0, mobx_codegen >=2.0.3 requires meta ^1.7.0. And because every version of flutter_test from sdk depends on meta 1.3.0, mobx_codegen >=2.0.3 is incompatible with flutter_test from sdk. So, because lol depends on both flutter_test any from sdk and mobx_codegen ^2.0.3, version solving failed. Running "flutter pub get" in lol... pub get failed (1; So, because lol depends on both flutter_test any from sdk and mobx_codegen ^2.0.3, version solving failed.)

    Reviewed by gsllucas at 2021-09-26 19:21
  • 16. Triple generate with deprecated package

    When generating a triple pattern project, the slide set a dev_dependencies deprecated flutter_modular_test instead of modular test. Error after run flutter pub get.

    Because flutter_modular_test >=1.0.2 depends on flutter_modular ^3.4.1+1 and teste depends on flutter_modular ^4.0.0+6, flutter_modular_test >=1.0.2 is forbidden. So, because teste depends on flutter_modular_test ^1.0.4, version solving failed. Running "flutter pub get" in teste... pub get failed (1; So, because teste depends on flutter_modular_test ^1.0.4, version solving failed.)

    Reviewed by gbfonseca at 2021-09-18 21:51

Related

A Package providing Core functionality/Template to start off a Clean Architecture based project

A Package providing Core functionality/Template to start off a Clean Architecture based project Features Provides with APIResult & UseCaseResult model

Dec 25, 2021
Flutter network manager package.
Flutter network manager package.

Features With Network Manager, you can now easily manage your internet requests, send and receive data. Usage Set Base URL Settings Base URL -> Networ

Mar 9, 2022
Flutter Package Manager
 Flutter Package Manager

Flutter Package Manager Flutter Package Manager, powerfull package management via CLI, add/search/top/favorite packages! Install > pub global activate

Dec 1, 2021
Utility Manager Flutter Application is made with Flutter and Supabase which allows user to add task, set remainder to the task, set color to separate tasks and it allows to add URL with URL's informations.
Utility Manager Flutter Application is made with Flutter and Supabase which allows user to add task, set remainder to the task, set color to separate tasks and it allows to add URL with URL's informations.

Utility Manager Flutter Application! Utility Manager Flutter Application is made with Flutter and Supabase which allows user to add task, set remainde

Jan 6, 2022
This is an eCommerce minimalist template with a clean and beautiful design for Flutter.
This is an eCommerce minimalist template with a clean and beautiful design for Flutter.

Shope - Free Flutter eCommerce Template The “Shope” e-Commerce UI Kit has the goal to help you to save time with the frontend development. You can use

Jun 19, 2022
Password Manager Created Using Flutter And SQLite

Password Manager Created Using Flutter And SQLite

Jun 17, 2022
An open source task manager (todo list) app, developed using Dart language and Flutter framework.
An open source task manager (todo list) app, developed using Dart language and Flutter framework.

Tasker An open source task manager (todo list) app, developed using Dart language and Flutter framework. Screenrecords     Screenshots                

May 24, 2022
Finance manager for devlance using flutter and firebase (Open source)

finance_manager A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Dec 27, 2021
A task manager app made with flutter where you can mark your tasks for specific days and keep your life organized!
A task manager app made with flutter where you can mark your tasks for specific days and keep your life organized!

task_manager_app A task manager app made with flutter where you can mark your tasks for specific days and keep your life organized! Getting Started Th

Sep 1, 2021
Attendance and Payment manager

Manage Me Application A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you st

Oct 16, 2021
A simple and secure money manager that keeps you financially vigilant.
A simple and secure money manager that keeps you financially vigilant.

Be Thrifty Today A simple and secure money manager that keeps you financially vigilant. Website https://bethrifty.today Short Description Be Thrifty T

Jun 25, 2022
GJAMAssist is an open source Flutter-based template for a business assistant application.
GJAMAssist is an open source Flutter-based template for a business assistant application.

GJAMAssist is an open source Flutter-based template for a business assistant application. It has been designed to use Google Firebase as ba

Apr 27, 2022
🍔😋 Grocery Shopping App template UI kit in Flutter
🍔😋 Grocery Shopping  App template UI kit in Flutter

?? ?? Fryo - Grocery Shopping App template kit A Flutter UI template of a Grocery Shopping App I found on Uplabs. Design screens are on Uplabs. It's p

Jun 11, 2022
This repo contains the side menu UI for admin template

f9tech A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this i

Dec 11, 2021
template with tests, login flow, riverpod, logging ect.

Flutter Template What to accomplish has tests basic auth flow riverpod as state provider logging (sentry) navigation (I used Beamer last time but migh

May 31, 2022
AuthPass - Password Manager based on Flutter for all platforms. Keepass 2.x (kdbx 3.x) compatible.
AuthPass - Password Manager based on Flutter for all platforms. Keepass 2.x (kdbx 3.x) compatible.

AuthPass.app - Open Source Password Manager for mobile and desktop AuthPass - Password Manager based on Flutter for all platforms. Keepass 2.x (kdbx 3

Jun 24, 2022
A task manager built with Flutter, Serverless, Postgres, Firebase
A task manager built with Flutter, Serverless, Postgres, Firebase

Tasky Mobile App A project management mobile app This project is an implementation of a Design i found on uigaints.com by Ashish Dhakal. The Backend w

Jun 23, 2022
A simple, cross-platform password manager created with Flutter.
A simple, cross-platform password manager created with Flutter.

PassMan PassMan Logo © 2021 by Yash Ahir is licensed under CC BY-NC 4.0 A simple, cross-platform password manager created with Flutter. How to run thi

Jan 23, 2022
Simple student record manager app for learning flutter basics

Simple Student Record Manager Simple student record manager app for learning flutter basics integrated with Django REST API (refer Generic-Student-API

May 21, 2021