main function

void main()

The root widget of the Fetosense Device Flutter application.

MyApp sets up the application's theme, routing, and dependency injection. It uses MultiBlocProvider to provide all required BLoC/Cubit instances throughout the widget tree, enabling state management for authentication, Bluetooth connection, mother registration, details, and test data.

Example usage:

void main() {
  runApp(const MyApp());
}

Implementation

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  SystemChrome.setPreferredOrientations([
    DeviceOrientation.landscapeLeft,
    DeviceOrientation.landscapeRight,
  ]).then((_) async {
    ServiceLocator.setupLocator();
    ServiceLocator.sharedPrefsHelper;
    PrefService.init();
    runApp(const MyApp());
  });
}