Skip to content

Commit d9fd2a1

Browse files
committed
bumped to version 3.0.0
1 parent 95c0505 commit d9fd2a1

26 files changed

+1574
-668
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Bug Report
22
description: File a bug report
33
title: "[Bug]: "
4-
labels: ["bug", "triage"]
5-
assignees: ["nixrajput"]
4+
labels: [ "bug", "triage" ]
5+
assignees: [ "nixrajput" ]
66
body:
77
- type: input
88
id: contact
@@ -25,7 +25,7 @@ body:
2525
attributes:
2626
label: Version
2727
description: What version of our app are you running?
28-
placeholder: 2.0.1
28+
placeholder: ^0.0.1
2929
validations:
3030
required: true
3131
- type: dropdown
@@ -59,7 +59,7 @@ body:
5959
id: terms
6060
attributes:
6161
label: Code of Conduct
62-
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/nixrajput/flutter_carousel_widget/CODE_OF_CONDUCT.md).
62+
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/nixrajput/flutter_carousel_widget/blob/master/CODE_OF_CONDUCT.md).
6363
options:
6464
- label: I agree to follow this project's Code of Conduct
6565
required: true

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Feature request
22
description: Suggest an idea for this project
33
title: "[Feature Request]: "
4-
labels: ["enhancement"]
4+
labels: [ "enhancement" ]
55
assignees:
66
- nixrajput
77
body:
@@ -47,7 +47,7 @@ body:
4747
id: terms
4848
attributes:
4949
label: Code of Conduct
50-
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/nixrajput/flutter_carousel_widget/CODE_OF_CONDUCT.md).
50+
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/nixrajput/flutter_carousel_widget/blob/master/CODE_OF_CONDUCT.md).
5151
options:
5252
- label: I agree to follow this project's Code of Conduct
5353
required: true

.github/workflows/test.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Run Test Cases
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
checkout:
11+
name: Checkout Repository
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v4
16+
17+
setup-flutter:
18+
name: Setup Flutter
19+
runs-on: ubuntu-latest
20+
needs: checkout
21+
steps:
22+
- name: Install Flutter SDK
23+
uses: subosito/flutter-action@v2
24+
with:
25+
channel: stable
26+
flutter-version: 3.24.x
27+
28+
- name: Run Flutter doctor
29+
run: flutter doctor -v
30+
31+
lint:
32+
name: Lint Code
33+
runs-on: ubuntu-latest
34+
needs: setup-flutter
35+
steps:
36+
- name: Checkout Code
37+
uses: actions/checkout@v3
38+
39+
- name: Run Flutter Analyzer (Lint)
40+
run: flutter analyze
41+
42+
test:
43+
name: Test Code
44+
runs-on: ubuntu-latest
45+
needs: lint
46+
steps:
47+
- name: Checkout Code
48+
uses: actions/checkout@v3
49+
50+
- name: Run Flutter Tests
51+
run: flutter test

.github/workflows/web.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/web.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Publish to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
checkout:
9+
name: Checkout Repository
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Code
13+
uses: actions/checkout@v4
14+
15+
setup-flutter:
16+
name: Setup Flutter
17+
runs-on: ubuntu-latest
18+
needs: checkout
19+
steps:
20+
- name: Install Flutter SDK
21+
uses: subosito/flutter-action@v2
22+
with:
23+
channel: stable
24+
flutter-version: 3.24.x
25+
26+
- name: Check Flutter Version
27+
run: flutter --version
28+
29+
- name: Get Flutter Dependencies
30+
run: flutter pub get
31+
32+
lint:
33+
name: Lint Code
34+
runs-on: ubuntu-latest
35+
needs: setup-flutter
36+
steps:
37+
- name: Checkout Code
38+
uses: actions/checkout@v3
39+
40+
- name: Run Flutter Analyzer (Lint)
41+
run: flutter analyze
42+
43+
deploy:
44+
name: Deploy to GitHub Pages
45+
runs-on: ubuntu-latest
46+
needs: lint
47+
steps:
48+
- name: Checkout Code
49+
uses: actions/checkout@v4
50+
51+
- name: Deploy to GitHub Pages
52+
uses: bluefireteam/flutter-gh-pages@v8
53+
with:
54+
workingDir: example
55+
baseHref: /flutter_carousel_widget/

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ A customizable carousel slider widget for Flutter, offering features such as inf
4949
- **Pre-built Indicators:** Easily add indicators to show the current slide position.
5050
- **Expandable Carousel Widget:** Expand the carousel widget to fit the available space.
5151
- **Auto-sized Child Support:** Automatically adjust the size of the carousel items to fit their content.
52+
- **Enlarge Center Page:** The focused item can be enlarged.
5253

