Skip to content

Instantly share code, notes, and snippets.

View mehulpamale's full-sized avatar

Mehul mehulpamale

View GitHub Profile
@mehulpamale
mehulpamale / main.dart
Created May 26, 2024 10:52
How to showcase a widget in flutter?
import 'package:flutter/material.dart';
typedef Position = (Offset offset, double height, double width);
void main() {
runApp(const MainApp());
}
class MainApp extends StatefulWidget {
const MainApp({super.key});
@mehulpamale
mehulpamale / main.dart
Created January 22, 2024 14:47
dart catchError
void main() async {
await Future.wait([Future(() => throw Exception())])
.then((value) => true)
.catchError((final _) {
print('caught the error :)');
return true;
});
print('executed successfully :)');
}
@mehulpamale
mehulpamale / .zshrc
Last active March 26, 2023 12:34
.zshrc
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH