import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class AppLifecycleManager {
  static const platform = MethodChannel('com.sefer_driver/app_lifecycle');

  static Future<void> bringAppToForeground() async {
    try {
      debugPrint('Attempting to bring app to foreground');
      await platform.invokeMethod('bringAppToForeground');
      debugPrint('Method invocation completed');
    } on PlatformException catch (e) {
      debugPrint("Failed to bring app to foreground: '${e.message}'.");
    } catch (e) {
      debugPrint("Unexpected error: $e");
    }
  }
}
