NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

fluttertoast:
validators:
dio: ^3.0.0:
shared_preferences:
form_field_validator:
device_info: ^2.0.0:


class Strings {
Strings._();
/*----------------------------network strings-------------------------------------*/

static const String REQUEST_CANCELLED = "Request cancelled";
static const String CONNECTION_TIMEOUT = 'Connection timeout';
static const String INTERNET_CONNECTION = 'No Internet Connection';
static const String TIME_OUT = 'Time out';
static const String UNAUTH_REQUEST = 'Unauthorised Request';
static const String NOT_FOUND = 'Not Found';
static const String REQUEST_TIME_OUT = 'Request Time out';
static const String INTERNAL_SERVER_ERROR = 'Internal Server Error';
static const String INTERNET_SERVICE_UNAVAIL = 'Service Unavailable';
static const String SOMETHINGS_IS_WRONG = 'Something is wrong';
static const String SOCKET_EXCEPTIONS = 'Socket Exceptions';
static const String UNEXPECTED_EXCEPTION = 'Unexpected Exceptions';
static const String FORMAT_EXCEPTION = 'Format Exceptions';
static const String ASSESSMENT = 'Assessment,Doc M and specialized Lawyer';
static const String ONE = '1. In a few clicks';
static const String SECOND = '2. At the best price';
static const String THIRD = '3. With the most qualified partners';
static const String NEXT = 'Next';
static const String connectionRefused = 'Connection refused';
static const String networkUnreachable = 'Network is unreachable';
static const String serverMaintance =
"Something went wrong. Please try again later.";
static const String imagechoose = "Image choose cancelled"; static const String pleaseTryAgain = "Please try again later";
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////> api_provider

class APIRepository {
static DioClient dioClient;

APIRepository() {
var dio = Dio();
dioClient = DioClient(baseUrl, dio);
}

/*===================================================================== login API Call ==========================================================*/
static Future loginApiCall(
Map<String, dynamic> dataBody, BuildContext context) async {
try {
FormData formData = FormData.fromMap(dataBody);
final response = await dioClient.post(loginEndPoint, data: formData);
return LoginResponseModel.fromJson(response);
} catch (e) {
return Future.error(NetworkExceptions.getDioException(e, context));
}
}

/*===================================================================== register API Call ==========================================================*/
static Future registerApiCall(
Map<String, dynamic> dataBody, BuildContext context) async {
try {
FormData formData = FormData.fromMap(dataBody);
final response = await dioClient.post(registerEndPoint, data: formData);
return LoginResponseModel.fromJson(response);
} catch (e) {
return Future.error(NetworkExceptions.getDioException(e, context));
}
}

/*===================================================================== forgot password Call =======================================================*/
static Future forgotApiCall(
Map<String, dynamic> dataBody, BuildContext context) async {
try {
FormData formData = FormData.fromMap(dataBody);
final response =
await dioClient.post(resetPasswordEndPoint, data: formData);

return ForgotPasswordResponseModel.fromJson(response);
} catch (e) {
return Future.error(NetworkExceptions.getDioException(e, context));
}
}

/*=====================================================================Logout Api Call =======================================================*/
static Future logoutApiCall(BuildContext context) async {
try {
final response = await dioClient.post(userLogout,
queryParameters: {'access-token': await PrefManger.getAcessToken()});
return LogoutResponseModel.fromJson(response);
} catch (e) {
return Future.error(NetworkExceptions.getDioException(e, context));
}
}

/*===================================================================== change Password API Call ==========================================================*/
static Future changePassword(
Map<String, dynamic> dataBody, BuildContext context) async {
try {
FormData formData = FormData.fromMap(dataBody);
final response = await dioClient.post(userChangePasswordEndPoint,
data: formData,
queryParameters: {'access-token': await PrefManger.getAcessToken()});

return ChangePasswordResponseModel.fromJson(response);
} catch (e) {
return Future.error(NetworkExceptions.getDioException(e, context));
}
}
/*===================================================================== update profile API Call ==========================================================*/
static Future updateProfile(
Map<String, dynamic> dataBody, BuildContext context) async {
try {
FormData formData = FormData.fromMap(dataBody);
final response = await dioClient.post(user_update,
data: formData,
queryParameters: {'access-token': await PrefManger.getAcessToken()});
return UpdateResponseModel.fromJson(response);
} catch (e) {
return Future.error(NetworkExceptions.getDioException(e, context));
}
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////>lib => utility => helper_utility
import 'package:bottom_navy_bar/bottom_navy_bar.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_base_project/constants/font_family.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:shimmer/shimmer.dart';


/* ===================================================== Text Style light ===================================================*/

textStyle({Color color, double fontsize}) {
return TextStyle(
fontSize: fontsize,
color: color,
fontWeight: FontWeight.w500,fontFamily: productSans);
}

/* ===================================================== Text Style Bold ===================================================*/

textStyleBold({Color color, double fontsize}) {
return TextStyle(
fontSize: fontsize,
color: color,
fontWeight: FontWeight.bold,
fontFamily: productSans);
}

/*================================================== transparent status bar ==========================================*/

transparentStausBar() {
return SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
statusBarIconBrightness: Brightness.dark);
}

/*================================================== On Back Press Screen ============================================*/

onBackPress({context}) {
Navigator.pop(context, true);
}

/* =================================================== popUntil========================================================*/

popandpush({context, route}) {
Navigator.popAndPushNamed(context, route);
}

/*================================================== push Screens ====================================================*/

void pushReplacement({context, route}) {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => route),
);
}

