A repository for holding all mason brick templates that I have uploaded to BrickHub.

Overview

mason bricks

mason logo

A repository for holding all mason brick templates that I have uploaded to BrickHub.


Bricks 🧱

Brick Description Version
model A brick to create your model with properties and all the supporting methods, copyWith, to/from json, equatable and more! 0.3.3
feature_brick A brick to create a feature using best practices and your state management of choice! 0.2.2
app_ui A brick to create your UI package that holds all your app's Colors, Typography, Layout, Theme, and more! 0.0.4
service A brick to create your service and interface with your defined methods. With optional singleton handling! 0.0.2
In the works... In the works... N/A
Comments
  • feat: Add freezed suport to model brick

    feat: Add freezed suport to model brick

    Brick

    • [x] model
    • [ ] feature_brick
    • [ ] app_ui
    • [ ] service
    • [ ] service_package

    Status

    READY

    Breaking Changes

    NO

    Description

    This pull request propose code changes required to address #13 Added way to choose model generator mode. Currently supported options are either freezed or none. It also adds post_gen.dart script that tries to add required dependencies using pub add and if freezed were used as generator mode runs build_runner.

    Type of Change

    • [x] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    enhancement 
    opened by LosDanieloss 4
  • feat: cubit option for feature_brick

    feat: cubit option for feature_brick

    Description

    When using BLoC, I always start by using cubits instead of bloc. Is it in the roadmap that you would add one?

    Desired Solution

    Introduce a cubit option when generating a new feature brick

    Additional Context

    I'm still very new to bricks. I might be able to contribute in future when I got to learn more about it.

    enhancement 
    opened by yshean 3
  • fix: [feature_brick] Provider State Management gives a above this Consumer Widget" error">

    fix: [feature_brick] Provider State Management gives a "Could not find the correct Provider above this Consumer Widget" error

    feature_brick

    • [ ] model
    • [x] feature_brick
    • [ ] app_ui
    • [ ] service
    • [ ] service_package

    Description With the default implementation of provider state management, flutter throws this exception when LoginPage() is put in the widget tree.

    Steps To Reproduce

    1. Create a new project and a new feature brick
    2. Put the feature page in home of MaterialApp of main.dart
        return MaterialApp(
          title: 'Flutter Demo',
          theme: ThemeData(),
          home: const LoginPage(),
       );
    
    1. Build

    Expected Behavior It should display the correct page

    Solution Replace this in login/view/login_page.dart:

         return Provider(
          create: (context) =>
              ChangeNotifierProvider(create: (_) => LoginNotifier()),
          child: const Scaffold(
            body: LoginView(),
          ),
        );
    

    with this:

        return ChangeNotifierProvider(
          create: (context) => LoginNotifier(),
          child: const Scaffold(
            body: LoginView(),
          ),
        );
    

    or this:

        return MultiProvider(
          providers: [
            ChangeNotifierProvider(create: (_) => SettingsNotifier()),
          ],
          child: const Scaffold(
            body: LoginView(),
          ),
        );
    

    Additional Context Maybe I am implementing the widgets in the wrong way which is why I am getting this error. Please do let me know in case.

    bug 
    opened by ashishbeck-zeeve 2
  • Unable to execute hook pre_gen.dart fix:

    Unable to execute hook pre_gen.dart fix:

    model

    • [ x ] model

    Description \models> mason make model ? What is the models name? (model) users ? Does this model have a copyWith method? (Y/n) Yes ? Does this model use equatable? (Y/n) Yes ? Does this model use json? (Y/n) Yes Unable to execute hook: C:/Users/anypo/AppData/Local/Mason/Cache/hosted/registry.brickhub.dev/model_0.3.7\hooks\pre_gen.dart. Error: Unexpected type 'invalid-type' of a map spread entry. Expected 'dynamic' or a Map. ...context.vars, ^

    Steps To Reproduce

    See above

    Expected Behavior It creates the model.

    Screenshots N/A

    Additional Context I'm not sure what I'm doing wrong, but it used to work, any ideas?

    bug question waiting for response 
    opened by wednesdei 2
  • updated to use super parameters (new in dart 2.17)

    updated to use super parameters (new in dart 2.17)

    use these parameters instead of the old way.

    tutorial about super parameters. https://codewithandrea.com/tips/dart-2.17-super-initializers/

    Brick

    • [ ] model
    • [x] feature_brick
    • [ ] app_ui
    • [ ] service
    • [ ] service_package

    Status

    READY

    Breaking Changes

    NO

    Description

    I have edited the way of defining super parameters so there won't be a linting error in the IDE.

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ x] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    enhancement 
    opened by BartWesthoff 1
  • feat: always use package imports instead of relative imports

    feat: always use package imports instead of relative imports

    Description

    As a developer I want my imports to use package imports instead of relative imports.

    Desired Solution

    Get the working directory and save that into a variable for the template to use.

    Requirements

    • [x] Update this for model brick
    • [x] Update this for service brick
    • [x] Update this for service_package brick
    • [x] Update this for feature_brick

    Additional Context

    N/A

    enhancement 
    opened by LukeMoody01 1
  • feat: Change service method format to split on ' ' instead of '/'

    feat: Change service method format to split on ' ' instead of '/'

    Description

    As a developer, I would like to type my service methods format like -> 'String myMethod' instead of 'String/myMethod'.

    Desired Solution

    Instead of splitting at '/' we would need to split at ' '.

    Additional Context

    Very easy change :)

    enhancement 
    opened by LukeMoody01 1
  • feat: Change model format to split on ' ' instead of '/'

    feat: Change model format to split on ' ' instead of '/'

    Description

    As a developer, I would like to type my model format like -> 'String myString' instead of 'String/myString'.

    Desired Solution

    Instead of splitting at '/' we would need to split at ' '.

    Additional Context

    Very easy change :)

    enhancement 
    opened by LukeMoody01 1
  • fix: Update basic_to_json to use current instance

    fix: Update basic_to_json to use current instance

    Brick

    • [x] model
    • [ ] feature_brick
    • [ ] app_ui
    • [ ] service
    • [ ] service_package

    Status

    READY

    Breaking Changes

    NO

    Description

    Type of Change

    • [x] ✨ New feature (non-breaking change which adds functionality)
    • [x] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    enhancement 
    opened by LukeMoody01 0
  • feat: models_bundle 0.0.1

    feat: models_bundle 0.0.1

    Brick

    • [ ] model
    • [x] models_bundle
    • [ ] feature_brick
    • [ ] feature_brick_tests
    • [ ] app_ui
    • [ ] service
    • [ ] service_package

    Status

    READY

    Breaking Changes

    NO

    Description

    The initial creation of the models_bundle

    Type of Change

    • [x] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    enhancement 
    opened by LukeMoody01 0
  • feat: New brick - models_bundle

    feat: New brick - models_bundle

    Brick

    • [ ] model
    • [x] models_bundle
    • [ ] feature_brick
    • [ ] app_ui
    • [ ] service
    • [ ] service_package

    Description

    As a developer/user, I want a models_bundle brick, so that we can generate multiple models at the same time.

    Use case: When we are creating a new project/feature, we can define the known models and accelerate the development instead of running the model brick multiple times

    Desired Solution

    Create a new brick called models_bundle This brick will mainly wrap the existing model brick, and loop through the models in the config

    Alternatives Considered

    N/A

    Additional Context

    N/A

    enhancement 
    opened by LukeMoody01 0
  • feat(model): Handle nullable model types

    feat(model): Handle nullable model types

    Brick

    • [x] model
    • [ ] feature_brick
    • [ ] app_ui
    • [ ] service
    • [ ] service_package

    Status

    READY

    Breaking Changes

    NO

    Description

    Using the model brick to generate a model with the configuration containing nullable types produces unexpected results.

    sample.config.json
    {
      "model_name": "sample_model",
      "additionals": ["copyWith", "json"],
      "style": "freezed",
      "properties": [
        { "name": "id", "type": "String" },
        { "name": "content", "type": "String?" },
        { "name": "createdAt", "type": "DateTime" },
        { "name": "updatedAt", "type": "DateTime?" },
        { "name": "comments", "type": "List<String?>" },
        { "name": "sampleNulls", "type": "List<String?>?" }
      ]
    }
    

    The configuration file above generates the following results with freezed (Though the results are similar for other configurations)

    sample_model.dart
    import 'package:freezed_annotation/freezed_annotation.dart';
    
     
    part 'sample_model.freezed.dart';
    part 'sample_model.g.dart';
    
    /// {@template sample_model}
    /// SampleModel description
    /// {@endtemplate}
    @freezed
    class SampleModel with _$SampleModel {
      /// {@macro sample_model}
      const factory SampleModel({ 
        required String id,
        required String? content,
        required DateTime createdAt,
        required DateTime? updatedAt,
        required List<String?> comments,
        required List<String?>? sampleNulls,
      }) = _SampleModel;
      
        /// Creates a SampleModel from Json map
      factory SampleModel.fromJson(Map<String, dynamic> data) => _$SampleModelFromJson(data);
    }
    

    Which clearly indicates that the nullable types are still marked as required but would be better modelled as optional named parameters. Resulting in

    sample_model.dart
    import 'package:freezed_annotation/freezed_annotation.dart';
    
     
    part 'sample_model.freezed.dart';
    part 'sample_model.g.dart';
    
    /// {@template sample_model}
    /// SampleModel description
    /// {@endtemplate}
    @freezed
    class SampleModel with _$SampleModel {
      /// {@macro sample_model}
      const factory SampleModel({ 
        required String id,
        String? content,
        required DateTime createdAt,
        DateTime? updatedAt,
        required List<String?> comments,
        List<String?>? sampleNulls,
      }) = _SampleModel;
      
        /// Creates a SampleModel from Json map
      factory SampleModel.fromJson(Map<String, dynamic> data) => _$SampleModelFromJson(data);
    }
    

    Type of Change

    • [x] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    opened by wizlif 1
  • feat: Add freezed support to feature_brick

    feat: Add freezed support to feature_brick

    Brick

    • [ ] model
    • [x] feature_brick
    • [ ] app_ui
    • [ ] service
    • [ ] service_package

    Status

    READY

    Breaking Changes

    NO

    Description

    I used Freezed in conjunction with BLoC, and this commit adjusts the templates to support that. This change is purely additive in that nothing changes whatsoever if you do choose to use Freezed. If you do use Freezed, you don't need Equatable so I dropped that.

    The most significant change is that you can no longer part everything, since the _event and _state files already part with their generated code. Therefore you need to import them as you would a standard file.

    Type of Change

    • [x] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    enhancement 
    opened by AdamBuchweitz 5
  • feat: Generate tests file template for feature_brick

    feat: Generate tests file template for feature_brick

    Description

    As a developer, I would like my tests file to be generated and formatted when using the feature_brick brick

    Requirements

    • [x] Add Widget Tests template
    • [x] Add Bloc Tests template
    • [x] Add Cubit Tests template
    • [ ] Add Provider Tests template
    • [ ] Add Riverpod Tests template

    Additional Context

    N/A

    enhancement 
    opened by LukeMoody01 0
