Skip to content

Instantly share code, notes, and snippets.

View fathidevs's full-sized avatar

fathi fathidevs

View GitHub Profile
@fathidevs
fathidevs / fantasticBtn.dart
Last active December 17, 2023 21:38
a fantastic button that can paint gradient color, even the stroke
import 'package:flutter/material.dart';
class FantasticButton extends StatelessWidget {
final double? width;
final double? height;
final Widget child;
final EdgeInsets padding;
final LinearGradient gradient;
final bool isFill;
final double strokeWidth;
@fathidevs
fathidevs / quran.dart
Last active November 21, 2023 08:21
quran indexer
void main() {
String quran = """112|1|بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ قُلْ هُوَ ٱللَّهُ أَحَدٌ
112|2|ٱللَّهُ ٱلصَّمَدُ
112|3|لَمْ يَلِدْ وَلَمْ يُولَدْ
112|4|وَلَمْ يَكُن لَّهُۥ كُفُوًا أَحَدٌۢ
113|1|بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ قُلْ أَعُوذُ بِرَبِّ ٱلْفَلَقِ
113|2|مِن شَرِّ مَا خَلَقَ
113|3|وَمِن شَرِّ غَاسِقٍ إِذَا وَقَبَ
@fathidevs
fathidevs / create_screen.jsx
Last active November 7, 2023 14:37
screen builder
// use active document
var doc = app.activeDocument;
// initiate dialog
var dialog = new Window("dialog", "Enter details ");
dialog.orientaions = "column";
// function to build text box
@fathidevs
fathidevs / ai_script.jsx
Created October 19, 2023 14:11
Adobe Illustrator script
// #target illustrator
function promptDocQty() {
var qty = parseInt(prompt("doc qty:", "1"));
if (isNaN(qty) || qty < 1) {
parseInt(prompt("invalid input."));
}
return qty;
}
@fathidevs
fathidevs / main.dart
Last active September 7, 2023 14:38
hashing in Dart
import "dart:convert";
import "dart:math";
void main() {
GenerateCode generate = GenerateCode(e: "fathi");
print(generate.result());
}
class GenerateCode {
@fathidevs
fathidevs / main.dart
Created July 9, 2023 11:17
abstract classes in Dart
abstract class Brands1 {
// abstract class with "required" parameter
final String brand;
const Brands1({required this.brand});
}
class Mobile1 extends Brands1 {
// "Mobile1" must have constructor, because
@fathidevs
fathidevs / main.dart
Created April 19, 2022 14:47
Custom Bottom Navigation Bar Demo
import 'package:flutter/material.dart';
//import 'custom_materials/custom_buttom_nav_bar.dart';
//import 'screens/screens_holder.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(