Skip to content

Instantly share code, notes, and snippets.

View huycozy's full-sized avatar
💙
Fluttering

Huy huycozy

💙
Fluttering
View GitHub Profile
@huycozy
huycozy / index.md
Last active January 16, 2025 04:34
HTML page which is scrollable with 50 items ( using for comparing with Flutter web scrolling, scroll to top on iOS, etc...)
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Scrollable List</title>
    <style>
 body {
@huycozy
huycozy / open_link_example.md
Created July 1, 2024 05:08
GTK open link example
// Copyright 2019 the Dart project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:web/web.dart';
void main() => runApp(const MyApp());
@huycozy
huycozy / gtk_text_example.md
Last active July 1, 2024 05:05
Simple GTK text example
  1. Create gtk_text_example.c file:
#include <gtk/gtk.h>

// Callback function to handle the "destroy" signal
void on_destroy(GtkWidget *widget, gpointer data) {
    gtk_main_quit();
}
@huycozy
huycozy / flutter_wsl2_windows.md
Last active October 7, 2024 09:28
Guideline on how to build and run Linux app on WSL2 with VS Code on Windows
  1. Make sure you installed VS Code here: https://code.visualstudio.com/
  2. Open VS Code, find WSL from Extensions and install it
  3. Click on Open a remote windows:

image

  1. Click on Connect to WSL using Distro... By default, there is only Ubuntu (wsl1), you can use it if you want. But if you want to use WSL2, need to install another distro

4.1. List all available distros:

@huycozy
huycozy / directory_picker.md
Created October 25, 2023 03:59
GTK program to open directory picker
  1. Create directory_picker.c file:
#include <gtk/gtk.h>

// Callback function for the "Open" button
void open_button_clicked(GtkWidget *widget, gpointer data) {
    GtkWidget *dialog;
    const gchar *selected_folder;
@huycozy
huycozy / EachDirectoryPath.md
Created June 15, 2023 04:34 — forked from granoeste/EachDirectoryPath.md
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@huycozy
huycozy / addtoapp_ios_embed_cocoapods_optionA.md
Last active October 23, 2024 07:50
Add to app iOS - Embed cocoapods (option A)

References

Step by step

1. From the terminal, go to your current iOS native project, for eg: /Users/.../reproduce_issue_ios_native_addtoapp_optionA/

2. Group all current files/directories into a new directory (named MyApp for eg)

  1. Add test package to pubspec.yaml
  • Old:
flutter_driver:
  sdk: flutter
  • New:
@huycozy
huycozy / addtoapp_ios_embed_framework_optionB.md
Last active September 25, 2023 14:31
Add to app iOS - Embed frameworks in Xcode (option B)