pull/438/head
Jorge Coca 3 years ago
parent 632c2dc95e
commit 62f9535797

@ -34,7 +34,7 @@ class AssetsManagerCubit extends Cubit<AssetsManagerState> {
try {
await loadable;
emit(state.copyWith(loaded: [...state.loaded, loadable]));
} catch (error, stackTrace) {
} catch (error, _) {
emit(state.copyWith(error: '$error'));
}
}).toList();

@ -19,32 +19,46 @@ class AssetsLoadingPage extends StatelessWidget {
final headline1 = Theme.of(context).textTheme.headline1;
return BlocBuilder<AssetsManagerCubit, AssetsManagerState>(
builder: (context, state) {
return Container(
decoration: const CrtBackground(),
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Assets.images.loadingGame.ioPinball.image(),
),
const SizedBox(height: 40),
AnimatedEllipsisText(
l10n.loading,
style: headline1,
),
const SizedBox(height: 40),
FractionallySizedBox(
widthFactor: 0.8,
child: PinballLoadingIndicator(value: state.progress),
),
if (state.error != null)
Text(
state.error!,
style: Theme.of(context).textTheme.headline4,
return SingleChildScrollView(
child: Container(
decoration: const CrtBackground(),
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Assets.images.loadingGame.ioPinball.image(),
),
],
const SizedBox(height: 40),
AnimatedEllipsisText(
l10n.loading,
style: headline1,
),
const SizedBox(height: 40),
FractionallySizedBox(
widthFactor: 0.8,
child: PinballLoadingIndicator(value: state.progress),
),
if (state.error != null)
Text(
state.error!,
style: Theme.of(context)
.textTheme
.headline4!
.copyWith(color: PinballColors.red),
),
...state.loaded.map(
(e) => Text(
e.toString(),
style: Theme.of(context)
.textTheme
.headline4!
.copyWith(color: PinballColors.white),
),
),
],
),
),
),
);

Loading…
Cancel
Save