Owner
Luke Moody
Flutter | Dart | C# | .NET
Luke Moody
A collection of templates to make new Flutter components using the Mason build tool.

Mason Flutter Templates A collection of templates to make new Flutter components using the Mason build tool. Setup in Project To use these templates i

Marcus Twichel 5 Jun 21, 2022
A customized GestureDetector that acts on holding a determined Widget

holding_gesture A customized GestureDetector that acts on holding a determined Widget. Getting Started import 'package:holding_gesture/holding_gesture

GildΓ‘sio Filho 20 Nov 24, 2022
Useful Flutter UI Templates

Flutter UI Templates Useful Flutter UI Templates App Main Page Sign In Sign Up Splash Screen Template Type Status Sign In OK Sign Up OK Splash Screen

Egemen MEDE 4 Nov 13, 2022
A Huge Collection of Flutter App templates

Awesome Flutter Templates A Collection of Flutter Application templates. Flutter is Google’s UI toolkit for building beautiful, natively compiled appl

Lokesh Jangid 70 Dec 22, 2022
Code Snippets of highly interactive Flutter Templates that can be implemented in a Native Flutter App.

Native Frontend Flutter About the Repository We are on a mission to make things easy and convenient for all the users who just want to save their time

Dezenix 19 Sep 5, 2022
End-to-end mobile app templates that other developers can use during their Flutter development journey.

