init method Null safety
Description
This static method initializes a MotorFlutter instance and Injects it into Get state management.
Example
import 'package:motor_flutter/motor_flutter.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized(); // This is required for Flutter apps.
await MotorFlutter.init(); // This initializes the MotorFlutter instance.
runApp(MyApp()); // This is the entry point of the application.
}
Next Steps:
- Register a new user with createAccount
- Login with an existing account using login
- ADR-1
Implementation
static Future<void> init() async {
await Get.putAsync(
() => MotorFlutter()._init(),
permanent: true,
);
}