浏览代码

Made loading photos screen scrollable

ashilkn 3 年之前
父节点
当前提交
073aa2ebd1
共有 2 个文件被更改,包括 70 次插入70 次删除
  1. 0 1
      .vscode/launch.json
  2. 70 69
      lib/ui/loading_photos_widget.dart

+ 0 - 1
.vscode/launch.json

@@ -4,7 +4,6 @@
     // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
     "version": "0.2.0",
     "configurations": [
-    
         {
             "name": "Android Prod",
             "request": "launch",

+ 70 - 69
lib/ui/loading_photos_widget.dart

@@ -83,81 +83,82 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
     final isLightMode =
         MediaQuery.of(context).platformBrightness == Brightness.light;
     return Scaffold(
-      body: Center(
-        child: Padding(
-          padding: const EdgeInsets.symmetric(horizontal: 20),
-          child: Column(
-            crossAxisAlignment: CrossAxisAlignment.center,
-            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
-            children: [
-              Stack(
-                alignment: Alignment.center,
-                children: [
-                  isLightMode
-                      ? Image.asset(
-                          'assets/loading_photos_light.png',
-                          color: Colors.white.withOpacity(0.5),
-                          colorBlendMode: BlendMode.modulate,
-                        )
-                      : Image.asset(
-                          'assets/loading_photos_light.png',
-                          color: Colors.white.withOpacity(0.25),
-                          colorBlendMode: BlendMode.modulate,
-                        ),
-                  Lottie.asset(
-                    'assets/loadingGalleryLottie.json',
-                    height: 400,
-                  )
-                ],
-              ),
-              Text(
-                "Loading your photos...",
-                style: TextStyle(
-                  color: Theme.of(context).colorScheme.subTextColor,
+      body: SingleChildScrollView(
+        child: Center(
+          child: Padding(
+            padding: const EdgeInsets.symmetric(horizontal: 20),
+            child: Column(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              children: [
+                Stack(
+                  alignment: Alignment.center,
+                  children: [
+                    isLightMode
+                        ? Image.asset(
+                            'assets/loading_photos_light.png',
+                            color: Colors.white.withOpacity(0.5),
+                            colorBlendMode: BlendMode.modulate,
+                          )
+                        : Image.asset(
+                            'assets/loading_photos_light.png',
+                            color: Colors.white.withOpacity(0.25),
+                            colorBlendMode: BlendMode.modulate,
+                          ),
+                    Lottie.asset(
+                      'assets/loadingGalleryLottie.json',
+                      height: 400,
+                    )
+                  ],
                 ),
-              ),
-              Padding(padding: EdgeInsets.all(36)),
-              Column(
-                children: [
-                  Row(
-                    mainAxisAlignment: MainAxisAlignment.start,
-                    children: [
-                      Text(
-                        "Did you know?",
-                        style: Theme.of(context).textTheme.headline6.copyWith(
-                              color: Theme.of(context).colorScheme.greenText,
-                            ),
-                      ),
-                    ],
-                  ),
-                  const SizedBox(
-                    height: 16,
+                Text(
+                  "Loading your photos...",
+                  style: TextStyle(
+                    color: Theme.of(context).colorScheme.subTextColor,
                   ),
-                  SizedBox(
-                    height: 175,
-                    child: Stack(
+                ),
+                const SizedBox(height: 54),
+                Column(
+                  children: [
+                    Row(
+                      mainAxisAlignment: MainAxisAlignment.start,
                       children: [
-                        PageView.builder(
-                          scrollDirection: Axis.vertical,
-                          controller: _pageController,
-                          itemBuilder: (context, index) {
-                            return _getMessage(_messages[index]);
-                          },
-                          itemCount: _messages.length,
-                          physics: NeverScrollableScrollPhysics(),
+                        Text(
+                          "Did you know?",
+                          style: Theme.of(context).textTheme.headline6.copyWith(
+                                color: Theme.of(context).colorScheme.greenText,
+                              ),
                         ),
-                        Positioned(
-                          bottom: 0,
-                          left: 0,
-                          right: 0,
-                          child: BottomShadowWidget(),
-                        )
                       ],
                     ),
-                  ),
-                ],
-              ),
-            ],
+                    const SizedBox(
+                      height: 16,
+                    ),
+                    SizedBox(
+                      height: 175,
+                      child: Stack(
+                        children: [
+                          PageView.builder(
+                            scrollDirection: Axis.vertical,
+                            controller: _pageController,
+                            itemBuilder: (context, index) {
+                              return _getMessage(_messages[index]);
+                            },
+                            itemCount: _messages.length,
+                            physics: NeverScrollableScrollPhysics(),
+                          ),
+                          Positioned(
+                            bottom: 0,
+                            left: 0,
+                            right: 0,
+                            child: BottomShadowWidget(),
+                          )
+                        ],
+                      ),
+                    ),
+                  ],
+                ),
+              ],
+            ),
           ),
         ),
       ),