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
{ | |
"name": "todo", | |
"version": "0.0.1", | |
"private": true, | |
"scripts": { | |
"start": "node node_modules/react-native/local-cli/cli.js start", | |
"test": "jest" | |
}, | |
"dependencies": { | |
"babel-plugin-module-resolver": "^3.1.1", |
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
docker kill $(docker ps -q) && \ | |
docker rm $(docker ps -a -q) |
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
abstract class BaseEvent<State, Bloc> { | |
Stream<State> call(Bloc bloc); | |
} | |
class AuthBloc extends Bloc<AuthEvent, AuthState> { | |
@override | |
AccountsState get initialState => InitialAuthState(); | |
@override | |
Stream<AccountsState> mapEventToState(AuthEvent event) async* { |
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
// Single-line comments | |
/* | |
* Multi-line comments | |
*/ | |
/// | |
/// Documentation comments | |
/// |
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
/// Every app must have a top-level main() function, which serves as the entrypoint to the app. | |
void main() { | |
print('Hello, World!'); | |
} |
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() { | |
// dynamic can take any type | |
dynamic dy1 = 'Text'; | |
dy1 = 2; | |
// String type | |
String s1 = 'Hello'; | |
String s2 = "World"; | |
String s3 = ''' |
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() {} |
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() { | |
// List | |
List<int> list1 = [1, 2, 3]; // List<int> | |
List<int> list3 = []; // Empty list | |
List<String> list2 = ['', 'sdf', '']; | |
int item0List1 = list1[0]; // read value | |
list1[0] = 5; // set value for index = 0 | |
list3 = [ |
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() { | |
/// Uninitialized variables have an initial value of null. Even variables with numeric types are initially null, because numbers—like everything else in Dart—are objects. | |
int lineCount; | |
assert(lineCount == null); // woesn't work in dartpad | |
print(lineCount); | |
// Note: Production code ignores the assert() call. During development, on the other hand, assert(condition) throws an exception if condition is false. For details, see Assert. | |
} |
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() { | |
// var | |
var variable = 1; // equivalent to int a1 = 1, type calculated from right part | |
variable = 2; // var can be mutated | |
// final | |
final imutableVariable = 'object 1'; // final is imutable | |
final imutableVariable2 = 'object 1'; // will create additional instance of string 'object 1' |
OlderNewer