소스 검색

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

appflowy 3 년 전
부모
커밋
3bd147a058
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      app_flowy/.vscode/settings.json
  2. 4 2
      app_flowy/packages/flowy_infra_ui/lib/style_widget/scrolling/styled_scroll_bar.dart

+ 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),
       ],
     );
   }