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
from random import randrange | |
parts = { | |
"USA": randrange(1, 100), | |
"Germany": randrange(1, 100), | |
"Russia": randrange(1, 100) | |
} | |
keys = list(parts.keys()) | |
values = list(parts.values()) |
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
def karatsuba(x, y): | |
if x < 16 or y < 16: | |
return x * y | |
max_len = max(x.bit_length(), y.bit_length()) // 2 | |
bitwise_filter = (1 << max_len) - 1 | |
a, b = x >> max_len, x & bitwise_filter | |
c, d = y >> max_len, y & bitwise_filter |
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
Image imageFile = Image.asset('assets/img/my_image.png'); |
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
Future callToAPI() async { | |
await http.get('url_to_my_api.dev/api'); | |
} | |
Future anotherCallToAPI() async { | |
await http.get('url_to_my_api.dev/api/another'); | |
} |
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
class API { | |
static const url = 'url_to_my_api.dev/api'; | |
} | |
Future callToAPI() async { | |
await http.get(API.url); | |
} | |
Future anotherCallToAPI() async { | |
await http.get('${API.url}/other'); |
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
# aquí toda la configuración de flutter_gen | |
# ojo con las indentaciones | |
flutter_gen: | |
# por defecto, los archivos generados van en `lib/gen/` | |
# se puede sobreescribir con `lib/src/gen` usando [output] | |
output: lib/src/gen/ | |
# si utilizamos algún linter sensible a la cantidad de | |
# líneas de código, podemos complacerlo con [lineLength] | |
# que por defecto viene en 80 |
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
Assets.images.background.image(); |
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
Text( | |
'Esto es usando las fuentes con FlutterGen', | |
style: TextStyle(fontFamily: FontFamily.googleSans), | |
); |
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
Container(height: 100, width: 100, color: ColorName.justBlack); |
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
# * si usas Provider | |
provider: ^4.3.3 | |
state_notifier: ^0.6.0 | |
flutter_state_notifier: ^0.6.1 | |
# * si usas Riverpod, ya integra state_notifier | |
flutter_riverpod: ^0.12.2 | |
# usa las dependencias más recientes o | |
# las que sean compatibles con tu proyecto |
OlderNewer