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

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

@ -19,32 +19,46 @@ class AssetsLoadingPage extends StatelessWidget {
final headline1 = Theme.of(context).textTheme.headline1; final headline1 = Theme.of(context).textTheme.headline1;
return BlocBuilder<AssetsManagerCubit, AssetsManagerState>( return BlocBuilder<AssetsManagerCubit, AssetsManagerState>(
builder: (context, state) { builder: (context, state) {
return Container( return SingleChildScrollView(
decoration: const CrtBackground(), child: Container(
child: Center( decoration: const CrtBackground(),
child: Column( child: Center(
mainAxisSize: MainAxisSize.min, child: Column(
children: [ mainAxisSize: MainAxisSize.min,
Padding( children: [
padding: const EdgeInsets.symmetric(horizontal: 20), Padding(
child: Assets.images.loadingGame.ioPinball.image(), 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,
), ),
], 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