This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
getNameTitlesWithNames(childNames).forEach((e){ | |
print("\n${e.letterTitle!}"); | |
print(e.nameList); | |
}); | |
} | |
class EachTitledNameModel{ | |
String? letterTitle; | |
List<String>? nameList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
getNameTitlesWithNames(childNames).forEach((e){ | |
print("\n${e.letterTitle!}"); | |
print(e.nameList); | |
}); | |
} | |
class EachTitledNameModel{ | |
String? letterTitle; | |
List<String>? nameList=[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EachTitledNameModel{ | |
String? letterTitle; | |
List<String>? nameList=[]; | |
EachTitledNameModel ({this.letterTitle, this.nameList}); | |
} | |
List<EachTitledNameModel> getNameTitlesWithNames(List<String> nameList){ | |
List<EachTitledNameModel> sortedNameWithTitle = []; | |
nameList.sort(); | |
for(int i = 0; i<nameList.length; i++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EachTitledNameModel{ | |
String? letterTitle; | |
List<String>? nameList=[]; | |
EachTitledNameModel ({this.letterTitle, this.nameList}); | |
} | |
List<EachTitledNameModel> getNameTitlesWithNames(List<String> nameList){ | |
List<EachTitledNameModel> sortedNameWithTitle = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
// Creating a map of key-value pairs (int to String) | |
Map<int, String> studentData = { | |
3620301111: 'Ololade', | |
3620302222: 'Chukwuemeka', | |
3620303333: 'Umar', | |
}; | |
// Accessing values using keys | |
String ololadeName = studentData[3620301111]!; // 'Ololade' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
// ==================BASIC USAGE 1. | |
// Creating a list of integers | |
List<int> numbers = [1, 2, 3, 4, 5]; | |
// Creating a list of strings | |
List<String> fruits = ['apple', 'banana', 'cherry']; | |
// Adding elements to a list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
// ==================BASIC USAGE | |
// A bool variable can have two values: true or false. | |
bool isDartFun = true; | |
bool isProgrammingEasy = false; | |
bool isRaining = false; | |
bool isSunny = true; | |
// ==================BOOLEAN PROPERTIES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
// ==================BASIC USAGE 1. | |
String singleQ = 'Single quotes'; | |
String doubleQ ="Double quotes"; | |
String doubleQtInSingQt = 'Double quotes in "single" quotes'; | |
String singleQtInDblQt = "Single quotes in 'double' quotes"; | |
String multilineOne='''A | |
multiline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import the 'dart:math' library to access mathematical functions. | |
import 'dart:math'; | |
void main() { | |
// ==================BASIC USAGE | |
double height = 190.5; // Declare and initialize a double variable with a decimal value. | |
double weight = 78.2; | |
double temperature = 25.3; | |
double? distance; // Nullable double variable. | |
distance = 42.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import the 'dart:math' library to access mathematical functions. | |
import 'dart:math'; | |
void main() { | |
// ==================BASIC USAGE | |
double height = 190.5; // Declare and initialize a double variable with a decimal value. | |
double weight = 78.2; | |
double temperature = 25.3; | |
double? distance; // Nullable double variable. | |
distance = 42.0; |