Skip to content

Instantly share code, notes, and snippets.

View Shuvo8693's full-sized avatar

Shuvo Khandaker Shuvo8693

View GitHub Profile
@Shuvo8693
Shuvo8693 / abstract class implementation on Bank account
Created February 26, 2024 21:37
abstract class on Accountability an Bank Account
abstract class Account{
int accountNumber;
double accountBalance;
Account(this.accountNumber,this.accountBalance);
void deposit(double amount)=> accountBalance += amount;
void withdraw(double amount);
@Shuvo8693
Shuvo8693 / reduce() & fold() for compile a single value
Created February 25, 2024 23:39
added the List Items by Loop or Iteration
add List of sum in a sigle value by this way -------------------------------
void main() {
List<double> itemPrice= [15.99, 18.75, 21.40, 53.09];
double sum=0;
double totalPrice=0;
var numbers= itemPrice.map((value)=> value).reduce((previous,present)=>previous+present); // we can use also fold() function
// for (double item in itemPrice) {
// sum+=item;
// totalPrice= sum * 1.05; // eta 5% vat soho
@Shuvo8693
Shuvo8693 / OOP(Constructor Method)
Created February 25, 2024 23:33
student details with OOP(Constructor Method)
void main() {
Student student = Student(); // here we can also provide values
student.sayHello();
print(student.getRollSquared());
student.getAddress();
}
class Student{