import 'dart:async';
import 'dart:convert';
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:http/io_client.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_launcher/url_launcher.dart';

part '../providers/session_provider.dart';
part '../services/api_client.dart';
part '../services/session_store.dart';
part '../screens/login/login_screen.dart';
part '../screens/dashboard/dashboard_screen.dart';
part '../screens/examinations/examination_list_screen.dart';
part '../screens/examinations/examination_detail_screen.dart';
part '../screens/expertise/expertise_screen.dart';
part '../screens/expertise/template_picker.dart';
part '../screens/expertise/cci_expertise_wizard.dart';
part '../screens/expertise/kultur_expertise_wizard.dart';
part '../screens/expertise/pewarnaan_langsung_expertise_wizard.dart';
part '../screens/expertise/viral_load_expertise_wizard.dart';
part '../screens/expertise/leptospira_expertise_wizard.dart';
part '../screens/expertise/covid_expertise_wizard.dart';
part '../screens/expertise/tbc_expertise_wizard.dart';
part '../screens/expertise/expertise_form.dart';
part '../data/expertise_data.dart';
part '../widgets/common_widgets.dart';

const String kAppShortName = 'MyLIS';
const String kAppLongName =
    'Mikrobiology Laboratory Information System';
const String kHospitalName = 'Rumah Sakit Umum Daerah Dr. Saiful Anwar';
const String kAppLogoAsset = 'assets/branding/logo.png';
const String kHospitalLogoAsset = 'assets/branding/logo_rssa.png';

const String kDefaultBaseUrl = String.fromEnvironment(
  'LIS_BASE_URL',
  defaultValue: 'http://10.10.123.218',
);

class MyLisApp extends StatelessWidget {
  const MyLisApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: kAppLongName,
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(
          seedColor: const Color(0xFF0F766E),
          brightness: Brightness.light,
        ),
        scaffoldBackgroundColor: const Color(0xFFF7FAF9),
        useMaterial3: true,
      ),
      home: const SessionGate(),
    );
  }
}
