Browse Source

[flutter]: fix scrollbar does't have default animation for styleed_widget

appflowy 3 years ago
parent
commit
3bd147a058

+ 1 - 1
app_flowy/.vscode/settings.json

@@ -1,6 +1,6 @@
 {
     "[dart]": {
-        "editor.formatOnSave": false,
+        "editor.formatOnSave": true,
         "editor.formatOnType": true,
         "editor.rulers": [
             120

+ 4 - 2
app_flowy/packages/flowy_infra_ui/lib/style_widget/scrolling/styled_scroll_bar.dart

@@ -173,7 +173,7 @@ class ScrollbarState extends State<StyledScrollbar> {
               ),
             ),
           )
-        ]).opacity(showHandle ? 1.0 : 0.0, animate: false);
+        ]).opacity(showHandle ? 1.0 : 0.0, animate: true);
       },
     );
   }
@@ -237,7 +237,9 @@ class ScrollbarListStack extends StatelessWidget {
             trackColor: trackColor,
             handleColor: handleColor,
           ),
-        ),
+        )
+            // The animate will be used by the children that using styled_widget.
+            .animate(const Duration(milliseconds: 250), Curves.easeOut),
       ],
     );
   }