Skip to content

Instantly share code, notes, and snippets.

View hungtrn75's full-sized avatar
🎯
Focusing

Hung Tran hungtrn75

🎯
Focusing
View GitHub Profile
// Copyright 2013 The Flutter 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:collection/collection.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
final GlobalKey<NavigatorState> _rootNavigatorKey =
@hungtrn75
hungtrn75 / mapbox_gl_draw.dart
Last active September 23, 2023 18:01
@mapbox/mapbox-gl-draw in Flutter
import 'dart:math';
import 'package:collect_data/configs/constants/app_url.dart';
import 'package:flutter/material.dart';
import 'package:mapbox_gl/mapbox_gl.dart';
class Pair<T1, T2> {
final T1 first;
final T2 second;
@hungtrn75
hungtrn75 / _howto.md
Created December 8, 2021 01:51 — forked from aaronpk/_howto.md
How to compile and install spatialite on iOS

Spatialite for iOS

Install compiler dependencies

brew install automake autoconf libtool libxml2 pkg-config
brew link libxml2

Build libspatialite

import React, { useCallback, useEffect, useRef, useState } from "react";
import { Platform, StyleSheet, TouchableOpacity, View } from "react-native";
import Svg, { Circle, Line, Path, Rect } from "react-native-svg";
import Animated, {
runOnJS,
useAnimatedGestureHandler,
useAnimatedProps,
useAnimatedStyle,
useDerivedValue,
useSharedValue,
import {colors} from '@constants/theme';
import React, {useMemo} from 'react';
import {StyleSheet, TouchableOpacity, View} from 'react-native';
import {BaseButton} from 'react-native-gesture-handler';
import Animated from 'react-native-reanimated';
const Block = props => {
const {
animated,
children,
@hungtrn75
hungtrn75 / ImageViewer.js
Created July 14, 2021 07:34
ImageViewer
import { dimensions } from "@constants/theme";
import React, { useCallback, useEffect, useRef, useState } from "react";
import { ActivityIndicator, Image, Platform, Pressable, StatusBar, StyleSheet, Text, View } from "react-native";
import FastImage from "react-native-fast-image";
import { FlatList, PanGestureHandler, PinchGestureHandler } from "react-native-gesture-handler";
import Animated, {
cancelAnimation,
runOnUI,
scrollTo,
useAnimatedGestureHandler,
@hungtrn75
hungtrn75 / MapTracking.js
Created June 30, 2021 03:39
@react-native-mapbox-gl/maps
import BottomSheet from '@gorhom/bottom-sheet';
import MapboxGL, {Animated, Camera} from '@react-native-mapbox-gl/maps';
import * as turf from '@turf/turf';
import _ from 'lodash';
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import {Alert, Easing, StyleSheet, Image, View} from 'react-native';
import RNBootSplash from 'react-native-bootsplash';
import {
runOnJS,
useDerivedValue,
@hungtrn75
hungtrn75 / AnimatePolyline.js
Created June 30, 2021 03:34
react-native-maps
import React, {useRef, useState} from 'react';
import {
Dimensions,
Image,
InteractionManager,
Platform,
StyleSheet,
} from 'react-native';
import {AnimatedRegion, Marker, Polyline} from 'react-native-maps';
import Animated, {
const onChangeAvatar = () => {
const options = {
takePhotoButtonTitle: 'Take Photo',
chooseFromLibraryButtonTitle: 'Choose Photo',
customButtons: [{name: 'Delete Photo', title: 'Delete Photo'}],
storageOptions: {
skipBackup: true,
path: 'images',
},
@hungtrn75
hungtrn75 / View.js
Created June 19, 2021 15:14
Webview Android & @gorhom/bottom-sheet
import BottomSheet from '@gorhom/bottom-sheet';
import React from 'react';
import {StyleSheet, View} from 'react-native';
import RNBootSplash from 'react-native-bootsplash';
import {createNativeWrapper} from 'react-native-gesture-handler';
import WebView from 'react-native-webview';
import {dimensions} from '../../constants/theme';
const Wrapper = createNativeWrapper(WebView);
const WebViewTest = () => {