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 dart_application_1/.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 dart_application_1/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0.0

- Initial version.
52 changes: 52 additions & 0 deletions dart_application_1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

# Project 1

A project for a library of books and the creation of crud processes inside it.

## Project Operations

#### 1- Add Books

The process of adding books so that the user can add many books.

#### 2- Delete Books

The method of deletion so that each user can delete the book he wants

#### 3- Query Books

Searches within the project are available for the user to search for books and the desired number of pages

#### 4- Purchase

Payments within the project allow the user to pay the amount of the book and then view the books he has purchased

#### 5- Invoice

View invoices after purchases with important details that benefit the seller and buyer





## This Project Used By

This project is used by the following companies:

- Dart
- Git - Github


## Resources



[Dart Tutorials](https://dart.dev/tutorials)








30 changes: 30 additions & 0 deletions dart_application_1/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
95 changes: 95 additions & 0 deletions dart_application_1/bin/dart_application_1.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@

import 'dart:io';

import 'data.dart';

void main(List<String> arguments) {
var count = 0;
while (count < 10) {
print("please select from menu:");
print("1: add new ,2: display data, Q: quite");
String selected = stdin.readLineSync()!;

switch (selected) {
case "1":
addNewItem();
break;

case "2":
displayItem();
break;

case "Q" || "q":
exit(0);

default:
print("where are you");
}
count++;
}
}

addNewItem() {
try {
print("please inter your name");
String author = stdin.readLineSync() ?? "John";
print("please inter your age");
String country = stdin.readLineSync() ?? "John";
print("please inter your secretIdentity");
String language = stdin.readLineSync() ?? "John";
print("please inter your secretIdentity");
int pages = int.parse(stdin.readLineSync()!);


List pawers = [];
do {
String enterPawers = stdin.readLineSync()!;

if (enterPawers == "q") {
break;
} else {
pawers.add(enterPawers);
}
} while (true);

final userMap = {
"author": author,
"country": country,
"language": language,
"pages": pages
};
myData.add(userMap);
} catch (error) {
print("error");
}
}

class Books {
late String author;
late String country;
late String language;
late int pages;
Books(
{required this.author,
required this.country,
required this.language,
required this.pages});
displayData() {
print("author:$author country: $country language: $language pages: $pages");
}
}

displayItem() {
List<Books> listItem = [];
for (var element in myData) {
listItem.add(Books(
author: element["author"],
country: element["age"],
language: element["language"],
pages: element["pages"]));
}
for (var item in listItem) {
print("------------");
item.displayData();
}
}
43 changes: 43 additions & 0 deletions dart_application_1/bin/data.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
final List myData = [
{
"author": "Chinua Achebe",
"country": "Nigeria",
"imageLink": "images/things-fall-apart.jpg",
"language": "English",
"link": "https://en.wikipedia.org/wiki/Things_Fall_Apart\n",
"pages": 209,
"title": "Things Fall Apart",
"year": 1958
},
{
"author": "Hans Christian Andersen",
"country": "Denmark",
"imageLink": "images/fairy-tales.jpg",
"language": "Danish",
"link":
"https://en.wikipedia.org/wiki/Fairy_Tales_Told_for_Children._First_Collection.\n",
"pages": 784,
"title": "Fairy tales",
"year": 1836
},
{
"author": "Dante Alighieri",
"country": "Italy",
"imageLink": "images/the-divine-comedy.jpg",
"language": "Italian",
"link": "https://en.wikipedia.org/wiki/Divine_Comedy\n",
"pages": 928,
"title": "The Divine Comedy",
"year": 1315
},
{
"author": "Unknown",
"country": "Sumer and Akkadian Empire",
"imageLink": "images/the-epic-of-gilgamesh.jpg",
"language": "Akkadian",
"link": "https://en.wikipedia.org/wiki/Epic_of_Gilgamesh\n",
"pages": 160,
"title": "The Epic Of Gilgamesh",
"year": -1700
}
];
3 changes: 3 additions & 0 deletions dart_application_1/lib/dart_application_1.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int calculate() {
return 6 * 7;
}
1 change: 1 addition & 0 deletions dart_application_1/lib/data.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// TODO Implement this library.
Loading