lab6 ошибки фикс (* ^ ω ^)
This commit is contained in:
parent
66ec21d64a
commit
d8f7c11768
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user