Skip to content

Instantly share code, notes, and snippets.

View amerblackbird's full-sized avatar

Amer mohammed amerblackbird

View GitHub Profile
@amerblackbird
amerblackbird / Makefile
Created July 24, 2023 06:55
Makefile from flutter app
get:
flutter pub get
outdated:
flutter pub outdatedd
upgrade:
flutter pub upgrade
test:
@amerblackbird
amerblackbird / RouteObserverWithCancelableOperation.dart
Created July 6, 2023 05:33
RouteObserverWithCancelableOperation
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:async/async.dart';
void main() {
runApp(const MyApp());
}
final RouteObserver<PageRoute> routeObserver = RouteObserver<PageRoute>();

Sudan mobile numbers regex

A simple regex to validate sudan mobile numbers.

Country code

249

Service Provider codes

@amerblackbird
amerblackbird / flutter_gap_extension.dart
Last active February 24, 2023 14:36
Create gap from int or double value
extension IntGapExtension on int {
/// Vertical gap
SizedBox get gv => SizedBox(height: toDouble());
/// Horizontal gap
SizedBox get gh => SizedBox(width: toDouble());
}
extension DoubleGapExtension on double {
/// Vertical gap
@amerblackbird
amerblackbird / flutter_padding_extension.dart
Last active February 24, 2023 14:33
Flutter int and double padding extension
/// Creates padding from int using extension
extension IntPaddingExtension on int {
/// Padding
EdgeInsets get p => EdgeInsets.all(toDouble());
/// Top padding
EdgeInsets get pt => EdgeInsets.only(top: toDouble());
/// Left padding