Flutter UI Templates Welcome Contributors ?? The Robotics Forum always encourages new ideas. Aim ?? Main aim of this repository is to make things fast

The Robotics Forum, VIT Pune 8 Dec 18, 2022
This repository contains Collection of UIs made using Flutter. Original Design of all the UIs were created by someone else. I tried to recreate those UIs using Flutter

Flutter-UIs-Collection This repository contains Collection of UIs made using Flutter. Original Design of all the UIs were created by someone else. I t

Mohak Gupta 45 Nov 26, 2022
This repository is meant to save all the code I may write about this course.

COD3R - Aprenda Flutter & Dart e Construa APPs iOS e Android ?? Idea: This repository is meant to save all the code and projects I may write with this

Amanda Cleto 2 Mar 9, 2022
This repository contains all the dart/flutter files of Android Studio

My First Flutter Appp A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you st

Ahmed Jinsar 0 Sep 5, 2022
Find The Latest trending and upcoming movies and tv shows with MovieDB app. The app contains all info about movies and tv shows. find similar movies or shows, Browse all genres, video trailers, backdrops, logos, and posters.

MovieDB App Features. Dynamic Theming Search Functionality Onboarding-Screen Select favourite movie Home Screen Tranding movie Movies different catego

Ansh rathod 80 Dec 12, 2022
Tasawq App β€” Flutter framework and Firebase An application that objectives to display all nearby stores of all kinds and real estate.

