Skip to content

Instantly share code, notes, and snippets.

View UsamaKarim's full-sized avatar
💙

Usama Karim UsamaKarim

💙
View GitHub Profile
@UsamaKarim
UsamaKarim / guide-change-imei-snapdragon.md
Created January 25, 2024 14:36
[GUIDE] How to change IMEI on Snapdragon devices

[GUIDE] How to change IMEI on Snapdragon devices

FOR EDUCATIONAL PURPOSE ONLY, CHANGING IMEI IS ILLEGAL IN MOST COUNTRIES, MAKE SURE YOU CONVINCE YOUR ACTIONS BEFORE DOING THIS.

I DON'T RESPONSIBLE IF YOUR DEVICE IS BROKEN OR THE IMEI IS NOT CHANGED CAUSED BY YOU DIDN'T FOLLOW THE STEPS CAREFULLY OR HAVING A DIFFERENT EFS PARTITION SCHEME.

This guide was tested on Google Pixel 3, different device may also have a different EFS partition scheme, please make sure you adjust it with this guide. Other Google Pixel devices may use this guide without adjusting.

Prerequisites:

@UsamaKarim
UsamaKarim / text_size.dart
Created April 8, 2023 21:39
Extension on Flutter `BuildContext` to make it easier to access `TextTheme`, FontSizes and FontWeight for TextStyles based on Material 3 Design System
/// Extension on [BuildContext] to make it easier to access [TextTheme]
/// FontSizes and FontWeight for TextStyles based on Material 3 Design System
/// https://m3.material.io/styles/typography/type-scale-tokens
extension TextSize on BuildContext {
ThemeData get theme => Theme.of(this);
TextTheme get textTheme => theme.textTheme;
/// FontSize = 57, FontWeight = 400
@UsamaKarim
UsamaKarim / keyboard_aware_widget.dart
Created January 26, 2023 06:37
Wrap it with the widget you want to visible in case the keyboard pops out.
import 'package:flutter/material.dart';
class KeyboardAwareWidget extends StatelessWidget {
const KeyboardAwareWidget({
Key? key,
this.padding = 16,
required this.child,
}) : super(key: key);
final double padding;
final Widget child;
@UsamaKarim
UsamaKarim / cache_memory_image_provider.dart
Last active December 20, 2022 11:41
Cache Image read from memory bytes [Uint8List], Usually it is used while using base64 decoded image for faster result.
// Improved version from https://gist.github.com/darmawan01/9be266df44594ea59f07032e325ffa3b
class CacheMemoryImageProvider extends ImageProvider<CacheMemoryImageProvider> {
final String tag; //the cache id use to get cache
final Uint8List img; //the bytes of image to cache
CacheMemoryImageProvider(this.tag, this.img);
@override
ImageStreamCompleter loadBuffer(