/*================================================= push screen with name ============================================*/

pushReplacementName({context, route}) {
Navigator.of(context).pushNamed(route);
}

pushAndRemoveUnttil({context, route}) {
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (BuildContext context) => route),
(Route<dynamic> route) => false);
}


/* ================================================= full width ===========================================================*/

fullWidthScreen({context}) {
return MediaQuery.of(context).size.width;
}

/*====================================================== full height ======================================================*/

fullheightcreen({context}) {
return MediaQuery.of(context).size.height;
}


/*======================================================= focus on Next Edit Text ============================================*/
focuOnNextEditText({context, nextFocus}) {
return FocusScope.of(context).requestFocus(nextFocus);
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////>lib => utility => helper_widget
import 'package:bottom_navy_bar/bottom_navy_bar.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_base_project/constants/dimens.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:shimmer/shimmer.dart';

/*================================================= Toast Message ====================================================*/

toast({String message}) {
return Fluttertoast.showToast(
msg: message,
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM,
timeInSecForIosWeb: 1,
backgroundColor: Colors.white,
textColor: Colors.black,
fontSize: font_16);
}

/*========================================================= container ========================================================*/

container({double height, double width, decoration, widget}) {
return Container(
height: height,
width: width,
decoration: decoration,
child: widget,
);
}

/*============================================== decoration box for container ==============================================*/

decorationBox({outlineColor, roundCorner}) {
return BoxDecoration(
color: outlineColor,
border: Border.all(color: outlineColor),
borderRadius: BorderRadius.all(Radius.circular(roundCorner) //
),
);
}

/*============================================== decoration box for container ==============================================*/

decorationBoxFill({outlineColor, roundCorner, startColor, endColor}) {
return BoxDecoration(
border: Border.all(color: outlineColor),
borderRadius: BorderRadius.all(
Radius.circular(roundCorner), //
),
gradient: LinearGradient(
colors: [startColor, endColor],
),
);
}

/*================================================== Inkwell Click =========================================================*/

getInkwell({Function onTap, Widget widget}) {
return InkWell(
onTap: onTap,
child: widget,
);
}

/*==================================================== padding for every side ==============================================*/

setPadding(
{double left, double right, double top, double bottom, Widget widget}) {
return Padding(
padding: EdgeInsets.only(
left: left,
right: right,
bottom: bottom,
top: top,
),
child: widget,
);
}

/*=================================================== padding for all side ===================================================*/

setPaddingtoAllSide({double margin, Widget widget}) {
return Padding(
padding: EdgeInsets.all(margin),
child: widget,
);
}

/* =====================================================Image Icon Set from ===========================================*/

imageSet({icon, height, width}) {
return Image(
image: AssetImage(icon),
height: height,
width: width,
);
}

/*=========================================================== Gradient ========================================================*/

getGradient() {
return BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [
Colors.lightBlue[800],
Colors.lightBlue[700],
Colors.lightBlue[600],
Colors.lightBlue[400],
],
),
);
}

/*============================================================= Bottom Bar Items ==================================================*/

bottomBarItems({name, iconData}) {
return BottomNavyBarItem(title: Text(name), icon: Icon(iconData));
}

/*============================================================ Circle Image Display ===============================================*/

circleImageDisplay({imageUrl, height, width, radius}) {
return ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(
imageUrl,
height: height,
width: width,
fit: BoxFit.contain,
));
}

/*============================================================ Circle Image Display ===============================================*/

circleImageDisplayLocalImage({imageUrl, height, width, radius}) {
return ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image(
image: AssetImage(
imageUrl,
),
height: height,
width: width,
fit: BoxFit.fill,
));
}

/*============================================================== List Tiles =======================================================*/

listTiles({title, subtitle, iconData, onTap}) {
return ListTile(
title: Text(title),
subtitle: Text(subtitle),
leading: Icon(iconData),
onTap: onTap);
}

/*============================================================ Shimmer Effecct ===================================================*/

shimmerEffect({bool enable, Widget widget}) {
return Shimmer.fromColors(
baseColor: Colors.grey[400],
enabled: true,
period: Duration(seconds: 3),
highlightColor: Colors.grey[200],
child: widget);
}

     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.