Skip to content

Instantly share code, notes, and snippets.

View notsatria's full-sized avatar

Satria notsatria

View GitHub Profile
@titoaesj
titoaesj / .kt
Last active July 14, 2025 09:41
Android convert int to dp
OBS: O var_number_int é a varável que recebera o valor a ser convertido em DP
(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, var_number_int, getResources().getDisplayMetrics())
##KOTLIN
val Int.dp: Int
get() = (this * Resources.getSystem().displayMetrics.density + 0.5f).toInt()
val Float.dp: Int
@jtmuller5
jtmuller5 / onboarding_service.dart
Last active November 11, 2025 12:57
Flutter class for displaying sequential onboarding tips
import 'dart:async';
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:injectable/injectable.dart';
import 'package:app/shared_preferences.dart';
import 'package:logging/logging.dart';
/// Represents a single onboarding tip
class OnboardingTip {
final String id;