Files
AutoGPT/classic/frontend/lib/utils/stack.dart
Swifty ef7cfbb860 refactor: AutoGPT Platform Stealth Launch Repo Re-Org (#8113)
Restructuring the Repo to make it clear the difference between classic autogpt and the autogpt platform:
* Move the "classic" projects `autogpt`, `forge`, `frontend`, and `benchmark` into a `classic` folder
  * Also rename `autogpt` to `original_autogpt` for absolute clarity
* Rename `rnd/` to `autogpt_platform/`
  * `rnd/autogpt_builder` -> `autogpt_platform/frontend`
  * `rnd/autogpt_server` -> `autogpt_platform/backend`
* Adjust any paths accordingly
2024-09-20 16:50:43 +02:00

21 lines
314 B
Dart

class Stack<T> {
final List<T> _list = [];
void push(T element) {
_list.add(element);
}
T pop() {
var element = _list.last;
_list.removeLast();
return element;
}
T peek() {
return _list.last;
}
bool get isEmpty => _list.isEmpty;
bool get isNotEmpty => _list.isNotEmpty;
}