Skip to content

Commit 0b1bdd1

Browse files
committed
updated to version 2.0.0
1 parent 1692ef9 commit 0b1bdd1

File tree

3 files changed

+60
-370
lines changed

3 files changed

+60
-370
lines changed

CHANGELOG.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
# Changelog
22

3+
## 2.0.0
4+
5+
* **New Feature**: `ExpandableCarousel` widget added.
6+
* **Breaking Change**: `scrollPhysics` is now `physics` in `CarouselOptions`.
7+
* **Breaking Change**: `carouselController` is now `controller` in `CarouselOptions`.
8+
* **Breaking Change**: Project architecture changed.
9+
* **Fix**: All known bug fixed and removed.
10+
* **Improvement**: Performance improvements.
11+
* **Optimization**: Removed unnecessary codes.
12+
313
## 1.2.3
414

5-
* Fix: bug auto play carousel is not working.
15+
* **Fix**: bug auto play carousel is not working.
616
* All known bug fixed and removed.
717
* Performance improvements.
818
* Removed unnecessary codes.
919

1020
## 1.2.2
1121

12-
* Fix: `issue #7` bug show indicator when no custom `CarouselController` is set and `showIndicator` is set to `true` and `onPageChanged` is called.
22+
* **Fix**: `issue #7` bug show indicator when no custom `CarouselController` is set and `showIndicator` is set to `true` and `onPageChanged` is called.
1323
* Custom `CarouselController` can be set via `CarouselOptions` property.
1424
* All known bugs are fixed.
1525
* Performance improvements.

README.md

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ A customizable carousel slider widget in Flutter which supports infinite scrolli
1616
* Pre-built Carousel Indicators
1717
* Custom Indicators
1818

19+
## New Features
20+
21+
* Expandable Carousel Widget.
22+
* Auto-sized child support.
23+
1924
## Demo
2025

2126
[View Demo](https://nixrajput.github.io/flutter_carousel_widget)
@@ -26,7 +31,7 @@ Add `flutter_carousel_widget` as a dependency in your `pubspec.yaml` file:
2631

2732
```dart
2833
dependencies:
29-
flutter_carousel_widget: ^1.2.3
34+
flutter_carousel_widget: ^2.0.0
3035
```
3136

3237
And import it:
@@ -37,7 +42,9 @@ import 'package:flutter_carousel_widget/flutter_carousel_widget.dart';
3742

3843
## Usage
3944

40-
Simply create a `FlutterCarousel` widget, and pass the required params:
45+
### Using `FlutterCarousel` Widget
46+
47+
Flutter Carousel is a carousel widget which supports infinite scrolling, auto scrolling, custom child widget, custom animations and pre-built indicators.
4148

4249
```dart
4350
FlutterCarousel(
@@ -63,6 +70,33 @@ FlutterCarousel(
6370
)
6471
```
6572

73+
### Using `ExpandableCarousel` Widget
74+
75+
Expandable Carousel is a carousel widget which automatically expands to the size of its child widget. It is useful when you want to show a carousel with different sized child widgets.
76+
77+
```dart
78+
ExpandableCarousel(
79+
options: CarouselOptions(
80+
autoPlay: false,
81+
autoPlayInterval: const Duration(seconds: 2),
82+
),
83+
items: [1,2,3,4,5].map((i) {
84+
return Builder(
85+
builder: (BuildContext context) {
86+
return Container(
87+
width: MediaQuery.of(context).size.width,
88+
margin: EdgeInsets.symmetric(horizontal: 5.0),
89+
decoration: BoxDecoration(
90+
color: Colors.amber
91+
),
92+
child: Text('text $i', style: TextStyle(fontSize: 16.0),)
93+
);
94+
},
95+
);
96+
}).toList(),
97+
)
98+
```
99+
66100
### Option Customization
67101

68102
```dart
@@ -112,7 +146,17 @@ FlutterCarousel.builder(
112146
)
113147
```
114148

115-
## Carousel controller
149+
```dart
150+
ExpandableCarousel.builder(
151+
itemCount: 15,
152+
itemBuilder: (BuildContext context, int itemIndex, int pageViewIndex) =>
153+
Container(
154+
child: Text(itemIndex.toString()),
155+
),
156+
)
157+
```
158+
159+
## Carousel Controller
116160

117161
In order to manually control the pageview's position, you can create your own `CarouselController`,
118162
and pass it to `CarouselSlider`. Then you can use the `CarouselController` instance to manipulate
@@ -124,7 +168,7 @@ class CarouselDemo extends StatelessWidget {
124168
125169
@override
126170
Widget build(BuildContext context) => Column(
127-
children: <Widget>[
171+
children: [
128172
FlutterCarousel(
129173
items: child,
130174
options: CarouselOptions(

0 commit comments

Comments
 (0)