Skip to content

Commit 0c57b7f

Browse files
committed
bumped to version 2.0.2
1 parent 84be132 commit 0c57b7f

17 files changed

+538
-517
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 2.0.2
4+
5+
* **Add**: `indicatorMargin` property added to `CarouselOptions`.
6+
* **Improvement**: Removed unnecessary dependencies.
7+
* **Fix**: All known bug fixed and removed.
8+
* **Improvement**: Performance improvements.
9+
* **Optimization**: Removed unnecessary codes.
10+
311
## 2.0.1
412

513
* **Documentation**: Updated the documentation to reflect the new Github Pages deployment

example/lib/app_themes.dart

Lines changed: 48 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ import 'colors.dart';
55
class AppThemes {
66
AppThemes._();
77

8-
static final lightTheme = ThemeData.light().copyWith(
9-
scaffoldBackgroundColor: lightBGColor,
8+
static final darkTheme = ThemeData.dark().copyWith(
9+
scaffoldBackgroundColor: darkBGColor,
1010
visualDensity: VisualDensity.adaptivePlatformDensity,
1111
bottomSheetTheme: const BottomSheetThemeData(
12-
backgroundColor: lightColor,
13-
modalBackgroundColor: lightColor,
12+
backgroundColor: darkColor2,
13+
modalBackgroundColor: darkColor2,
1414
),
15-
dialogBackgroundColor: lightBGColor,
15+
dialogBackgroundColor: darkColor2,
1616
popupMenuTheme: const PopupMenuThemeData(
17-
color: lightColor,
17+
color: darkColor2,
1818
),
1919
elevatedButtonTheme: ElevatedButtonThemeData(
2020
style: ButtonStyle(
@@ -23,51 +23,50 @@ class AppThemes {
2323
),
2424
textButtonTheme: TextButtonThemeData(
2525
style: ButtonStyle(
26-
foregroundColor: MaterialStateProperty.all(darkColor),
26+
foregroundColor: MaterialStateProperty.all(lightColor),
2727
),
2828
),
2929
appBarTheme: const AppBarTheme(
30-
backgroundColor: lightBGColor,
31-
elevation: 0.0,
30+
backgroundColor: darkColor2,
31+
elevation: 2.0,
3232
titleTextStyle: TextStyle(
33-
color: darkColor,
33+
color: lightColor,
3434
fontSize: 20.0,
3535
fontWeight: FontWeight.bold,
3636
),
3737
iconTheme: IconThemeData(
38-
color: darkColor,
38+
color: lightColor,
3939
),
4040
),
4141
iconTheme: const IconThemeData(
42-
color: darkColor,
42+
color: lightColor,
4343
),
4444
textTheme: const TextTheme(
45-
bodyText1: TextStyle(color: darkColor),
46-
bodyText2: TextStyle(color: darkColor),
47-
subtitle1: TextStyle(color: darkColor),
48-
subtitle2: TextStyle(color: darkColor),
49-
caption: TextStyle(color: darkColor),
50-
headline1: TextStyle(color: darkColor),
51-
headline2: TextStyle(color: darkColor),
52-
headline3: TextStyle(color: darkColor),
53-
headline4: TextStyle(color: darkColor),
54-
headline5: TextStyle(color: darkColor),
55-
headline6: TextStyle(color: darkColor),
56-
button: TextStyle(color: darkColor),
57-
overline: TextStyle(color: darkColor),
45+
bodyLarge: TextStyle(color: lightColor),
46+
bodyMedium: TextStyle(color: lightColor),
47+
bodySmall: TextStyle(color: lightColor),
48+
titleLarge: TextStyle(color: lightColor),
49+
titleMedium: TextStyle(color: lightColor),
50+
titleSmall: TextStyle(color: lightColor),
51+
displayLarge: TextStyle(color: lightColor),
52+
displayMedium: TextStyle(color: lightColor),
53+
displaySmall: TextStyle(color: lightColor),
54+
labelLarge: TextStyle(color: lightColor),
55+
labelMedium: TextStyle(color: lightColor),
56+
labelSmall: TextStyle(color: lightColor),
5857
),
5958
);
6059

61-
static final darkTheme = ThemeData.dark().copyWith(
62-
scaffoldBackgroundColor: darkBGColor,
60+
static final lightTheme = ThemeData.light().copyWith(
61+
scaffoldBackgroundColor: lightBGColor,
6362
visualDensity: VisualDensity.adaptivePlatformDensity,
6463
bottomSheetTheme: const BottomSheetThemeData(
65-
backgroundColor: darkColor2,
66-
modalBackgroundColor: darkColor2,
64+
backgroundColor: lightColor,
65+
modalBackgroundColor: lightColor,
6766
),
68-
dialogBackgroundColor: darkColor2,
67+
dialogBackgroundColor: lightBGColor,
6968
popupMenuTheme: const PopupMenuThemeData(
70-
color: darkColor2,
69+
color: lightColor,
7170
),
7271
elevatedButtonTheme: ElevatedButtonThemeData(
7372
style: ButtonStyle(
@@ -76,38 +75,37 @@ class AppThemes {
7675
),
7776
textButtonTheme: TextButtonThemeData(
7877
style: ButtonStyle(
79-
foregroundColor: MaterialStateProperty.all(lightColor),
78+
foregroundColor: MaterialStateProperty.all(darkColor),
8079
),
8180
),
8281
appBarTheme: const AppBarTheme(
83-
backgroundColor: darkBGColor,
84-
elevation: 0.0,
82+
backgroundColor: lightColor,
83+
elevation: 2.0,
8584
titleTextStyle: TextStyle(
86-
color: lightColor,
85+
color: darkColor,
8786
fontSize: 20.0,
8887
fontWeight: FontWeight.bold,
8988
),
9089
iconTheme: IconThemeData(
91-
color: lightColor,
90+
color: darkColor,
9291
),
9392
),
9493
iconTheme: const IconThemeData(
95-
color: lightColor,
94+
color: darkColor,
9695
),
9796
textTheme: const TextTheme(
98-
bodyText1: TextStyle(color: lightColor),
99-
bodyText2: TextStyle(color: lightColor),
100-
subtitle1: TextStyle(color: lightColor),
101-
subtitle2: TextStyle(color: lightColor),
102-
caption: TextStyle(color: lightColor),
103-
headline1: TextStyle(color: lightColor),
104-
headline2: TextStyle(color: lightColor),
105-
headline3: TextStyle(color: lightColor),
106-
headline4: TextStyle(color: lightColor),
107-
headline5: TextStyle(color: lightColor),
108-
headline6: TextStyle(color: lightColor),
109-
button: TextStyle(color: lightColor),
110-
overline: TextStyle(color: lightColor),
97+
bodyLarge: TextStyle(color: darkColor),
98+
bodyMedium: TextStyle(color: darkColor),
99+
bodySmall: TextStyle(color: darkColor),
100+
titleLarge: TextStyle(color: darkColor),
101+
titleMedium: TextStyle(color: darkColor),
102+
titleSmall: TextStyle(color: darkColor),
103+
displayLarge: TextStyle(color: darkColor),
104+
displayMedium: TextStyle(color: darkColor),
105+
displaySmall: TextStyle(color: darkColor),
106+
labelLarge: TextStyle(color: darkColor),
107+
labelMedium: TextStyle(color: darkColor),
108+
labelSmall: TextStyle(color: darkColor),
111109
),
112110
);
113111
}

example/lib/colors.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import 'dart:ui';
22

3-
const Color lightColor = Color.fromRGBO(250, 250, 250, 1);
4-
const Color lightBGColor = Color.fromRGBO(220, 220, 220, 1);
5-
const Color darkBGColor = Color.fromRGBO(20, 20, 30, 1);
6-
const Color darkColor = Color.fromRGBO(10, 10, 40, 1.0);
7-
const Color darkColor2 = Color.fromRGBO(21, 21, 36, 1.0);
8-
Color lightShadowColor = const Color(0x1A505050);
9-
Color darkShadowColor = const Color(0x0ddcdcdc);
3+
const Color lightColor = Color.fromARGB(255, 252, 252, 252);
4+
const Color lightBGColor = Color.fromARGB(255, 240, 240, 240);
5+
const Color darkBGColor = Color.fromARGB(255, 20, 20, 30);
6+
const Color darkColor = Color.fromARGB(255, 10, 10, 40);
7+
const Color darkColor2 = Color.fromARGB(255, 21, 21, 36);
8+
Color lightShadowColor = const Color.fromARGB(26, 80, 80, 80);
9+
Color darkShadowColor = const Color.fromARGB(13, 220, 220, 220);

example/lib/main.dart

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import 'package:flutter_carousel_widget/flutter_carousel_widget.dart';
44
import 'app_themes.dart';
55

66
class Slide {
7-
final String title;
8-
final double height;
9-
final Color color;
10-
117
Slide({
128
required this.title,
139
required this.height,
1410
required this.color,
1511
});
12+
13+
final Color color;
14+
final double height;
15+
final String title;
1616
}
1717

1818
var slides = List.generate(
@@ -35,7 +35,14 @@ final List<Widget> sliders = slides
3535
width: double.infinity,
3636
height: item.height,
3737
child: Center(
38-
child: Text(item.title),
38+
child: Text(
39+
item.title,
40+
style: const TextStyle(
41+
color: Colors.white,
42+
fontSize: 24.0,
43+
fontWeight: FontWeight.bold,
44+
),
45+
),
3946
),
4047
),
4148
),
@@ -71,11 +78,11 @@ class FlutterCarouselWidgetDemo extends StatelessWidget {
7178
}
7279

7380
class DemoItem extends StatelessWidget {
74-
final String title;
75-
final String route;
76-
7781
const DemoItem(this.title, this.route, {Key? key}) : super(key: key);
7882

83+
final String route;
84+
final String title;
85+
7986
@override
8087
Widget build(BuildContext context) {
8188
return InkWell(
@@ -156,17 +163,25 @@ class ComplicatedImageDemo extends StatelessWidget {
156163

157164
@override
158165
Widget build(BuildContext context) {
166+
final deviceSize = MediaQuery.of(context).size;
159167
return Scaffold(
160168
appBar: AppBar(title: const Text('Image Slider Demo')),
161-
body: Center(
169+
body: Padding(
170+
padding: const EdgeInsets.all(8.0),
162171
child: Container(
163172
constraints: BoxConstraints(
164173
maxHeight: MediaQuery.of(context).size.width,
165174
),
166175
child: FlutterCarousel(
167176
options: CarouselOptions(
168-
autoPlay: true,
177+
autoPlay: false,
169178
autoPlayInterval: const Duration(seconds: 5),
179+
disableCenter: true,
180+
viewportFraction: 0.8,
181+
height: deviceSize.height * 0.45,
182+
indicatorMargin: 12.0,
183+
enableInfiniteScroll: false,
184+
slideIndicator: const CircularSlideIndicator(),
170185
),
171186
items: sliders,
172187
),
@@ -216,8 +231,11 @@ class _ManuallyControlledSliderState extends State<ManuallyControlledSlider> {
216231
Widget build(BuildContext context) {
217232
return Scaffold(
218233
appBar: AppBar(title: const Text('Manually Controlled Slider')),
219-
body: Center(
234+
body: Padding(
235+
padding: const EdgeInsets.all(8.0),
220236
child: Column(
237+
mainAxisAlignment: MainAxisAlignment.start,
238+
crossAxisAlignment: CrossAxisAlignment.start,
221239
mainAxisSize: MainAxisSize.min,
222240
children: [
223241
Expanded(

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Demonstrates how to use the flutter_carousel_widget package.
33

44
publish_to: "none"
55

6-
version: 1.0.0+1
6+
version: 1.0.0
77

88
environment:
99
sdk: ">=2.16.0 <3.0.0"

0 commit comments

Comments
 (0)