Skip to content

Instantly share code, notes, and snippets.

View namphho's full-sized avatar

Nam Pham namphho

  • WataSolutions
  • Vietnam
View GitHub Profile
static const String MAIN = "/main";
static const String LOGIN = "/login";
static const String CONTACT_US = "/contactus";
static const String PROFILE = "/profile";
static const String CHANGE_PASS = "/changepass";
static const String EDIT_PROFILE = "/edit_profile";
static const String CONTACT_DETAIL = "/contact_detail";
static const String LOYALTY_DETAIL = "/loyalty_detail";
static const String STOCK_DETAIL = "/stock_detail";
static const String BUNDLE_REQUEST_NOW = "/detail_add_to_card";
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Flutter dev",
"request": "launch",
"type": "dart",
import 'package:app/data/storage/auth/auth_shared_references.dart';
import 'package:app/domain/repository/auth_repo.dart';
import 'package:app/domain/repository/logging_repo.dart';
import 'package:dio/dio.dart';
import 'package:kiwi/kiwi.dart';
//#1
const String KEY_LOGGED_HEADER = "isLogged";
class AuthenticationInterceptor extends Interceptor{
import 'package:app/data/storage/auth/auth_shared_references.dart';
import 'package:app/domain/repository/auth_repo.dart';
import 'package:app/domain/repository/logging_repo.dart';
import 'package:dio/dio.dart';
import 'package:kiwi/kiwi.dart';
//#1
const String KEY_LOGGED_HEADER = "isLogged";
class AuthenticationInterceptor extends Interceptor{
@GET('Search/Deals')
@Http.Headers(<String, dynamic>{KEY_LOGGED_HEADER: "true"})
Future<SearchDealsResp> searchDealsByCompany(
@Query("itemsPerPage") int itemsPerPage,
@Query("pageIndex") int pageIndex,
@Query("companyId") int companyId,
@Queries() Map<String, dynamic> queries);
@GET('Deals/productCategories')
Future<CategoryResp> productCategoriesInCompany(@Query("supplierId") int supplierId);
@namphho
namphho / authentication_interceptor_retry.dart
Created May 3, 2021 06:01
authentication intercepto retry
import 'package:app/data/storage/auth/auth_shared_references.dart';
import 'package:app/domain/repository/auth_repo.dart';
import 'package:dio/dio.dart';
import 'package:kiwi/kiwi.dart';
class AuthenticationInterceptor extends Interceptor{
final Dio _dio;
AuthenticationInterceptor(this._dio);
import 'package:app/data/storage/auth/auth_shared_references.dart';
import 'package:dio/dio.dart';
import 'package:kiwi/kiwi.dart';
class AuthenticationInterceptor extends Interceptor{
AuthSharedPreferences _authSharedPreferences = KiwiContainer().resolve<AuthSharedPreferences>();
@override
Future onRequest(RequestOptions options) async {
import 'package:dio/dio.dart';
class AuthenticationInterceptor extends Interceptor{
@override
Future onRequest(RequestOptions options) {
return super.onRequest(options);
}
@override
@namphho
namphho / main_2.dart
Created May 2, 2021 05:14
didUpdateWidget
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
@namphho
namphho / main.dart
Created May 2, 2021 05:07
didDependencyChanges
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override