From 136cd4753eb40cb6be4bf42235c518803dc0f71a Mon Sep 17 00:00:00 2001 From: Moe Date: Thu, 12 May 2022 10:27:19 +0700 Subject: [PATCH] Sync API with flutter_lints v2.0.1 --- lib/api/api.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/api/api.dart b/lib/api/api.dart index 1c3091c..aa3df41 100644 --- a/lib/api/api.dart +++ b/lib/api/api.dart @@ -2,20 +2,20 @@ import 'package:dio/dio.dart'; import 'package:nekoya_flutter/api/config.dart'; Future getProducts() async { - var req = await Dio().get(host + '/getproducts'); + var req = await Dio().get('$host/getproducts'); var res = req.data; return res; } Future getProduct(id) async { - var req = await Dio().get(host + '/getproduct', queryParameters: {'id': id}); + var req = await Dio().get('$host/getproduct', queryParameters: {'id': id}); var res = req.data; return res; } Future registerPost(data) async { Response req = await Dio().post( - (host + '/register'), + ('$host/register'), data: data, options: Options( contentType: Headers.formUrlEncodedContentType, @@ -29,7 +29,7 @@ Future registerPost(data) async { Future loginPost({email, password}) async { Response req = await Dio().post( - (host + '/login'), + ('$host/login'), data: { 'email': email, 'password': password, @@ -48,7 +48,7 @@ Future getSessions() async { String tempKey = 'rTugfHPB7Cd4I1OmsbFCHuJvBSjA2C48WOcMghviohNlNj8IZqazvtwJrdGFHDwp'; var req = await Dio() - .post(host + '/sessions', queryParameters: {'key': tempKey}); + .post('$host/sessions', queryParameters: {'key': tempKey}); var res = req.data; return res; } @@ -57,7 +57,7 @@ Future getTransactions() async { String tempKey = 'rTugfHPB7Cd4I1OmsbFCHuJvBSjA2C48WOcMghviohNlNj8IZqazvtwJrdGFHDwp'; var req = await Dio() - .post(host + '/transaction', queryParameters: {'key': tempKey}); + .post('$host/transaction', queryParameters: {'key': tempKey}); var res = req.data; return res; } @@ -66,7 +66,7 @@ Future checkoutPost(data) async { String tempKey = 'rTugfHPB7Cd4I1OmsbFCHuJvBSjA2C48WOcMghviohNlNj8IZqazvtwJrdGFHDwp'; Response req = await Dio().post( - (host + '/checkout'), + ('$host/checkout'), queryParameters: {'key': tempKey}, data: data, options: Options(