5354
## Demo
5455

example/lib/main.dart

Lines changed: 119 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,13 @@ class EnlargeStrategyDemo extends StatelessWidget {
215215
child: FlutterCarousel(
216216
options: CarouselOptions(
217217
autoPlay: true,
218-
autoPlayInterval: const Duration(seconds: 10),
218+
enableInfiniteScroll: true,
219+
autoPlayInterval: const Duration(seconds: 3),
219220
viewportFraction: 0.8,
220221
enlargeCenterPage: true,
221222
slideIndicator: CircularWaveSlideIndicator(),
222223
floatingIndicator: false,
224+
scrollDirection: Axis.vertical,
223225
),
224226
items: sliders,
225227
),
@@ -619,6 +621,114 @@ class MultipleItemDemo extends StatelessWidget {
619621
}
620622
}
621623

624+
final expandableItems = [
625+
Padding(
626+
padding: const EdgeInsets.symmetric(horizontal: 4.0),
627+
child: ClipRRect(
628+
borderRadius: const BorderRadius.all(Radius.circular(4.0)),
629+
child: Container(
630+
color: Colors.blue,
631+
width: double.infinity,
632+
height: 200,
633+
child: const Center(
634+
child: Text(
635+
"Slide 1",
636+
style: TextStyle(
637+
color: Colors.white,
638+
fontSize: 24.0,
639+
fontWeight: FontWeight.bold,
640+
),
641+
),
642+
),
643+
),
644+
),
645+
),
646+
Padding(
647+
padding: const EdgeInsets.symmetric(horizontal: 4.0),
648+
child: ClipRRect(
649+
borderRadius: const BorderRadius.all(Radius.circular(4.0)),
650+
child: Container(
651+
color: Colors.red,
652+
width: double.infinity,
653+
height: 300,
654+
child: const Center(
655+
child: Text(
656+
"Slide 2",
657+
style: TextStyle(
658+
color: Colors.white,
659+
fontSize: 24.0,
660+
fontWeight: FontWeight.bold,
661+
),
662+
),
663+
),
664+
),
665+
),
666+
),
667+
Padding(
668+
padding: const EdgeInsets.symmetric(horizontal: 4.0),
669+
child: ClipRRect(
670+
borderRadius: const BorderRadius.all(Radius.circular(4.0)),
671+
child: Container(
672+
color: Colors.yellow,
673+
width: double.infinity,
674+
height: 250,
675+
child: const Center(
676+
child: Text(
677+
"Slide 3",
678+
style: TextStyle(
679+
color: Colors.white,
680+
fontSize: 24.0,
681+
fontWeight: FontWeight.bold,
682+
),
683+
),
684+
),
685+
),
686+
),
687+
),
688+
Padding(
689+
padding: const EdgeInsets.symmetric(horizontal: 4.0),
690+
child: ClipRRect(
691+
borderRadius: const BorderRadius.all(Radius.circular(4.0)),
692+
child: Container(
693+
color: Colors.pink,
694+
width: double.infinity,
695+
height: 400,
696+
child: const Center(
697+
child: Text(
698+
"Slide 4",
699+
style: TextStyle(
700+
color: Colors.white,
701+
fontSize: 24.0,
702+
fontWeight: FontWeight.bold,
703+
),
704+
),
705+
),
706+
),
707+
),
708+
),
709+
Padding(
710+
padding: const EdgeInsets.symmetric(horizontal: 4.0),
711+
child: ClipRRect(
712+
borderRadius: const BorderRadius.all(Radius.circular(4.0)),
713+
child: Container(
714+
color: Colors.green,
715+
width: double.infinity,
716+
height: 350,
717+
child: const Center(
718+
child: Text(
719+
"Slide 5",
720+
style: TextStyle(
721+
color: Colors.white,
722+
fontSize: 24.0,
723+
fontWeight: FontWeight.bold,
724+
),
725+
),
726+
),
727+
),
728+
),
729+
)
730+
];
731+
622732
class ExpandableCarouselDemo extends StatefulWidget {
623733
const ExpandableCarouselDemo({Key? key}) : super(key: key);
624734

@@ -640,48 +750,23 @@ class _ExpandableCarouselDemoState extends State<ExpandableCarouselDemo> {
640750
crossAxisAlignment: CrossAxisAlignment.center,
641751
mainAxisSize: MainAxisSize.min,
642752
children: [
643-
ExpandableCarousel(
753+
ExpandableCarousel.builder(
644754
options: ExpandableCarouselOptions(
645755
// viewportFraction: 1.0,
646756
enableInfiniteScroll: true,
647-
initialPage: 2,
757+
enlargeCenterPage: true,
758+
initialPage: 1,
648759
autoPlay: true,
649760
controller: _controller,
761+
//showIndicator: false,
650762
floatingIndicator: false,
651763
restorationId: 'expandable_carousel',
652764
),
653-
items: sliders,
765+
itemCount: expandableItems.length,
766+
itemBuilder: (context, index, realIdx) {
767+
return expandableItems[index];
768+
},
654769
),
655-
const SizedBox(height: 16.0),
656-
Padding(
657-
padding: const EdgeInsets.symmetric(
658-
horizontal: 16.0,
659-
vertical: 16.0,
660-
),
661-
child: Row(
662-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
663-
children: [
664-
Flexible(
665-
child: ElevatedButton(
666-
onPressed: _controller.previousPage,
667-
child: const Padding(
668-
padding: EdgeInsets.all(8.0),
669-
child: Icon(Icons.arrow_back),
670-
),
671-
),
672-
),
673-
Flexible(
674-
child: ElevatedButton(
675-
onPressed: _controller.nextPage,
676-
child: const Padding(
677-
padding: EdgeInsets.all(8.0),
678-
child: Icon(Icons.arrow_forward),
679-
),
680-
),
681-
),
682-
],
683-
),
684-
)
685770
],
686771
),
687772
),

lib/flutter_carousel_widget.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export 'package:flutter_carousel_widget/src/helpers/flutter_carousel_state.dart'
88
export 'package:flutter_carousel_widget/src/helpers/flutter_expandable_carousel_controller.dart';
99
export 'package:flutter_carousel_widget/src/helpers/flutter_expandable_carousel_options.dart';
1010
export 'package:flutter_carousel_widget/src/helpers/flutter_expandable_carousel_state.dart';
11-
export 'package:flutter_carousel_widget/src/helpers/slide_indicator_options_model.dart';
1211
export 'package:flutter_carousel_widget/src/indicators/circular_slide_indicator.dart';
1312
export 'package:flutter_carousel_widget/src/indicators/circular_static_indicator.dart';
1413
export 'package:flutter_carousel_widget/src/indicators/circular_wave_slide_indicator.dart';
1514
export 'package:flutter_carousel_widget/src/indicators/sequential_fill_indicator.dart';
1615
export 'package:flutter_carousel_widget/src/indicators/slide_indicator.dart';
16+
export 'package:flutter_carousel_widget/src/indicators/slide_indicator_options.dart';

0 commit comments

Comments
 (0)