Untitled

 avatar
faisalsalameh
dart
a year ago
1.9 kB
7
Indexable
void main() {
  int i=0;
  List<int> anyList=[1,3,5,7]; 
  print(anyList.length);
}

class Alaa extends Alaa1{
  int age = 30;
  static String name = "alaa";
  double height = 195.5;
  double weight = 110;
  String noSalt(bool isSalt) {
    height1 =0;
    if (isSalt) {
      return "Angry";
    }
    return "Happy";
  }
}


class Alaa1 {
  int age1 = 30;
  static String name1 = "alaa";
  double height1 = 195.5;
  double weight1 = 110;
  
  String noSalt1(bool isSalt) {
    if (isSalt) {
      return "Angry";
    }
    return "Happy";
  }
}


// double bmr =
//       (88.362 + (13.397 * weight) + (4.799 * height!) - (5.677 * age!)) * 1.725;





String function3(String name) {
  if (name == "omar") {
    return name;
  }
  return "no name";
}

int function4(int number) {
  return number;
}

void bmrFunction({required double weight, double? height, double? age}) {
  if (height == null && age == null) {
    height = 157;
    age = 20;
  }
  if (height != null && age == null) {
    age = 20;
    print(height);
    print(age);
  }
  if (height != null && age != null) {
    print('all done');
  } else {
    print('no data');
  }

  double bmr =
      (88.362 + (13.397 * weight) + (4.799 * height!) - (5.677 * age!)) * 1.725;
  print(bmr);
}

// one of theme is enter age or height
// two of theme are entered
// check if age or height ar null
// resolve the error

// if(height == null && age == null){
//     height = 88;
//     age = 30;
//   }
//   if(height != null && age == null){
//      age = 30;
//   }
//   if(height == null && age != null){
//     height = 88;
//   }

// void function1( String name, int last){
//   print(name);
//   print(last);
// }

// void function({required String firstName,String? last}){
//   String fullName ='';
//   print(last);
//   if(last == null)
//   {
//     fullName = firstName ;
//   }
//   else
//   {
//     fullName = firstName +' '+ last;
//   }
//   print(fullName);
// }