rtbase 1.0.5
rtbase: ^1.0.5 copied to clipboard
RulTech Base Project
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 https://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 https://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 #
- Wiki: https://gitlab.rultech.in/rultechpubliclib/rt_base/-/wikis/home
- Homepage: https://www.rultech.com
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.