Story_time은 원본 대응 제품과 비교하여 부드러운 애니메이션과 향상된 사용자 정의 기능을 제공하는 인스타그램 스타일의 스토리 인터페이스를 제공하는 플러터 패키지입니다. 개발자는 스와이프 탐색, 타이머 및 다양한 미디어 지원을 갖춘 상호작용식 전체 화면 스토리 경험을 만들 수 있습니다. 이 패키지는 안드로이드, iOS, 웹, 맥OS, 윈도우, 리눅스를 지원하며, 매력적인 스토리 형식 콘텐츠 표시가 필요한 크로스플랫폼 애플리케이션에 이상적입니다. 광범위한 사용자 정의 옵션을 통해 다양한 디자인 요구 사항에 맞게 외관과 동작을 세밀하게 조정할 수 있습니다.
사용 사례
인터랙티브 스토리 피드
소셜 미디어 앱 기능
사용자 온보딩 튜토리얼
콘텐츠 하이라이트 리얼
매력적인 마케팅 캠페인
주요 기능
풍부한 애니메이션
스와이프 탐색
크로스 플랫폼 지원
높은 사용자 정의 가능한 UI
타이머 기반 스토리 진행
미디어 풍부한 스토리 카드
적합한 대상
모바일 및 웹 앱
소셜 네트워킹 기능
온보딩 경험
마케팅 및 프로모션
크리에이티브 콘텐츠 플랫폼
고려 사항
상태 관리에 신중한 조치가 필요합니다
무거운 미디어와 함께 성능에 영향을 줄 수 있음
사용자 정의 스타일을 사용하려면 Flutter 위젯에 익숙해야 합니다
기본 설정 외에 문서가 제한적
매우 긴 스토리 시퀀스에 최적화되지 않음
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
story_time
A fork of story. Instagram stories like UI with rich animations and even more customizability than the original package.
Usage
StoryPageView needs at least three arguments: itemBuilder, pageLength, and storyLength.
/// Minimum example to explain the usage.returnScaffold(
body: StoryPageView(
itemBuilder: (context, pageIndex, storyIndex) {
returnCenter(
child: Text("Index of PageView: $pageIndex Index of story on each page: $storyIndex"),
);
},
storyLength: (pageIndex) {
return3;
},
pageLength: 4,
);
itemBuilder is necessary to build the content of story. It is called with index of pageView and index of the story on the page.
storyLength decides the length of story for each page. The example above always returns 3, but it should depend on the argument pageIndex
pageLength is just the length of StoryPageView
The example above just shows 12 stories by 4 pages, which is not practical.
This one is the proper usage, extracted from example.
gestureItemBuilder is the builder for the widgets which needs gesture actions.
In this case, IconButton to close the page is in the callback.
You CANNOT place the gesture widgets in itemBuilder because it is covered and disabled by default story gestures.
onPageLimitReached is called when the very last story is finished.
It is recommended to use data model with two layers. In this case, UserModel which has the list of StoryModel
/// Example Data ModelclassUserModel{
UserModel(this.stories, this.userName, this.imageUrl);
finalList<StoryModel> stories;
finalString userName;
finalString imageUrl;
}
classStoryModel{
StoryModel(this.imageUrl);
finalString imageUrl;
}
Controlling animations
My point of forking the original package was to add the ability to
control the duration of a specific index of a story. Look at the example to see how to use it if you are interested.
Callbacks for pausing and unpausing stories
The package also supports adding callbacks for pausing and unpausing a story to the StoryPageView widget. See the example project for more
details.
Callbacks for moving to a different page
The package also supports adding callbacks for going a page backwards and for going a page forwards to the StoryPageView widget. See the example project for more details.
Callbacks for moving to a different story
The package also supports adding a callback for whenever the story index changes to the StoryPageView widget. See the example project for more details.
Tips
This package is still under development. If you have any requests or questions, please ask on github