Skip to content

Instantly share code, notes, and snippets.

View wonderkidshihab's full-sized avatar
😮‍💨
I may be slow to respond.

Shihab Uddin wonderkidshihab

😮‍💨
I may be slow to respond.
View GitHub Profile
```dart
part of 'user.m.dart';
extension UserExt on User? {
Future<void> save() async {
try {
await prefs.setString('user', this!.toRawJson());
} catch (e) {
log('Error: $e');
}
@wonderkidshihab
wonderkidshihab / main.dart
Created October 3, 2023 12:18
crimson-cliff-8989
int callCount = 0;
void main(){
var memFibo = memoize(input);
print(callCount);
print(memFibo(20, 2));
print(callCount);
print(memFibo(25, 5));
print(callCount);
print(memFibo(20,2));
@wonderkidshihab
wonderkidshihab / ripple.frag
Created June 7, 2023 13:36
Flutter ripple effect
#version 460 core
#include <flutter/runtime_effect.glsl>
uniform vec2 uSize;
uniform vec4 uColor;
uniform float uTime; // Add this line
out vec4 FragColor;

Flutter Build Automation

Generate apk and aab file from your sourcecode automatically using github actions

Steps:

  1. Create folder .github/workflows/ on your projects root folder
  2. Add a file named flutter_build.yml
  3. Paste the above code into that file.
@wonderkidshihab
wonderkidshihab / api_client.dart
Last active January 4, 2024 19:10
Api client
/// Add dio and dio_pretty_logger into your pubspec.yaml
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:pretty_dio_logger/pretty_dio_logger.dart';
import 'package:shared_preferences/shared_preferences.dart';
const String base_url = "";