Skip to content

Instantly share code, notes, and snippets.

View sahildev001's full-sized avatar
🎯
Focusing

sahil kumar sahildev001

🎯
Focusing
View GitHub Profile
@sahildev001
sahildev001 / gradientsliderbutton.dart
Created March 29, 2023 11:24
This class create Gradient slider button in dart.
import 'package:flutter/material.dart';
class GradientSliderButton extends StatefulWidget {
/// the width of the SlidableButton
final double width;
/// the height of the SlidableButton
final double height;
/// the size of the draggable icon
@sahildev001
sahildev001 / UseMarkerGenetarorFromWidget.dart
Created March 29, 2023 11:48
This Will generate markers from widget.
// Use this class as
MapMarkerGeneratorFromWidget(CommonMethods.customNumberMarker("${i+1}"), (bitmaps) {
setState(() {
BitmapDescriptor icon = BitmapDescriptor.fromBytes(bitmaps);
dev.log("$TAG icon :-- $icon");
if(updatedOrders[i].addressDelivery?.latLng != null) {
LatLng markerLatLng = LatLng(
(updatedOrders[i].addressDelivery?.latLng?.latitude ?? 0.0)
@sahildev001
sahildev001 / flutter router
Created January 24, 2024 10:39
create routs in flutter
static const String routeName = '/LogInScreen';
static Route route() {
return PageRouteBuilder(
settings: RouteSettings(name: routeName),
pageBuilder: (context, animation, secondaryAnimation) => LogInScreen(),
transitionsBuilder: (context, animation, secondaryAnimation, child) {
const begin = Offset(1.0, 0.0);
@sahildev001
sahildev001 / injector.dart
Created January 24, 2024 10:45
caeate interceptor in flutter
class Injector {
static final Injector _singleton = new Injector._internal();
static final dio = Dio();
factory Injector() {
return _singleton;
}
Injector._internal();
RestApiClient getClient() {
// dio.options.connectTimeout = 10000;
// dio.options.receiveTimeout = 3000;