소스 검색

add animation between search screens inside indexedStack

ashilkn 1 년 전
부모
커밋
bc31578edd
3개의 변경된 파일12개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      lib/ui/search_tab.dart
  2. 8 0
      pubspec.lock
  3. 1 0
      pubspec.yaml

+ 3 - 1
lib/ui/search_tab.dart

@@ -1,3 +1,4 @@
+import "package:fade_indexed_stack/fade_indexed_stack.dart";
 import "package:flutter/material.dart";
 import "package:photos/core/constants.dart";
 import "package:photos/models/search/search_result.dart";
@@ -42,7 +43,8 @@ class _SearchTabState extends State<SearchTab> {
     return Padding(
       padding: const EdgeInsets.only(top: 8),
       child: AllSectionsExamplesProvider(
-        child: IndexedStack(
+        child: FadeIndexedStack(
+          duration: const Duration(milliseconds: 150),
           index: index,
           children: [
             const AllSearchSections(),

+ 8 - 0
pubspec.lock

@@ -460,6 +460,14 @@ packages:
       url: "https://pub.dev"
     source: hosted
     version: "3.6.0"
+  fade_indexed_stack:
+    dependency: "direct main"
+    description:
+      name: fade_indexed_stack
+      sha256: "0d625709d0bf6d0fa275cfa4eba84695fdea93d672c47413cdb49bcbe758a9f3"
+      url: "https://pub.dev"
+    source: hosted
+    version: "0.2.2"
   fake_async:
     dependency: transitive
     description:

+ 1 - 0
pubspec.yaml

@@ -53,6 +53,7 @@ dependencies:
   expandable: ^5.0.1
   expansion_tile_card: ^3.0.0
   extended_image: ^8.1.1
+  fade_indexed_stack: ^0.2.2
   fast_base58: ^0.2.1
   # https://github.com/incrediblezayed/file_saver/issues/86
   file_saver: 0.2.8