Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 'package:flutter/material.dart'; | |
// My answer to | |
// https://stackoverflow.com/questions/61443845/how-to-replicate-this-specific-android-constraint-layout-on-flutter | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
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
#!/usr/bin/env python | |
__author__ = 'Kevin Warrick' | |
__email__ = '[email protected], [email protected]' | |
__version__ = '2.0.0' | |
import pickle | |
from collections import namedtuple | |
from functools import wraps | |
import inspect | |
from icecream import ic |
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
library dedent; | |
// Translation of Python textwrap.dedent algorithm | |
// https://github.com/python/cpython/blob/eb97b9211e7c99841d6cae8c63893b3525d5a401/Lib/textwrap.py | |
import 'package:quiver/iterables.dart'; | |
String dedent(String text) { | |
/// Remove any common leading whitespace from every line in `text`. | |
/// This can be used to make triple-quoted strings line up with the left |
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
e.setComponent('Flag', {}) | |
e.setComponent('Flag2', null) |
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
entity.getComponent('data').completed = false | |
entity.setComponent('dirty', {}) |
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
engine.system('dirty-todoitems', ['data', 'dirty'], (entity, {data, _}) => { | |
// do something with entity and data | |
// ... | |
entity.deleteComponent('dirty') // important! remove dirty flag | |
} |
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 Persistence { | |
constructor() { | |
this.todos_data = [] // gather info here | |
engine.system('reset-save', ['housekeeping'], (entity, { _ }) => { | |
this.todos_data = [] | |
}); | |
engine.system('gather-todos-for-save', ['data'], (entity, { data }) => { | |
this.todos_data.push(data) |
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
let todos_data = [] | |
engine.system('reset-todo-list', ['housekeeping'], (entity, { housekeeping }) => { | |
todos_data = [] | |
}); | |
engine.system('gather-todos-for-save', ['data'], (entity, { data }) => { | |
todos_data.push(data) // or push data.title, or push the entity, or whatever you need | |
}); | |
engine.system('report-final-result', ['housekeeping'], (entity, { housekeeping }) => { | |
console.log('final list of todos', todos_data) |
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
engine.system('reset-todos', ['housekeeping'], (entity, { _ }) => { | |
this.todos = [] | |
}) |
NewerOlder