lab6 ошибки фикс (* ^ ω ^)

This commit is contained in:
sofia7ya 2024-12-18 16:27:22 +04:00
parent 66ec21d64a
commit d8f7c11768
2 changed files with 5 additions and 5 deletions

View File

@ -12,7 +12,7 @@ class PotterRepository extends ApiInterface {
requestBody: true,
));
static const String _baseUrl = 'https://api.potterdb.com';
static const String _baseUrl = 'https://api.pot----terdb.com';
@override
Future<HomeData?> loadData({
@ -37,7 +37,7 @@ class PotterRepository extends ApiInterface {
final HomeData data = dto.toDomain();
return data;
} on DioException catch (e) {
onError?.call(e.error?.toString());
onError?.call(e.error?.toString() ?? e.type.toString());
return null;
}
}

View File

@ -49,7 +49,7 @@ class _BodyState extends State<_Body> {
}
void _onNextPageListener() {
if (scrollController.offset > scrollController.position.maxScrollExtent) {
if (scrollController.offset >= scrollController.position.maxScrollExtent) {
// preventing multiple pagination request on multiple swipes
final bloc = context.read<HomeBloc>();
if (!bloc.state.isPaginationLoading) {
@ -84,7 +84,8 @@ class _BodyState extends State<_Body> {
),
),
BlocBuilder<HomeBloc, HomeState>(
builder: (context, state) => state.error != null
builder: (context, state)
=> state.error != null
? Text(
state.error ?? '',
style: Theme.of(context).textTheme.headlineSmall?.copyWith(color: Colors.red),
@ -95,7 +96,6 @@ class _BodyState extends State<_Body> {
child: RefreshIndicator(
onRefresh: _onRefresh,
child: ListView.builder(
physics: BouncingScrollPhysics(),
controller: scrollController,
padding: EdgeInsets.zero,
itemCount: state.data?.data?.length ?? 0,