Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ooplab/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/
3 changes: 3 additions & 0 deletions ooplab/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0.0

- Initial version.
2 changes: 2 additions & 0 deletions ooplab/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
A sample command-line application with an entrypoint in `bin/`, library code
in `lib/`, and example unit test in `test/`.
30 changes: 30 additions & 0 deletions ooplab/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

include: package:lints/recommended.yaml

# Uncomment the following section to specify additional rules.

# linter:
# rules:
# - camel_case_types

# analyzer:
# exclude:
# - path/to/excluded/files/**

# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints

# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options
69 changes: 69 additions & 0 deletions ooplab/bin/event.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import 'dart:io';
import 'dart:math';

//Event class display events with it is name,id,date and supervisor name
class Events {
//Attrabutes
String? name = stdin.readLineSync();
String? id = "${Random().nextInt(999)}";
String? supervisor = stdin.readLineSync();
String? date = stdin.readLineSync();

//constactor
Events({
required this.name,
required this.id,
required this.supervisor,
required this.date,
});
List<Map<String, dynamic>> enventListMap = [{}];

//functions
//this function will add new event
addEvent() {
Map<String, dynamic> envent = {
"name": name,
"id": id,
"supervisor": supervisor,
"date": date,
};
enventListMap.add(envent);


print("* Event add successfully *");
print("\n");
print("your ID is $id ");

stdin.readLineSync(); //for new line after display
}

//this function will display all event
displayEvent({required List<Map<String, dynamic>> eventDisplay}) {
for (var element in eventDisplay) {
print(" All Events ");
print(" Event number is ${element["name"]}");
print(" ID is ${element["id"]}");
print(" supervisor is ${element["supervisor"]}");
print(" Date of event is ${element["date"]}");
}
stdin.readLineSync(); //for new line after display
}

//this function will remove event by event id
removeEvent({required String eventId}) {
Map<String, dynamic> event = {};
for (var element in enventListMap) {
if (element["id"] == eventId) {
event = element;
break;
}
}
//to ensure the number enterd founds
if (event.isNotEmpty) {
enventListMap.remove(event); // this function remove id
} else {
print("Event number $eventId not found! ");
}
stdin.readLineSync(); //for new line after display
}
}
69 changes: 69 additions & 0 deletions ooplab/bin/ooplab.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import 'dart:io';
import 'dart:math';

//Event class display events with it is name,id,date and supervisor name
class Events {
//Attrabutes
String? name = stdin.readLineSync();
String? id = "${Random().nextInt(999)}";
String? supervisor = stdin.readLineSync();
String? date = stdin.readLineSync();

//constactor
Events({
required this.name,
required this.id,
required this.supervisor,
required this.date,
});
List<Map<String, dynamic>> enventListMap = [{}];

//functions
//this function will add new event
addEvent() {
Map<String, dynamic> envent = {
"name": name,
"id": id,
"supervisor": supervisor,
"date": date,
};
enventListMap.add(envent);


print("* Event add successfully *");
print("\n");
print("your ID is $id ");

stdin.readLineSync(); //for new line after display
}

//this function will display all event
displayEvent({required List<Map<String, dynamic>> eventDisplay}) {
for (var element in eventDisplay) {
print(" All Events ");
print(" Event number is ${element["name"]}");
print(" ID is ${element["id"]}");
print(" supervisor is ${element["supervisor"]}");
print(" Date of event is ${element["date"]}");
}
stdin.readLineSync(); //for new line after display
}

//this function will remove event by event id
removeEvent({required String eventId}) {
Map<String, dynamic> event = {};
for (var element in enventListMap) {
if (element["id"] == eventId) {
event = element;
break;
}
}
//to ensure the number enterd founds
if (event.isNotEmpty) {
enventListMap.remove(event); // this function remove id
} else {
print("Event number $eventId not found! ");
}
stdin.readLineSync(); //for new line after display
}
}
3 changes: 3 additions & 0 deletions ooplab/lib/ooplab.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int calculate() {
return 6 * 7;
}
Loading