Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mm #9

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

Mm #9

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hoga_load">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:label="hoga_load"
android:name="${applicationName}"
Expand Down
5 changes: 5 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ android.useAndroidX=true
android.enableJetifier=true







Binary file added assets/images/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/30day.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Group 959.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Rectangle 18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Rectangle 21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Rectangle 26.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Vector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/bronze.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/gold.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/image1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/image2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/image3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/image4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/img1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/img2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/img3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/img4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/img5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/img7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/img8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/jop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/load.png
Binary file added assets/images/omg6.png
Binary file added assets/images/product.png
Binary file added assets/images/silver.png
Binary file added assets/images/star.png
41 changes: 41 additions & 0 deletions lib/core/bloc_observer.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import 'dart:async';

import 'package:bloc/bloc.dart';

class SimpleBlocObserver extends BlocObserver {
@override
void onCreate(BlocBase bloc) {
super.onCreate(bloc);
print('onCreate -- bloc: ${bloc.runtimeType}');
}

@override
void onEvent(Bloc bloc, Object? event) {
super.onEvent(bloc, event);
print('onEvent -- bloc: ${bloc.runtimeType}, event: $event');
}

@override
void onChange(BlocBase bloc, Change change) {
super.onChange(bloc, change);
print('onChange -- bloc: ${bloc.runtimeType}, change: $change');
}

@override
void onTransition(Bloc bloc, Transition transition) {
super.onTransition(bloc, transition);
print('onTransition -- bloc: ${bloc.runtimeType}, transition: $transition');
}

@override
void onError(BlocBase bloc, Object error, StackTrace stackTrace) {
print('onError -- bloc: ${bloc.runtimeType}, error: $error');
super.onError(bloc, error, stackTrace);
}

@override
void onClose(BlocBase bloc) {
super.onClose(bloc);
print('onClose -- bloc: ${bloc.runtimeType}');
}
}
3 changes: 2 additions & 1 deletion lib/core/color_manager/color_manager.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:ui';

import 'package:flutter/material.dart';

class ColorManager {
Expand All @@ -15,7 +16,7 @@ class ColorManager {
static const Color lightGrey =Color(0xFF808080);

static const Color darkBrown =Color(0xFFDC52F);
static const Color orange=Color(0xFFFDC52F);
static const Color yellow=Color(0xFFFDC52F);

// static const Color grey =Color(0xFFE8E8E8);

Expand Down
136 changes: 57 additions & 79 deletions lib/core/data/api/api.dart
Original file line number Diff line number Diff line change
@@ -1,97 +1,75 @@

import 'package:dio/dio.dart';

import '../../dialoges/toast.dart';
import '../models/response.dart';

class Api{
String baseUrl='https://hegaload.com/api/';

Future<dynamic> getHttp({required url, data,authToken})async{
try{

var response=await Dio().get(baseUrl+'$url',options:
Options(headers:{
"auth":authToken
} ),
queryParameters: data

);
class Api {
String baseUrl = 'https://hegaload.com/api/';

if(response.statusCode==200){return response.data;}
}on DioError catch(e){
ResponseModel responseModel=ResponseModel.fromJson(e.response);
print('------------------------');
print(responseModel.status);
print(responseModel.message);
print(e.response);
Future<dynamic> getHttp({required url, data, authToken, self}) async {
try {
var response = await Dio().get(baseUrl + '$url',
options: Options(headers: {"auth": authToken, "self": self}),
queryParameters: data);



print(e.response!.data['message']);
showToast(msg: e.response!.data['message'].toString(), state: ToastedStates.ERROR);

}
if (response.statusCode == 200) {
return response.data;
}
} on DioError catch (e) {
// ResponseModel responseModel=ResponseModel.fromJson(e.response!.data);
print('------------------------');
print(e.error);
print('------------------------');
}
}

Future<dynamic> postHttp({required url, required data,authToken,queryParams })async{

try{
var response=await Dio().post(baseUrl+'$url',data: data,queryParameters:queryParams,options:
Options(headers:{
"auth":authToken
}, )
);


if(response.statusCode==200){
Future<dynamic> postHttp({required url, data, authToken, queryParams}) async {
try {
var response = await Dio().post(baseUrl + '$url',
data: data,
queryParameters: queryParams,
options: Options(
headers: {
"auth": authToken,
},
));

if (response.statusCode == 200) {
print(response.data);
print(response.statusCode);
return response.data;
return response.data;
}

}on DioError catch(e){

// ResponseModel responseModel=ResponseModel.fromJson(e.response!.data());
// print('------------------------');
// print(responseModel.status);
// print(responseModel.message);
// print('------------------------');
} on DioError catch (e) {
// ResponseModel responseModel = ResponseModel.fromJson(e.response!.data);
print('------------------------');
print(e.error);
print(e.response);
print(e.response!.data['message']);
showToast(msg: e.response!.data['message'].toString(), state: ToastedStates.ERROR);
throw Exception();

print('------------------------');

// showToast(msg: responseModel.message.toString(), state: ToastedStates.ERROR);
throw Exception(e.error);
}
}

Future<dynamic> putHttp({required url, required data,authToken })async{

try{
var response=await Dio().patch(baseUrl+'$url',data: data,options:
Options(headers:{
"auth":authToken
} )
);
if(response.statusCode==200){
print('-----------------------');
print('success');
print(response.data);
return response.data;
}

}on DioError catch(e){
print('------------------------');
print('faied');

print(e.response);
print(e.response!.data['message']);
showToast(msg: e.response!.data['message'].toString(), state: ToastedStates.ERROR);


}
}
}

Future<dynamic> putHttp({required url, required data, authToken}) async {
try {
var response = await Dio().patch(baseUrl + '$url',
data: data, options: Options(headers: {"auth": authToken}));
if (response.statusCode == 200) {
print('-----------------------');
print('success');
print(response.data);
return response.data;
}
} on DioError catch (e) {
print('------------------------');
print('faied');

print(e.response);
print(e.response!.data['message']);
showToast(
msg: e.response!.data['message'].toString(),
state: ToastedStates.ERROR);
}
}
}
64 changes: 0 additions & 64 deletions lib/core/data/models/GetProduct_model.dart

This file was deleted.

Loading