Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- git lab
- styled components
- ngrok실행
- input type=file
- bootstrap
- getModifierState
- ngrok설치
- createGlobalStyle
- npm styled-reset
- 컨디셔널 렌더링
- dart 변수
- API 토큰
- fetch
- rewrites
- nextjs
- github io
- There isn’t anything to compare
- next.js css
- CSS
- Git
- API token
- nextjs .env
- react
- nextjs 설치
- react typescript
- github
- typescript react
- SCSS
- react env
- icon
Archives
- Today
- Total
꾸준히 성장하는 개발자
[Flutter] card-swiper 본문
flutter도 다양한 라이브러리를 사용할 수 있는데
swiper 를 이용해야 해서 패키지를 찾던중 여러가지가 있었는데
그중 card-swiper 사용한 걸 정리하려고 한다.
https://pub.dev/packages/card_swiper
card_swiper | Flutter Package
swiper/carousel for flutter, with multiple layouts, infinite loop. Compatible with Android & iOS.
pub.dev
먼저 pubspec.yaml 파일에 사용할 라이브러리들을 작성하고 pub get 해준다.
사용할 위치에서 import 해준다
import 'package:card_swiper/card_swiper.dart';
사용할 위치에서 Swiper를 불러주고 필요한 부분들을 작성해 주면서 넣어주면 된다.
Swiper(
viewportFraction: 0.8, // 전체 슬라이드 아이템 크기
scale: 0.9, // 활성화 슬라이드 아이템 크기
scrollDirection: Axis.horizontal, // 슬라이드 방향
axisDirection: AxisDirection.left, // 정렬
pagination: SwiperPagination(
alignment: Alignment.bottomCenter, // 페이지네이션 위치
builder: SwiperPagination.rect, // 세 가지 스타일의 pagination 사용 가능
), // 페이지네이션
control: SwiperControl(
iconPrevious: Icons.access_alarms_rounded,// 이전 버튼
iconNext: Icons.add,// 다음 버튼
color: Colors.red,// 버튼 색상
disableColor: Colors.lightGreenAccent, // 비활성화 버튼 색상
size: 50.0, // 버튼 크기
),// 컨트롤 방향 버튼
loop: false,// 반복
autoplay: true,// 자동 슬라이드
duration: 300,// 속도
itemCount: 3, // 슬라이드 개수
itemBuilder: (BuildContext ctx, int idx) {
return SizedBox(
child: Column(
children: [
Image.asset(
'images/cat.jpg',
width: MediaQuery
.of(context)
.size
.width,
height: 300,
),
],
),
);
},
),
'Flutter' 카테고리의 다른 글
[Flutter] url_launcher (0) | 2023.03.14 |
---|---|
[Flutter] TextField 클릭시 overflow 대응 (0) | 2023.02.27 |
[Flutter] flutter 아래 가려지는 부분 (0) | 2023.02.24 |
[Flutter] TextField 높이 상위 위젯에 맞추기 / button 높이 넣기 (0) | 2023.02.07 |
[Flutter] button 들 기본 크기, padding값 없애기 (0) | 2023.01.31 |