Skip to content

Instantly share code, notes, and snippets.

@djad442
djad442 / state.dart
Created November 29, 2020 12:55
use of state mixin in getx
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:dio/dio.dart';
void main() {
runApp(GetMaterialApp(
initialRoute: '/home',
getPages: [
GetPage(
name: '/home',
@djad442
djad442 / .dart
Created November 18, 2020 12:30
Flutter Gradient App Bar
class GradientAppBar extends StatelessWidget {
final String title;
final double barHeight = 66.0;
GradientAppBar(this.title);
@override
Widget build(BuildContext context) {
final double statusBarHeight = MediaQuery.of(context).padding.top;
@djad442
djad442 / .dart
Created November 18, 2020 12:19
flutter color to material color
MaterialColor createMaterialColor(Color color) {
List strengths = <double>[.05];
Map swatch = <int, Color>{};
final int r = color.red, g = color.green, b = color.blue;
for (int i = 1; i < 10; i++) {
strengths.add(0.1 * i);
}
strengths.forEach((strength) {
final double ds = 0.5 - strength;
@djad442
djad442 / MKMapViewZoomLevel.cs
Created March 8, 2013 08:36
MonoTouch MKMapView with Zoom Level Property
using System;
using MonoTouch.MapKit;
using MonoTouch.CoreLocation;
using System.Drawing;
using MonoTouch.Foundation;
namespace BinaryQuest
{
[Register("MKMapViewZoomLevel")]
public class MKMapViewZoomLevel : MKMapView