From 0d5fdad7918aae9af0d8a74fac6a6895b308eed0 Mon Sep 17 00:00:00 2001
From: vjrj <vjrj@comunes.org>
Date: Wed, 5 Apr 2023 00:10:52 +0200
Subject: [PATCH] Fix Expand error

---
 lib/ui/widgets/loading_box.dart | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/lib/ui/widgets/loading_box.dart b/lib/ui/widgets/loading_box.dart
index 8e8132c4..bd5ad124 100644
--- a/lib/ui/widgets/loading_box.dart
+++ b/lib/ui/widgets/loading_box.dart
@@ -1,18 +1,31 @@
 import 'package:flutter/material.dart';
 
+class LoadingWidget extends StatelessWidget {
+  const LoadingWidget({super.key});
+
+  @override
+  Widget build(BuildContext context) {
+    return const SizedBox(
+        width: 100.0,
+        height: 100.0,
+        child: Center(
+          child: CircularProgressIndicator(),
+        ));
+  }
+}
+
 class LoadingBox extends StatelessWidget {
-  const LoadingBox({super.key});
+  const LoadingBox({super.key, required this.simple});
+
+  final bool simple;
 
   @override
   Widget build(BuildContext context) {
-    return const Expanded(
-      child: SizedBox(
-          width: 100.0,
-          height: 100.0,
-          child: Center(
-            child: CircularProgressIndicator(),
-          )),
-    );
+    return simple
+        ? const LoadingWidget()
+        : const Expanded(
+            child: LoadingWidget(),
+          );
   }
 }
 
-- 
GitLab