Learning how to use OverlayPortal
and CompositedTransformTarget
to build a custom dropdown in Flutter without external packages!
This is part of an article I wrote in DEV.to, go check it out! :)
Learning how to use OverlayPortal
and CompositedTransformTarget
to build a custom dropdown in Flutter without external packages!
This is part of an article I wrote in DEV.to, go check it out! :)
import std/uri | |
proc `?+`*(url: Uri, ql: openArray[tuple[string, string]]): Uri = | |
var qs = @ql | |
if url.query.len() != 0: | |
for k, v in url.query.decodeQuery(): | |
qs.add( (k, v) ) | |
return url ? qs |
-- Determines if this script is running on Windows | |
os.is_win = package.config:sub(1, 1) == "\\" | |
-- Return the path to the temp dir | |
function os.get_temp_dir() | |
if os.is_win then | |
-- Windows. Same as: | |
-- os.getenv("TEMP") | |
-- os.getenv("TMP") | |
return os.getenv("UserProfile") .. "/AppData/Local/Temp" |
import gintro/gobject | |
import gintro/gio | |
import gintro/gtk4 | |
proc activate(app: gtk4.Application) = | |
let win = gtk4.newApplicationWindow(app) | |
win.defaultSize = (800, 600) | |
win.present() | |
let app = gtk4.newApplication("org.gtk.example") |
#include <stdio.h> | |
/* Explanation | |
Arrays in C are just pointers. So, basically they points | |
to the address of the first element and when we indexing | |
using [], we're just performing an addition and the order | |
doesn't matter at all for that operator in C. Also, the | |
array identifier is also the first element itself, as I | |
said, is just a pointer. |
#include <stdio.h> | |
#include <stdlib.h> | |
int problem(int n) { | |
if (n == 1) { | |
printf("End\n"); | |
return n; | |
} else if ((n % 2) == 0) { | |
printf("Even: %d\n", n); | |
return problem(n / 2); |
from random import randint as rand | |
MagicNum = rand(1, 100) | |
Lives = 3 | |
print("Guess the number!") | |
print("Enter your choice:") | |
choice = int(input("> ")) | |
while True: |