Skip to content

Instantly share code, notes, and snippets.

View mulieriq's full-sized avatar
🎸
Everything Is A Widget #FlutterDev

Eric Muli mulieriq

🎸
Everything Is A Widget #FlutterDev
View GitHub Profile
@mulieriq
mulieriq / wallet.dart
Created November 25, 2021 12:51
add cash to wallet
function addMoneyToWallet(userDataTransactionsOrderId, data) {
let serviceFeeCal = Math.ceil(parseInt(data.data().amountToPay.toString()) * 0.05)
let netAmount = parseInt(data.data().amountToPay.toString()) - serviceFeeCal
console.log(`WALLET -------------------${serviceFeeCal} -- ${netAmount} - ${JSON.stringify(data.data())}`)
admin.firestore().collection("wallet").doc(data.data().recepientId.toString()).collection("transactions").add(
{
tenancyTransactionId: userDataTransactionsOrderId,
date: data.data().payedDate,
hash: "Genesis",
prevHash: "PrevHash",
/*
Author : Eng.Muli Eric
Project : The Epistles Fellowhip Mobile App
Platform : Mobile Application
Technology : Flutter
Target : Android And IoS Os
Date : Fri May 31 st 23:18:45
Page Title : Login Section
*/
@mulieriq
mulieriq / f.dart
Last active January 4, 2021 12:59
File upload to server Using dio And http
///////////////////////////////////////////////////DIO//////////////////////////////////////
////////////////HEADERs
dio.options.headers = {'Content-Type': 'application/x-www-form-urlencoded'};
//code
File _image;
String fileName =
_image.path.split('/').last;
FormData formData =
new FormData.fromMap({
@mulieriq
mulieriq / merchantuser.dart
Created November 18, 2020 07:39
Merchant user
import 'dart:io';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:country_code_picker/country_code_picker.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:image_picker/image_picker.dart';
//import 'package:flutter_image_compress/flutter_image_compress.dart';
//import 'package:image_cropper/image_cropper.dart';
import 'dart:io';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:country_code_picker/country_code_picker.dart';
import 'package:device_info/device_info.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_image_compress/flutter_image_compress.dart';
/*
Author : Eng.Muli Eric
Project : The Epistles Fellowhip Mobile App
Platform : Mobile Application
Technology : Flutter
Target : Android And IoS Os
Date : Mon May 27th 2019 22:34:30
Page Title : Home Page
*/
Future<void> updateData(data) async {
print('function add data called');
Firestore.instance
.collection('users')
.document(widget.uid)
.updateData(data)
.then((result) {
print("data added ..................................... ");
// print(result);
}).catchError((e) {
@mulieriq
mulieriq / call_screen.dart
Last active August 21, 2020 17:00
create call
class VideoCallPerosnalScreen extends StatefulWidget {
/// non-modifiable channel name of the page
final String channelName;
final String callerid;
final String receiverid;
/// Creates a call page with given channel name.
const VideoCallPerosnalScreen(
Future getVideo() async {
setState(() {
video = null;
thumbfilepath = null;
});
setState(() {
messageid = DateTime.now().millisecondsSinceEpoch.toString();
});
var vinput = await ImagePicker.pickVideo(source: ImageSource.gallery);
final uint8list = await VideoThumbnail.thumbnailFile(
@mulieriq
mulieriq / property_maps.dart
Last active April 1, 2021 07:36
Maps suggestions /Maps search within a given radius
/////////////////////////////////////////////////////////////////////EXTRACTED SHORT SNIPPETS Garage Idea from properties snippet ////////////////////////////////
//////////////////////////////////////////////MAPS SCREEN
////Suggests garages within a given radius from users loactions
List gdata = [];
List searchedGarage = [];
///In this block i receive my data from fireabse garage collections then regeneate a list containig my garage ,then i
//their ids within each garage's MAP (