Integrate logging system into Flutter app with service registration and testing setup
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttery/fluttery.dart';
|
||||
import 'package:fluttery/logger/logger.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
// Ensures that the Flutter engine and widget binding
|
||||
// are initialized before using async services or plugins
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
// any services
|
||||
App.registerDefaultServices();
|
||||
|
||||
final logger = App.service<Logger>();
|
||||
logger.debug("[MAIN] Registered all default services");
|
||||
|
||||
void main() {
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@ environment:
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
fluttery:
|
||||
path: ../fluttery
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
|
||||
Reference in New Issue
Block a user