forked from eatvio/eatvio_app
feature(registration): remove .env
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
//import 'package:eatvio_app/presentation/auth/auth_screen/auth_screen.dart';
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:eatvio_app/app_router.dart';
|
||||
import 'package:eatvio_app/presentation/profile/my_profile_screen/models/my_profile_model.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/profile/my_profile_screen/models/my_profile_model.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'dart:convert';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
||||
import '/core/app_export.dart';
|
||||
|
||||
part 'my_profile_event.dart';
|
||||
part 'my_profile_state.dart';
|
||||
@@ -36,7 +36,7 @@ class MyProfileBloc extends Bloc<MyProfileEvent, MyProfileState> {
|
||||
//final token =
|
||||
// "9|laravel_sanctum_KFXbccDcWEvTPfJmV99EQv1ne AggmpR2TidVGDPN34fa201a";
|
||||
final response = await http.get(
|
||||
Uri.parse(dotenv.env['SERVER_ROOT']! + '/profile/index'),
|
||||
Uri.parse(baseUrl + '/api/profile/index'),
|
||||
headers: {
|
||||
'Authorization': 'Bearer $token',
|
||||
},
|
||||
@@ -278,7 +278,7 @@ class MyProfileBloc extends Bloc<MyProfileEvent, MyProfileState> {
|
||||
}
|
||||
|
||||
Future<String> uploadImageToServer(String imagePath, String? token) async {
|
||||
String url = '${dotenv.env['SERVER_ROOT']!}/profile/photo/upload';
|
||||
String url = '${baseUrl}/api/profile/photo/upload';
|
||||
print(url);
|
||||
var request = http.MultipartRequest('POST', Uri.parse(url));
|
||||
request.headers['Authorization'] = 'Bearer $token';
|
||||
|
||||
@@ -12,49 +12,48 @@ class MyProfileState extends Equatable {
|
||||
}
|
||||
|
||||
class MyProfileInitialState extends MyProfileState {
|
||||
MyProfileInitialState({required MyProfileModel myProfileModelObj})
|
||||
: super(myProfileModelObj: myProfileModelObj);
|
||||
MyProfileInitialState({required MyProfileModel myProfileModelObj}) : super(myProfileModelObj: myProfileModelObj);
|
||||
}
|
||||
|
||||
/// Represents the state of MyProfile in the application.
|
||||
class MyProfileLoadedState extends MyProfileState {
|
||||
MyProfileLoadedState(
|
||||
{this.chestCircumferenceController,
|
||||
this.waistCircumferenceController,
|
||||
this.hipCircumferenceController,
|
||||
this.myProfileModelObj,
|
||||
this.weightController,
|
||||
this.user,
|
||||
this.userDetails,
|
||||
this.chartPoints,
|
||||
this.chartDates,
|
||||
this.plans,
|
||||
this.token,
|
||||
this.selectedCountry,
|
||||
this.selectedCity,
|
||||
this.selectedActivity,
|
||||
this.chestCircumferenceFormController,
|
||||
this.waistCircumferenceFormController,
|
||||
this.hipCircumferenceFormController,
|
||||
this.firstNameFormController,
|
||||
this.lastNameFormController,
|
||||
this.countryFormController,
|
||||
this.dateFormController,
|
||||
this.cityFormController,
|
||||
this.heightFormController,
|
||||
this.weightFormController,
|
||||
this.upPressureFormController,
|
||||
this.downPressureFormController,
|
||||
this.allergiesFormController,
|
||||
this.pillsFormController,
|
||||
this.sportsFormController,
|
||||
this.favoriteFormController,
|
||||
this.unfavoriteFormController,
|
||||
this.additionalFormController,
|
||||
this.hypoFormController,
|
||||
this.hyperFormController,
|
||||
this.circumferences,})
|
||||
: super(myProfileModelObj: null);
|
||||
MyProfileLoadedState({
|
||||
this.chestCircumferenceController,
|
||||
this.waistCircumferenceController,
|
||||
this.hipCircumferenceController,
|
||||
this.myProfileModelObj,
|
||||
this.weightController,
|
||||
this.user,
|
||||
this.userDetails,
|
||||
this.chartPoints,
|
||||
this.chartDates,
|
||||
this.plans,
|
||||
this.token,
|
||||
this.selectedCountry,
|
||||
this.selectedCity,
|
||||
this.selectedActivity,
|
||||
this.chestCircumferenceFormController,
|
||||
this.waistCircumferenceFormController,
|
||||
this.hipCircumferenceFormController,
|
||||
this.firstNameFormController,
|
||||
this.lastNameFormController,
|
||||
this.countryFormController,
|
||||
this.dateFormController,
|
||||
this.cityFormController,
|
||||
this.heightFormController,
|
||||
this.weightFormController,
|
||||
this.upPressureFormController,
|
||||
this.downPressureFormController,
|
||||
this.allergiesFormController,
|
||||
this.pillsFormController,
|
||||
this.sportsFormController,
|
||||
this.favoriteFormController,
|
||||
this.unfavoriteFormController,
|
||||
this.additionalFormController,
|
||||
this.hypoFormController,
|
||||
this.hyperFormController,
|
||||
this.circumferences,
|
||||
}) : super(myProfileModelObj: null);
|
||||
|
||||
MyProfileModel? myProfileModelObj;
|
||||
Map<String, dynamic>? user;
|
||||
@@ -174,42 +173,27 @@ class MyProfileLoadedState extends MyProfileState {
|
||||
chartPoints: chartPoints ?? this.chartPoints,
|
||||
chartDates: chartDates ?? this.chartDates,
|
||||
weightController: weightController ?? this.weightController,
|
||||
chestCircumferenceController:
|
||||
chestCircumferenceController ?? this.chestCircumferenceController,
|
||||
waistCircumferenceController:
|
||||
waistCircumferenceController ?? this.waistCircumferenceController,
|
||||
hipCircumferenceController:
|
||||
hipCircumferenceController ?? this.hipCircumferenceController,
|
||||
chestCircumferenceFormController: chestCircumferenceFormController ??
|
||||
this.chestCircumferenceFormController,
|
||||
waistCircumferenceFormController: waistCircumferenceFormController ??
|
||||
this.waistCircumferenceFormController,
|
||||
hipCircumferenceFormController:
|
||||
hipCircumferenceFormController ?? this.hipCircumferenceFormController,
|
||||
firstNameFormController:
|
||||
firstNameFormController ?? this.firstNameFormController,
|
||||
lastNameFormController:
|
||||
lastNameFormController ?? this.lastNameFormController,
|
||||
countryFormController:
|
||||
countryFormController ?? this.countryFormController,
|
||||
chestCircumferenceController: chestCircumferenceController ?? this.chestCircumferenceController,
|
||||
waistCircumferenceController: waistCircumferenceController ?? this.waistCircumferenceController,
|
||||
hipCircumferenceController: hipCircumferenceController ?? this.hipCircumferenceController,
|
||||
chestCircumferenceFormController: chestCircumferenceFormController ?? this.chestCircumferenceFormController,
|
||||
waistCircumferenceFormController: waistCircumferenceFormController ?? this.waistCircumferenceFormController,
|
||||
hipCircumferenceFormController: hipCircumferenceFormController ?? this.hipCircumferenceFormController,
|
||||
firstNameFormController: firstNameFormController ?? this.firstNameFormController,
|
||||
lastNameFormController: lastNameFormController ?? this.lastNameFormController,
|
||||
countryFormController: countryFormController ?? this.countryFormController,
|
||||
dateFormController: dateFormController ?? this.dateFormController,
|
||||
cityFormController: cityFormController ?? this.cityFormController,
|
||||
heightFormController: heightFormController ?? this.heightFormController,
|
||||
weightFormController: weightFormController ?? this.weightFormController,
|
||||
upPressureFormController:
|
||||
upPressureFormController ?? this.upPressureFormController,
|
||||
downPressureFormController:
|
||||
downPressureFormController ?? this.downPressureFormController,
|
||||
allergiesFormController:
|
||||
allergiesFormController ?? this.allergiesFormController,
|
||||
upPressureFormController: upPressureFormController ?? this.upPressureFormController,
|
||||
downPressureFormController: downPressureFormController ?? this.downPressureFormController,
|
||||
allergiesFormController: allergiesFormController ?? this.allergiesFormController,
|
||||
pillsFormController: pillsFormController ?? this.pillsFormController,
|
||||
sportsFormController: sportsFormController ?? this.sportsFormController,
|
||||
favoriteFormController:
|
||||
favoriteFormController ?? this.favoriteFormController,
|
||||
unfavoriteFormController:
|
||||
unfavoriteFormController ?? this.unfavoriteFormController,
|
||||
additionalFormController:
|
||||
additionalFormController ?? this.additionalFormController,
|
||||
favoriteFormController: favoriteFormController ?? this.favoriteFormController,
|
||||
unfavoriteFormController: unfavoriteFormController ?? this.unfavoriteFormController,
|
||||
additionalFormController: additionalFormController ?? this.additionalFormController,
|
||||
token: token ?? this.token,
|
||||
selectedCountry: selectedCountry ?? this.selectedCountry,
|
||||
selectedCity: selectedCity ?? this.selectedCity,
|
||||
|
||||
Reference in New Issue
Block a user