Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>repoMakerNew to Visual Studio Code? Get it now.
repoMaker

repoMaker

omaralam

|
19 installs
| (2) | Free
make a repo in dart fast
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Repo Template Extension

Overview

The Repo Template Extension is a Visual Studio Code extension that allows you to create a new repository from a template with customizable variables. Right-click on a folder in the VS Code Explorer and select "Create New Repo from Template" to get started.

Features

  • Add a right-click context menu item for folders in the VS Code Explorer.
  • Prompt for user input to customize the repository template.
  • Automatically generate a Dart file based on the provided template and user inputs.

Installation

  1. Download and install Visual Studio Code from here.
  2. Clone this repository or download the latest release.
  3. Open the project in Visual Studio Code.
  4. Install the required dependencies by running:
    npm install
    
  5. Compile the extension by running:
    npm run compile
    

Usage

  1. Open Visual Studio Code.
  2. Right-click on a folder in the Explorer pane.
  3. Select "Create New Repo from Template".
  4. Enter the required variables when prompted:
    • variable1: Name of the class.
    • variable2: Type of the class used in the response.
    • variable4: Endpoint for the API call.
  5. The extension will generate a new Dart file in the selected folder based on the provided inputs.

Commands

1. Create New Repository Template

Command: repohelper.createNewRepo

Prompts for class name, model, request type (GET or POST), and endpoint name. Generates a repository template.

2. Sync Cubit States

Command: repohelper.syncCubitStates

Identifies missing states in the Cubit state file. Adds missing states.

Snippets

BlocProvider Static Method

Prefix: OMBlocProvider

Generates a static method for BlocProvider.of.

Pagination State Class

Prefix: OMpaginationModel

Generates a PaginationState model and PaginationStatus enum.

Pagination Cubit with Fetch and Load More

this depends on previous prefix

Prefix: OMpaginationCubit

Generates a Cubit with fetch and load more data methods. Fetch All Item Data Method Prefix: OMfetchAllItemData

Generates a method for fetching items in a Bloc cubit and emitting appropriate states.

Dart POST Method

Prefix: RPost

Generates a POST repository method for API interaction using Dio and Either.

Dart GET Method

Prefix: RGet

Generates a GET repository method for API interaction using Dio.

Flutter State Handling

Prefix: ErrorStateHandling

Generates a widget to handle different states in a Cubit builder.

Example

  1. Right-click on a folder and select "Create New Repo from Template".
  2. Enter the following values when prompted:
    • variable1: MyNewClass
    • variable2: User
    • variable4: loginEndpoint
  3. The extension generates a Dart file MyNewClass.dart with the following content:
import 'package:dartz/dartz.dart';
import 'package:dio/dio.dart';
import 'package:your_project/helpers/dio_helper.dart';
import 'package:your_project/helpers/endpoints.dart';
import 'package:your_project/models/server_failure.dart';
import 'package:your_project/models/user.dart';
import 'dart:convert';

class MyNewClass {
    Future<Either<String, User>> login() async {
        try {
            final response = await DioHelper.post(EndPoints.loginEndpoint, body: {
                // Add your body here
            }, headers: {
                'Accept': 'application/json',
            });

            return Right(User.fromJson(jsonDecode(response.toString())));
        } catch (e) {
            if (e is DioException) {
                return Left(ServerFailure.fromDioError(e).errMessage);
            }
            return Left(e.toString());
        }
    }
}



  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft