forked from eatvio/eatvio_app
feature(registration): remove .env
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
//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/users/subscribers_screen/models/subscribers_model.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/users/subscribers_screen/models/subscribers_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:go_router/go_router.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import '/core/app_export.dart';
|
||||
|
||||
part 'subscribers_event.dart';
|
||||
part 'subscribers_state.dart';
|
||||
@@ -32,7 +32,7 @@ class SubscribersBloc extends Bloc<SubscribersEvent, SubscribersState> {
|
||||
AppRouter.navigatorKey.currentContext?.goNamed('authScreen');
|
||||
}
|
||||
final response = await http.get(
|
||||
Uri.parse(dotenv.env['SERVER_ROOT']! + '/profile/subscribers'),
|
||||
Uri.parse(baseUrl + '/api/profile/subscribers'),
|
||||
headers: {
|
||||
'Authorization': 'Bearer $token',
|
||||
},
|
||||
|
||||
@@ -12,14 +12,12 @@ class SubscribersState extends Equatable {
|
||||
}
|
||||
|
||||
class SubscribersInitialState extends SubscribersState {
|
||||
SubscribersInitialState({required SubscribersModel myProfileModelObj})
|
||||
: super(myProfileModelObj: myProfileModelObj);
|
||||
SubscribersInitialState({required SubscribersModel myProfileModelObj}) : super(myProfileModelObj: myProfileModelObj);
|
||||
}
|
||||
|
||||
/// Represents the state of Subscribers in the application.
|
||||
class SubscribersLoadedState extends SubscribersState {
|
||||
SubscribersLoadedState({this.myProfileModelObj, this.subscribers})
|
||||
: super(myProfileModelObj: null);
|
||||
SubscribersLoadedState({this.myProfileModelObj, this.subscribers}) : super(myProfileModelObj: null);
|
||||
|
||||
SubscribersModel? myProfileModelObj;
|
||||
dynamic subscribers;
|
||||
|
||||
@@ -1,23 +1,20 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/feed/feed_screen/widgets/feed_search_view.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart';
|
||||
import 'package:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'bloc/subscribers_bloc.dart';
|
||||
import 'models/subscribers_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/feed/feed_screen/widgets/feed_search_view.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart';
|
||||
import 'package:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SubscribersScreen extends StatelessWidget {
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<SubscribersBloc>(
|
||||
create: (context) => SubscribersBloc(
|
||||
SubscribersState(myProfileModelObj: SubscribersModel()))
|
||||
..add(SubscribersInitialEvent()),
|
||||
create: (context) => SubscribersBloc(SubscribersState(myProfileModelObj: SubscribersModel()))..add(SubscribersInitialEvent()),
|
||||
child: SubscribersScreen());
|
||||
}
|
||||
|
||||
@@ -73,8 +70,7 @@ class SubscribersScreen extends StatelessWidget {
|
||||
leadingWidth: 28.h,
|
||||
leading: AppbarLeadingImage(
|
||||
imagePath: ImageConstant.imgArrowLeft,
|
||||
margin:
|
||||
EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v),
|
||||
margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v),
|
||||
onTap: () => GoRouter.of(context).pop(),
|
||||
),
|
||||
title: Padding(
|
||||
@@ -83,14 +79,12 @@ class SubscribersScreen extends StatelessWidget {
|
||||
children: [
|
||||
AppbarSubtitle(
|
||||
text: "Мои подписчики",
|
||||
margin: EdgeInsets.only(
|
||||
left: 80.h, top: 12.v, bottom: 9.v),
|
||||
margin: EdgeInsets.only(left: 80.h, top: 12.v, bottom: 9.v),
|
||||
),
|
||||
Spacer(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 20.0),
|
||||
child: GestureDetector(
|
||||
child: Icon(Icons.create_outlined)),
|
||||
child: GestureDetector(child: Icon(Icons.create_outlined)),
|
||||
)
|
||||
],
|
||||
),
|
||||
@@ -145,8 +139,7 @@ class SubscribersScreen extends StatelessWidget {
|
||||
flex: 1,
|
||||
child: CustomOutlinedButton(
|
||||
text: "+",
|
||||
onPressed: () =>
|
||||
GoRouter.of(context).goNamed('blogPostCreateScreen'),
|
||||
onPressed: () => GoRouter.of(context).goNamed('blogPostCreateScreen'),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
),
|
||||
),
|
||||
@@ -190,7 +183,7 @@ class SubscribersScreen extends StatelessWidget {
|
||||
),
|
||||
child: ListTile(
|
||||
leading: CachedNetworkImage(
|
||||
imageUrl: dotenv.env['STORAGE_URL']! + subscriber['image'],
|
||||
imageUrl: baseUrl + '/storage/' + subscriber['image'],
|
||||
imageBuilder: (context, imageProvider) => CircleAvatar(
|
||||
backgroundImage: imageProvider,
|
||||
radius: 25,
|
||||
|
||||
Reference in New Issue
Block a user