Rultech Base Project

Version 1.0.5

A RulTech Base Class Package built using Flutter.

Table of Contents


Getting Started

Built with

  1. Flutter Version : v3.41.4
  2. Getx , get_cli, get_storage
  3. More Info gitlab.rultech.in/rultechpubliclib/rt_base/-/wikis/home

Basic Commands

  1. Make Sure to active get_cli using flutter pub global activate get_cli or flutter pub global activate --source=git github.com/inyong1/get_cli.git (Read the issues or get_cli issues for specific compatibility)

  2. Create new page

    get create page:page_name

  3. Create model with/without provider

    get generate model on models with assets/models/model.json

    (Where model.json is json file in assets models folder, though it can be any where in the project. you cna use --skipProvider to not generate provide)

  4. To Generate Provider later on use following command

    get create provider:user on home

Getx

Getx pub.dev Link

Getx github Link

Getx Issues Link

get_cli

get-cli pub.dev Link

get-cli github Link

get-cli Issues Link

get_storage

GetStorage pub.dev Link

GetStorage github Link

GetStorage Issues Link

For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.


Description

RTBase is a comprehensive Flutter package that provides a robust foundation for building Flutter applications with GetX architecture. It bundles commonly used packages, pre-built widgets, utilities, and base classes to accelerate development and maintain consistency across RulTech projects.

Features

  • GetX Architecture Support: Pre-configured base classes for controllers, views, and bindings
  • Common Widgets: Ready-to-use UI components including buttons, text fields, dropdowns, switches, and more
  • Utility Functions: Helper methods for validation, permissions, storage management, and common operations
  • Deep Linking: Built-in support for GetMaterialApp with deep linking capabilities
  • Image Handling: Easy image viewing, fullscreen image support, and image compression utilities
  • Calendar Widget: Horizontal week calendar component
  • Form Validation: Pre-built validation utilities for common input types
  • Storage Management: GetStorage wrapper for simplified local data persistence
  • Permission Handling: Streamlined permission request and management
  • Bundled Dependencies: Includes commonly used packages like cached_network_image, carousel_slider, connectivity_plus, and more

Getting started

Prerequisites

  • Flutter SDK >=3.0.0 <4.0.0
  • Dart SDK >=3.0.0

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  rtbase:
    git:
      url: https://gitlab.rultech.in/rultechpubliclib/rt_base.git
      ref: v1.0.5

Then run:

flutter pub get

Initialize GetStorage

In your main.dart, initialize GetStorage before running the app:

import 'package:rtbase/rtbase.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await GetStorage.init();
  runApp(MyApp());
}

Usage

Basic Setup with Base Classes

import 'package:rtbase/rtbase.dart';

// Create a controller extending RtBaseController
class HomeController extends RtBaseController {
  var count = 0.obs;
  
  void increment() => count++;
  
  @override
  void onInit() {
    super.onInit();
    // Your initialization code
  }
}

// Create a view extending RtBaseView
class HomeView extends RtBaseView<HomeController> {
  @override
  Widget body(BuildContext context) {
    return Center(
      child: Obx(() => Text('Count: ${controller.count}')),
    );
  }
}

// Create a binding extending RtBaseBinding
class HomeBinding extends RtBaseBinding {
  @override
  void dependencies() {
    Get.lazyPut<HomeController>(() => HomeController());
  }
}

Using Pre-built Widgets

// Default Button
RtDefaultButton(
  label: 'Submit',
  onPressed: () => print('Button pressed'),
)

// Default Text Field
RtDefaultTextController(
  controller: textController,
  hintText: 'Enter text',
  validator: RtAppValidations.validateRequired,
)

// Default Dropdown
RtDefaultDropdownController(
  items: ['Option 1', 'Option 2', 'Option 3'],
  onChanged: (value) => print(value),
)

Storage Management

// Save data
GetStorageManager.saveData('key', 'value');

// Retrieve data
String? value = GetStorageManager.getData('key');

// Remove data
GetStorageManager.removeData('key');

Permission Handling

// Request camera permission
bool granted = await RtPermissionService.requestCameraPermission();

// Request location permission
bool granted = await RtPermissionService.requestLocationPermission();

API Documentation

RTBase provides comprehensive documentation for all components. Below is an overview of the main APIs:

Core Components

  • RtBaseController - Base GetX controller with pagination support
  • RtBaseView - Base view widget with platform-specific navigation
  • RtBaseBinding - Base binding for dependency injection
  • RtDeepLinking - Singleton service for deep link handling
  • RtUtils - Central utility facade providing access to all utilities

Widgets

Form Controls:

  • RtDefaultButton - Standard action button
  • RtDefaultSmallButton - Compact button (1/3 width)
  • RtDefaultAppThemeColoredButton - Theme-colored button
  • RtDefaultTextController - Text field with password toggle
  • RtDefaultDropdownController - Dropdown form field
  • RtDefaultSwitchController - Labeled toggle switch

Image Widgets:

  • RtEasyImageView - Interactive image viewer with CachedNetworkImage
  • RtFullscreenImage - Fullscreen image viewer with zoom/pan/rotate
  • RtGetMaterialApp - GetMaterialApp with deep linking support

Calendar:

  • HorizontalWeekCalendar - Horizontal scrollable week calendar

Dialogs:

  • RtChangeServerDialog - Server configuration dialog
  • RtGlobalBottomSheet - Bottom sheet utilities

Other:

  • RtLinearProgressIndicator - Progress bar widget
  • RtTrianglePainter - Custom triangle painter
  • RtCommonWidgets - 40+ widget utility methods

Models

Google Places API Models:

  • Prediction - Autocomplete prediction with matched substrings
  • PlaceAutoComplete - Autocomplete response wrapper
  • PlaceDetail - Complete place details with photos, reviews, hours, etc.

Utilities

Core Utilities:

  • RtCommonFunction - 18+ common utility methods (Gravatar, date formatting, dialogs, distance calculation)
  • RtAppValidations - Form validation constants
  • GetStorageManager - GetStorage singleton wrapper
  • RtPermissionService - Camera, photo, location permissions

Constants:

  • RtAppConstants - UI constants with 5 mixins (colors, dimensions, fonts, etc.)
  • RtAppFontFamily - Font family definitions
  • RtAppStrings - Centralized string constants

For complete API reference with examples, see the generated documentation.


Additional information

Documentation

Full API documentation is available in the doc/api folder. To generate the latest documentation, run:

dartdoc

Then open Detailed Dart Document in your browser.

More Information

Support

For issues, questions, or contributions, please contact the RulTech development team.

License

This package is proprietary software of RulTech and is not published to pub.dev.