add<T extends Widget> method

WidgetPluginBuilder add <T extends Widget>(
  1. WidgetBuilder builder,
  2. {List<String> aliases}
)

Implementation

WidgetPluginBuilder add<T extends Widget>(WidgetBuilder builder,
    {List<String> aliases}) {
  final type = VoyagerUtils.stringTypeOf<T>();
  if (type == "Widget") {
    /// method used without specifying T
    throw ArgumentError(
        "Use addMethod if you can't provide Widget class as T parameter");
  }
  return addMethod(builder, type, aliases: aliases);
}