GitHub 저장소htsuruo/smooth_highlight

smooth_highlight

이 패키지는 사용자에게 특정 내용을 강조하고 싶을 때 특정 위젯을 하이라이트 애니메이션으로 강조할 수 있도록 도와줍니다.

smooth_highlight 프로젝트 이미지
스타
6
포크
2
최근 푸시(UTC)
2024. 9. 1.
프로젝트 상태
활성

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

Smooth Highlight

You can emphasize a specific widget by highlight animation when you want to emphasize something to your users. As you can see from the following samples, you can use smooth_highlight in any widget.

And also, you can use ValueChangeHighlight that is useful when you simply want to highlight only the text changes(refer to Sample2). It is inspired by the Cloud Firestore value change animation in the Firebase console.

Sample1 Sample2 Sample3

Usage

You just wrap SmoothHighlight in your widget.

SmoothHighlight(
  // set your custom color
  color: Colors.yellow,
  child: Text('Highlight'),
);

and you can also define custom behavior.

SmoothHighlight(
  // highlight in initState phase.
  useInitialHighLight: true,

  // Set custom duration.
  duration: const Duration(seconds: 1),

  // highlight whenever count is even.
  enabled: count % 2 ==0,
);
ValueChangeHighlight

If you want to highlight the widget only the value changed, ValueChangeHighlight is useful. It requires highlight trigger value.

ValueChangeHighlight(
  // highlight if count changes
  value: count,
  color: Colors.yellow,
  child: Text('count: $count'),
);

if you don't want to highlight a specific values, disableFromValues property prevents it.

ValueChangeHighlight(
  value: count,

  // disable highlight if count changes from `null` or `2` to some value.
  // In this counter example, `0`, `3`, won't be highlighted.
  disableFromValues: const [null, 2],
);

UseCase

Following gif is Firestore GUI in Firebase Console. Firestore realtime listener is powerful, but it is hard for your user to see what value changed. You can make the user notice by highlighting the changed value. It's probably a user-friendly consideration, I think.

Hideki Tsuruoka GitHub avatar
GitHub 작성자

Hideki Tsuruoka ↗

Software Enginner - Flutter / Dart / Firebase

언어DartHTMLSwiftKotlin

분류

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 3 개

  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}
  • flutter_lints개발 의존성^2.0.0

프로젝트에 맞는 저장소를 선택하려면?

사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.

  1. 이름, 작성자 또는 설명으로 검색하고 기술 주제로 범위를 좁힙니다.
  2. 스타, 포크, 최근 푸시를 함께 비교하세요. 스타는 관심의 지표이며 품질을 보장하지 않습니다.
  3. 사용하기 전에 GitHub에서 README, 라이선스, Issues를 확인하세요.

출처 및 관리

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