Rultech Base Project
Version 1.0.5
A RulTech Base Class Package built using Flutter.
Table of Contents
- Rultech Base Project
Getting Started
Built with
- Flutter Version : v3.41.4
- Getx , get_cli, get_storage
- More Info gitlab.rultech.in/rultechpubliclib/rt_base/-/wikis/home
Basic Commands
-
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)
-
Create new page
get create page:page_name -
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
--skipProviderto not generate provide) -
To Generate Provider later on use following command
get create provider:user on home
Important Links
Getx
get_cli
get_storage
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 buttonRtDefaultSmallButton- Compact button (1/3 width)RtDefaultAppThemeColoredButton- Theme-colored buttonRtDefaultTextController- Text field with password toggleRtDefaultDropdownController- Dropdown form fieldRtDefaultSwitchController- Labeled toggle switch
Image Widgets:
RtEasyImageView- Interactive image viewer with CachedNetworkImageRtFullscreenImage- Fullscreen image viewer with zoom/pan/rotateRtGetMaterialApp- GetMaterialApp with deep linking support
Calendar:
HorizontalWeekCalendar- Horizontal scrollable week calendar
Dialogs:
RtChangeServerDialog- Server configuration dialogRtGlobalBottomSheet- Bottom sheet utilities
Other:
RtLinearProgressIndicator- Progress bar widgetRtTrianglePainter- Custom triangle painterRtCommonWidgets- 40+ widget utility methods
Models
Google Places API Models:
Prediction- Autocomplete prediction with matched substringsPlaceAutoComplete- Autocomplete response wrapperPlaceDetail- 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 constantsGetStorageManager- GetStorage singleton wrapperRtPermissionService- Camera, photo, location permissions
Constants:
RtAppConstants- UI constants with 5 mixins (colors, dimensions, fonts, etc.)RtAppFontFamily- Font family definitionsRtAppStrings- 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.
Libraries
- app/core/extension/rt_common_function
- app/core/extension/rt_get_storage_manager
- app/core/extension/rt_permission_service
- app/core/rt_base_binding
- app/core/rt_base_controller
- app/core/rt_base_deeplink
- app/core/rt_base_view
- app/core/utils/rt_app_validations
- app/core/utils/rt_utils
- app/core/values/rt_app_constants
- app/core/values/rt_app_font_family
- app/core/values/rt_app_strings
- app/core/values/rt_base_helper
- app/models/auto_complete_prediction
- app/models/place_auto_complete
- app/models/place_detail
- app/widgets/rt_change_server_dialog
- app/widgets/rt_common_widgets
- app/widgets/rt_default_dropdown_controller
- app/widgets/rt_default_switch_controller
- app/widgets/rt_default_text_controller
- app/widgets/rt_easy_image_view
- app/widgets/rt_fullscreen_image
- app/widgets/rt_get_material_app_deep_link
- app/widgets/rt_global_bottom_sheet
- app/widgets/rt_horizontal_week_calendar
- app/widgets/rt_linear_progress_indicator
- app/widgets/rt_triangle_painter
- app/widgets/text_field_input_formatter
- package_export_generator
- rtbase
- RtBase - A comprehensive Flutter base package providing essential utilities and widgets.