Project import generated by Copybara.

GitOrigin-RevId: cadf71e71d562565a85bec91993f1f947bcd2845
This commit is contained in:
Madari Developers 2025-01-03 11:15:22 +05:30
parent ff9ece0628
commit af06c03549
4 changed files with 36 additions and 4 deletions

View file

@ -262,7 +262,7 @@ class StremioConnectionService extends BaseConnectionService {
.toList(),
);
yield streams;
if (streams.isNotEmpty) yield streams;
}
}

View file

@ -1,8 +1,10 @@
import 'package:cached_query_flutter/cached_query_flutter.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:madari_client/engine/engine.dart';
import 'package:madari_client/features/connections/service/base_connection_service.dart';
import 'package:madari_client/features/connections/types/base/base.dart';
import 'package:pocketbase/pocketbase.dart';
import 'package:shimmer/shimmer.dart';
import '../../../../utils/grid.dart';
@ -43,8 +45,35 @@ class _RenderLibraryListState extends State<RenderLibraryList> {
}
if (state.status == QueryStatus.error) {
return Center(
child: Text("Something went wrong ${state.error}"),
final errorMessage = (
state.error is ClientException
? (state.error as ClientException).response["message"]
: "",
);
return SizedBox(
height: _getListHeight(context),
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Container(
color: Colors.black45,
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 16,
horizontal: 16,
),
child: Center(
child: Text(
"Something went wrong while loading library\n${errorMessage.$1}",
textAlign: TextAlign.center,
style: GoogleFonts.exo2().copyWith(
fontSize: 16,
),
),
),
),
),
),
);
}

View file

@ -194,7 +194,8 @@ class _RenderStreamListState extends State<RenderStreamList> {
);
}
if (snapshot.data?.isEmpty == true) {
if (snapshot.data?.isEmpty == true &&
snapshot.connectionState == ConnectionState.done) {
return Center(
child: Text(
"No stream found",

View file

@ -223,6 +223,8 @@ class _StremioStreamSelectorState extends State<StremioStreamSelector> {
@override
Widget build(BuildContext context) {
print("Neo");
return StreamBuilder(
stream: _stream,
builder: (context, snapshot) {