documentid: Auth UID
{
email: string,
name: string,
occupation: string | null
}
function rightMostBSearch(arr, target) { | |
let left = 0; | |
let right = arr.length - 1; | |
let result = -1; // Initialize result to -1 for the case when the target is not present | |
while (left <= right) { | |
const mid = Math.floor(left + (right - left) / 2); | |
if (arr[mid] === target) { | |
// middlekey is equal to the target - update the left pointer so it continue to find the right most key |
function rightMostBSearch(arr, target) { | |
let left = 0; | |
let right = arr.length - 1; | |
let result = -1; // Initialize result to -1 for the case when the target is not present | |
while (left <= right) { | |
const mid = Math.floor(left + (right - left) / 2); | |
if (arr[mid] === target) { | |
// middlekey is equal to the target - update the left pointer so it continue to find the right most key |
import { Location } from '@angular/common'; | |
import { Component, OnDestroy, OnInit } from '@angular/core'; | |
import { AlertController, Platform } from '@ionic/angular'; | |
import { Subscription } from 'rxjs'; | |
@Component({ | |
selector: 'app-second', | |
templateUrl: './second.page.html', | |
styleUrls: ['./second.page.scss'], | |
}) |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Logging; | |
namespace UploadAPI.Controllers | |
{ |
import 'package:dio/dio.dart'; | |
class DioUploadService { | |
Future<dynamic> uploadPhotos(List<String> paths) async { | |
List<MultipartFile> files = []; | |
for(var path in paths) files.add(await MultipartFile.fromFile(path)); | |
var formData = FormData.fromMap({ |
import 'dart:convert'; | |
import 'package:http/http.dart' as http; | |
class HttpUploadService { | |
Future<String> uploadPhotos(List<String> paths) async { | |
Uri uri = Uri.parse('http://10.0.0.103:5000/profile/upload-mutiple'); | |
http.MultipartRequest request = http.MultipartRequest('POST', uri); | |
for(String path in paths){ |
import 'package:app_upload/common/card_picture.dart'; | |
import 'package:app_upload/common/take_photo.dart'; | |
import 'package:app_upload/service/dio_upload_service.dart'; | |
import 'package:app_upload/service/http_upload_service.dart'; | |
import 'package:camera/camera.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} |
import 'package:camera/camera.dart'; | |
import 'package:flutter/material.dart'; | |
class TakePhoto extends StatefulWidget { | |
final CameraDescription? camera; | |
TakePhoto({this.camera}); | |
@override | |
_TakePhotoState createState() => _TakePhotoState(); |
import 'dart:io'; | |
import 'package:flutter/material.dart'; | |
class CardPicture extends StatelessWidget { | |
CardPicture({this.onTap, this.imagePath}); | |
final Function()? onTap; | |
final String? imagePath; | |
@override |