Skip to content

Instantly share code, notes, and snippets.

View yousefak007's full-sized avatar

Yousef Alkhamesi yousefak007

View GitHub Profile
import 'package:flutter/material.dart';
import 'package:watch_it/watch_it.dart';
void main() {
runApp(
const MyApp(),
);
}
class Counter with ChangeNotifier {

Location Service

you can just create an intsance/(you can register this with get_it/ioc contiainer) for easy usage

import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_polyline_points/flutter_polyline_points.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:your_project_folder/permission_manager.dart';
@yousefak007
yousefak007 / theme_toggle.dart
Created June 3, 2023 06:45
Using Toggle theme from System to light or System to dark with Consumer
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@yousefak007
yousefak007 / build-root.sh
Created January 21, 2023 14:29 — forked from olavmrk/build-root.sh
Create Debian Jessie squashfs & initramfs image
#!/bin/bash
set -e
WORK_DIR="$(mktemp --directory --tmpdir build-root.XXXXXXXX)"
trap 'rm -rf "${WORK_DIR}"' EXIT
if [ -f rootcache.tar.gz ]; then
tar --extract --numeric-owner --gzip --file rootcache.tar.gz --directory "${WORK_DIR}"
else
debootstrap --variant=minbase --include=linux-image-amd64,ifupdown,isc-dhcp-client,openssh-server,less,nano,python,lvm2,debootstrap jessie "${WORK_DIR}" http://httpredir.debian.org/debian