This file contains hidden or 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() { | |
runApp(const App()); | |
} | |
class App extends StatelessWidget { | |
const App({ | |
super.key, | |
this.feeds = const [ | |
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi at tempor eros. Aenean ipsum elit, porttitor id pretium id, vehicula non sapien. Praesent consequat quis urna vel bibendum. Praesent quis mauris porta, ultricies ligula ac, suscipit lorem. In ut aliquet dui. Cras id turpis nec erat ultricies semper. Sed pellentesque, augue nec consequat tempor, erat tortor gravida ipsum, at maximus nulla enim nec nulla. Suspendisse eu lobortis eros, ac placerat tellus. Aenean ultricies, justo eget consequat scelerisque, nunc arcu laoreet.', | |
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi at tempor eros. Aenean ipsum elit, porttitor id pretium id, vehicula non sapien.', |
This file contains hidden or 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 'package:crypto/crypto.dart'; | |
void main { | |
final key = Key.fromUtf8('qwertyuiopasdfghjklzxcvbnmqwertyuiop'); | |
final encrypter = Encrypter(AES(key)); | |
encrypted = encrypter.encrypt('stringToEncrypt', iv: IV.fromLength(16)); | |
} |
This file contains hidden or 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 'dart:math'; | |
main() { | |
var rng = Random(); | |
final list = <int>[]; | |
while (list.length < 10) { | |
final int randomNumber = rng.nextInt(100); | |
This file contains hidden or 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() { | |
b(() => print('I am function a passed to function b')); | |
} | |
/// Calling a function a from b | |
void b(Function a) { | |
print('This is the beginning of function b'); | |
print('before calling function a from b'); | |
a(); | |
print('after calling function a'); |
This file contains hidden or 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() {} | |
/// A piece of code checking for errors using exceptions | |
/// Checking using exceptions | |
void checkingForExceptions() { | |
try { | |
/// performing operation | |
} on FormatException { | |
/// Handle exception |
This file contains hidden or 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
/// Please note that some instantiations are to be done in the main method | |
/// I placed it orderly (following the class created) for clarity and simplicity. | |
void main() {} | |
/// OOP is a computer programming model that organizes software development around entities | |
/// and objects, rather than functions and logic. | |
/// The building blocks of OOP includes the: |
This file contains hidden or 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 'package:intl/intl.dart'; | |
void main() { | |
/// This assessment is done using the Dart Programming Language | |
/// The next lines of code describes a snippet of code violating the DRY Principle | |
/// DRY basically means "Don't Repeat Yourself" and it is aimed at reducing repititions in Software Engineering | |
/// A snippet of code violating the DRY principle | |
/// In the code below I need to format two dates [startDate] and [endDate] using a dart |
This file contains hidden or 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 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
void main() { | |
runApp( | |
MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: CustomAppBarDemo(), | |
), | |
); |