CommandModelOS constructor
CommandModelOS({})
Implementation
CommandModelOS({
required super.title,
super.description,
super.external,
this.commonAction,
this.winAction,
this.macAction,
this.linuxAction,
}) {
if (commonAction != null) {
command = commonAction!();
} else if (Platform.isWindows) {
if (winAction == null) {
// fixme: refactor
// throw AppException(
// message: "Action for windows is not defined for $title command");
}
command = winAction!();
} else if (Platform.isMacOS) {
if (macAction == null) {
// fixme: refactor
// throw AppException(
// message: "Action for mac is not defined for $title command");
}
command = macAction!();
} else if (Platform.isLinux) {
if (linuxAction == null) {
// fixme: refactor
// throw AppException(
// message: "Action for linux is not defined for $title command");
}
command = linuxAction!();
} else {
// fixme: refactor
// throw AppException(message: "Invalid OS. Please implement first.");
}
}