FLUTTER ECOSYSTEM

alnitak/magnifying_glass

버렐/핀쿠션 왜곡을 갖춘 Flutter 실시간 확대 렌즈 위젯

돋보기 프로젝트 이미지
Stars
24
Forks
3
최근 푸시(UTC)
2024. 9. 28.
프로젝트 상태
활성
Marco Bavagnoli GitHub avatar
GITHUB User

Marco Bavagnoli ↗

Flutter :blue_heart: dev

https://github.com/Flutter-Italia-DevelopersEarth @45.317506N공식 웹사이트 ↗
언어DartC++CMakeHTMLSwiftCJavaKotlinObjective-C

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 3 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}
  • flutter_lints개발 의존성^5.0.0

원본 README

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

README 펼치기 / 접기

MagnifyingGlass Flutter plugin

Flutter real-time magnifying glass lens widget with Barrel/Pincushion distortion.

Screenshot

Buy Me A Coffee

Getting Started

Make [MagnifyingGlass] widget as the parent of the widget you wish to be used (usually MyHomePage).

    @override
    Widget build(BuildContext context) {
    MagnifyingGlassController magnifyingGlassController = MagnifyingGlassController();
    return MagnifyingGlass(
      controller: magnifyingGlassController,
      glassPosition: GlassPosition.touchPosition,
      borderThickness: 8.0,
      borderColor: Colors.grey,
      glassParams: GlassParams(
        startingPosition: Offset(150, 150),
        diameter: 150,
        distortion: 1.0,
        magnification: 1.2,
        padding: EdgeInsets.all(10),
      ),
      child: Scaffold( 
        body: ...,

        floatingActionButton: FloatingActionButton(
          onPressed: () => magnifyingGlassController.openGlass(),
          child: const Icon(Icons.search),
        ),
      )
    );

MagnifyingGlass properties

Name Type Description
controller MagnifyingGlassController Let you control the glass state and parameters:
openGlass()
closeGlass()
setDistortion( double distortion, double magnification )
setDiameter( int diameter )
refresh()
glassPosition enum enum to set the touch behavior or sticky position
glassParams GlassParams class to set lens parameters
borderColor Color border color
borderThickness double border thickness
elevation double shadow elevation
shadowOffset Offset shadow offset

GlassPosition class

Name Description
touchPosition move the glass with finger touch
topLeft sticky position to top left corner of the screen
topRight sticky position to top rigth corner of the screen
bottomLeft sticky position to bottom left corner of the screen
bottomRight sticky position to bottom right corner of the screen

GlassParams class

Name Description
startingPosition the startin glass position. If not given the lens will be placed at the center of the screen.
diameter the diameter of the glass
magnification the magnification of the lens
1 means no magnification
>1 means magnification
<1 means shrinking
distortion Barrel/Pincushion distortion power
0 means no distortion
padding the padding surrounding the glass to enlarge touching area
distorsion0.5-mag1.0.png distorsion0.5-mag1.4.png distorsion2.0-mag1.7.png
distorsion 0.5
mag 1.0
distorsion 0.5
mag 1.4
distorsion 2.0
mag 1.7