import 'package:flutter/material.dart';

/// Created by Haoyi on 2023/1/16

abstract class GuruPackage {
  final String package;

  final List<GuruPackage> children = [];

  final int priority;

  final bool flattenChildrenAsyncInit;

  GuruPackage(this.package, {this.priority = 1, this.flattenChildrenAsyncInit = false});

  void addPackage(GuruPackage package) {
    children.add(package);
  }

  Future initialize();

  Future initializeAsync() async {}

  Future switchSession(String oldToken, String newToken) async {}

  Iterable<Locale> get supportedLocales;

  Iterable<LocalizationsDelegate<dynamic>> get localizationsDelegates;
}

abstract class RootPackage extends GuruPackage {
  RootPackage() : super("root");
}
