Skip to content

Instantly share code, notes, and snippets.

Privacy Policy

Introduction

Our privacy policy will help you understand what information we collect at Todoey, how Todoey uses it, and what choices you have. Todoey built the Todoey app as a free app. This SERVICE is provided by Todoey at no cost and is intended for use as is. If you choose to use our Service, then you agree to the collection and use of information in relation with this policy. The Personal Information that we collect are used for providing and improving the Service. We will not use or share your information with anyone except as described in this Privacy Policy. The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible in our website, unless otherwise defined in this Privacy Policy.

Information Collection and Use

For a better experience while using our Service, we may require you to provide us with certain personally identifiable information, including but not limited to users name, email address, gender, location, pictures. The info

Handle Http request in Flutter (smart way)

Some Prerequisites

As we are going to implement this app using BLOC pattern you should know the basics of Streams and StreamControllers or bloc or Provider or any State Management way. Some basic knowledge of HTTP response codes and repository pattern will also be going to help you understand this more easily. The basic architecture of our Application is going to be like this. Basic Architecture of our Application

Steps we are going to follow in this article :

  • Creating an API base helper class.
  • Custom app exceptions.
  • LinkResponse model classes.
  • A generic API response class.
import 'dart:io';
void main() {
performTasks();
}
void performTasks() {
task1();
task2();
task3();
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);
@override
State<MyHomePage> createState() => _MyHomePageState();

Privacy Policy osama mohammed built the RPS Game app as a Free app. This SERVICE is provided by osama mohammed at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which are accessible at RPS Game unless otherwise defined in this Privacy Policy.

Future<int> uploadImage(File file, mailId) async {
String token = await getToken();
var request = http.MultipartRequest("POST", Uri.parse(attachmentUrl));
//create multipart using filepath, string or bytes
var pic = await http.MultipartFile.fromPath('image', file.path);
request.fields['mail_id'] = mailId.toString();
request.fields['title'] = 'image_${DateTime.now()}';
//add multipart to request
request.files.add(pic);
request.headers
void main(){
User user = User(AnotherCreatePassword());
user.printPassword();
}
class User{
CreatePasswordInterface cpi;
User(this.cpi);
void printPassword(){
print(cpi.createPassword());
@oalshokri
oalshokri / async_programming.dart
Created January 3, 2023 05:42
Starting Code for Futures/Async/Await Demo
import 'dart:io';
void main() {
performTasks();
}
void performTasks() {
task1();
task2();
task3();
main() {
int result = cal(2,4,mul);
print(result);
}
int add (int x, int y)=> x+y;