import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:injectable/injectable.dart';
import 'package:intl/date_symbol_data_local.dart';

import 'injection.dart';
import 'presentation/app_widget.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await initializeDateFormatting('id_ID', null);

  SystemChrome.setSystemUIOverlayStyle(
    const SystemUiOverlayStyle(
      statusBarColor: Colors.white, // background putih
      statusBarIconBrightness: Brightness.dark, // ikon/tulisan hitam
      statusBarBrightness: Brightness.light, // khusus iOS biar teksnya gelap
    ),
  );

  if (kReleaseMode) {
    debugPrint = (message, {wrapWidth}) => '';
  }

  await configureDependencies(
    kReleaseMode ? Environment.prod : Environment.dev,
  );

  runApp(const AppWidget());
}