Tasawq App β€” Flutter framework and Firebase An application that objectives to display all nearby stores of all kinds and real estate. Multi-vendor, standard user login to view nearby products and stores for rating, follow-up, messaging and more

null 1 Nov 10, 2022
It's a universal app template to have a great animated splash screen and liquid slider. Just change the animation if you want (rive) and change the images or colours according to your app.

liquid 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

Zikyan Rasheed 28 Oct 7, 2022
Wired Elements is a series of basic UI Elements that have a hand drawn look. These can be used for wireframes, mockups, or just the fun hand-drawn look.

wired_elements Wired Elements is a series of basic UI Elements that have a hand drawn look. These can be used for wireframes, mockups, or just the fun

Kevin Zhang 20 Dec 1, 2022
Automatically generate profile picture with random first name and background color. But you can still provide pictures if you have them. As the default color, based on the name of the first letter. :fire: :fire: :fire:

FLUTTER PROFILE PICTURE Automatically generate profile picture with random first name and background color. But you can still provide pictures if you

Aditya Dharmawan Saputra 10 Dec 20, 2022
Interview questions and answers for preparation, built in pure flutter also have CI implementation for learning.

toughest An app for interview preparation. Unique animations. More than 100 questions and answer. Good UI. Featured in many websites. For Vietnam user

Md Sadab Wasim 239 Dec 27, 2022
A flutter package that developers have pretty logs instead just printing everything like a newbie

A flutter package that developers have pretty logs instead just printing everything like a newbie. Features Makes it easy to log to console without us

null 2 Nov 28, 2021
A library that helps you have multiple snackbars as a column

multi_snackbar A set of commands that helps you display more than one snackbar at the same time. Getting Started Make a list of widgets: var widgets =

Armin 1 Dec 23, 2021
This application was created using the Dart language and it is an application that contains a set of different questions and at the end shows you the number of correct answers you have answered , made by flutter

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

null 0 Dec 28, 2021
User auth form - Signup and signin user auth form with ability to stay signed in and have an option to signout.

user_auth_form SIgnup and signin user authentification form Getting Started This project is a starting point for a Flutter application. A few resource

null 0 Jan 6, 2022