import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:get/get.dart';
import 'package:injectable/injectable.dart';

import '../../base/base_controller.dart';

@injectable
class BrowserController extends BaseController {
  final String tag = 'BrowserController';

  String url = (Get.arguments is String) ? (Get.arguments as String) : '';

  InAppWebViewController? webViewController;

  final title = ''.obs;

  Future<bool> handleBack() async {
    if (await webViewController?.canGoBack() ?? false) {
      webViewController?.goBack();
      return false;
    }
    return true;
  }
}
