Skip to content

Commit

Permalink
bumped to version 2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
nixrajput committed Feb 1, 2023
1 parent 84be132 commit 0c57b7f
Show file tree
Hide file tree
Showing 17 changed files with 538 additions and 517 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 2.0.2

* **Add**: `indicatorMargin` property added to `CarouselOptions`.
* **Improvement**: Removed unnecessary dependencies.
* **Fix**: All known bug fixed and removed.
* **Improvement**: Performance improvements.
* **Optimization**: Removed unnecessary codes.

## 2.0.1

* **Documentation**: Updated the documentation to reflect the new Github Pages deployment
Expand Down
98 changes: 48 additions & 50 deletions example/lib/app_themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import 'colors.dart';
class AppThemes {
AppThemes._();

static final lightTheme = ThemeData.light().copyWith(
scaffoldBackgroundColor: lightBGColor,
static final darkTheme = ThemeData.dark().copyWith(
scaffoldBackgroundColor: darkBGColor,
visualDensity: VisualDensity.adaptivePlatformDensity,
bottomSheetTheme: const BottomSheetThemeData(
backgroundColor: lightColor,
modalBackgroundColor: lightColor,
backgroundColor: darkColor2,
modalBackgroundColor: darkColor2,
),
dialogBackgroundColor: lightBGColor,
dialogBackgroundColor: darkColor2,
popupMenuTheme: const PopupMenuThemeData(
color: lightColor,
color: darkColor2,
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
Expand All @@ -23,51 +23,50 @@ class AppThemes {
),
textButtonTheme: TextButtonThemeData(
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all(darkColor),
foregroundColor: MaterialStateProperty.all(lightColor),
),
),
appBarTheme: const AppBarTheme(
backgroundColor: lightBGColor,
elevation: 0.0,
backgroundColor: darkColor2,
elevation: 2.0,
titleTextStyle: TextStyle(
color: darkColor,
color: lightColor,
fontSize: 20.0,
fontWeight: FontWeight.bold,
),
iconTheme: IconThemeData(
color: darkColor,
color: lightColor,
),
),
iconTheme: const IconThemeData(
color: darkColor,
color: lightColor,
),
textTheme: const TextTheme(
bodyText1: TextStyle(color: darkColor),
bodyText2: TextStyle(color: darkColor),
subtitle1: TextStyle(color: darkColor),
subtitle2: TextStyle(color: darkColor),
caption: TextStyle(color: darkColor),
headline1: TextStyle(color: darkColor),
headline2: TextStyle(color: darkColor),
headline3: TextStyle(color: darkColor),
headline4: TextStyle(color: darkColor),
headline5: TextStyle(color: darkColor),
headline6: TextStyle(color: darkColor),
button: TextStyle(color: darkColor),
overline: TextStyle(color: darkColor),
bodyLarge: TextStyle(color: lightColor),
bodyMedium: TextStyle(color: lightColor),
bodySmall: TextStyle(color: lightColor),
titleLarge: TextStyle(color: lightColor),
titleMedium: TextStyle(color: lightColor),
titleSmall: TextStyle(color: lightColor),
displayLarge: TextStyle(color: lightColor),
displayMedium: TextStyle(color: lightColor),
displaySmall: TextStyle(color: lightColor),
labelLarge: TextStyle(color: lightColor),
labelMedium: TextStyle(color: lightColor),
labelSmall: TextStyle(color: lightColor),
),
);

static final darkTheme = ThemeData.dark().copyWith(
scaffoldBackgroundColor: darkBGColor,
static final lightTheme = ThemeData.light().copyWith(
scaffoldBackgroundColor: lightBGColor,
visualDensity: VisualDensity.adaptivePlatformDensity,
bottomSheetTheme: const BottomSheetThemeData(
backgroundColor: darkColor2,
modalBackgroundColor: darkColor2,
backgroundColor: lightColor,
modalBackgroundColor: lightColor,
),
dialogBackgroundColor: darkColor2,
dialogBackgroundColor: lightBGColor,
popupMenuTheme: const PopupMenuThemeData(
color: darkColor2,
color: lightColor,
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
Expand All @@ -76,38 +75,37 @@ class AppThemes {
),
textButtonTheme: TextButtonThemeData(
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all(lightColor),
foregroundColor: MaterialStateProperty.all(darkColor),
),
),
appBarTheme: const AppBarTheme(
backgroundColor: darkBGColor,
elevation: 0.0,
backgroundColor: lightColor,
elevation: 2.0,
titleTextStyle: TextStyle(
color: lightColor,
color: darkColor,
fontSize: 20.0,
fontWeight: FontWeight.bold,
),
iconTheme: IconThemeData(
color: lightColor,
color: darkColor,
),
),
iconTheme: const IconThemeData(
color: lightColor,
color: darkColor,
),
textTheme: const TextTheme(
bodyText1: TextStyle(color: lightColor),
bodyText2: TextStyle(color: lightColor),
subtitle1: TextStyle(color: lightColor),
subtitle2: TextStyle(color: lightColor),
caption: TextStyle(color: lightColor),
headline1: TextStyle(color: lightColor),
headline2: TextStyle(color: lightColor),
headline3: TextStyle(color: lightColor),
headline4: TextStyle(color: lightColor),
headline5: TextStyle(color: lightColor),
headline6: TextStyle(color: lightColor),
button: TextStyle(color: lightColor),
overline: TextStyle(color: lightColor),
bodyLarge: TextStyle(color: darkColor),
bodyMedium: TextStyle(color: darkColor),
bodySmall: TextStyle(color: darkColor),
titleLarge: TextStyle(color: darkColor),
titleMedium: TextStyle(color: darkColor),
titleSmall: TextStyle(color: darkColor),
displayLarge: TextStyle(color: darkColor),
displayMedium: TextStyle(color: darkColor),
displaySmall: TextStyle(color: darkColor),
labelLarge: TextStyle(color: darkColor),
labelMedium: TextStyle(color: darkColor),
labelSmall: TextStyle(color: darkColor),
),
);
}
14 changes: 7 additions & 7 deletions example/lib/colors.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'dart:ui';

const Color lightColor = Color.fromRGBO(250, 250, 250, 1);
const Color lightBGColor = Color.fromRGBO(220, 220, 220, 1);
const Color darkBGColor = Color.fromRGBO(20, 20, 30, 1);
const Color darkColor = Color.fromRGBO(10, 10, 40, 1.0);
const Color darkColor2 = Color.fromRGBO(21, 21, 36, 1.0);
Color lightShadowColor = const Color(0x1A505050);
Color darkShadowColor = const Color(0x0ddcdcdc);
const Color lightColor = Color.fromARGB(255, 252, 252, 252);
const Color lightBGColor = Color.fromARGB(255, 240, 240, 240);
const Color darkBGColor = Color.fromARGB(255, 20, 20, 30);
const Color darkColor = Color.fromARGB(255, 10, 10, 40);
const Color darkColor2 = Color.fromARGB(255, 21, 21, 36);
Color lightShadowColor = const Color.fromARGB(26, 80, 80, 80);
Color darkShadowColor = const Color.fromARGB(13, 220, 220, 220);
40 changes: 29 additions & 11 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import 'package:flutter_carousel_widget/flutter_carousel_widget.dart';
import 'app_themes.dart';

class Slide {
final String title;
final double height;
final Color color;

Slide({
required this.title,
required this.height,
required this.color,
});

final Color color;
final double height;
final String title;
}

var slides = List.generate(
Expand All @@ -35,7 +35,14 @@ final List<Widget> sliders = slides
width: double.infinity,
height: item.height,
child: Center(
child: Text(item.title),
child: Text(
item.title,
style: const TextStyle(
color: Colors.white,
fontSize: 24.0,
fontWeight: FontWeight.bold,
),
),
),
),
),
Expand Down Expand Up @@ -71,11 +78,11 @@ class FlutterCarouselWidgetDemo extends StatelessWidget {
}

class DemoItem extends StatelessWidget {
final String title;
final String route;

const DemoItem(this.title, this.route, {Key? key}) : super(key: key);

final String route;
final String title;

@override
Widget build(BuildContext context) {
return InkWell(
Expand Down Expand Up @@ -156,17 +163,25 @@ class ComplicatedImageDemo extends StatelessWidget {

@override
Widget build(BuildContext context) {
final deviceSize = MediaQuery.of(context).size;
return Scaffold(
appBar: AppBar(title: const Text('Image Slider Demo')),
body: Center(
body: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
constraints: BoxConstraints(
maxHeight: MediaQuery.of(context).size.width,
),
child: FlutterCarousel(
options: CarouselOptions(
autoPlay: true,
autoPlay: false,
autoPlayInterval: const Duration(seconds: 5),
disableCenter: true,
viewportFraction: 0.8,
height: deviceSize.height * 0.45,
indicatorMargin: 12.0,
enableInfiniteScroll: false,
slideIndicator: const CircularSlideIndicator(),
),
items: sliders,
),
Expand Down Expand Up @@ -216,8 +231,11 @@ class _ManuallyControlledSliderState extends State<ManuallyControlledSlider> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Manually Controlled Slider')),
body: Center(
body: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Demonstrates how to use the flutter_carousel_widget package.

publish_to: "none"

version: 1.0.0+1
version: 1.0.0

environment:
sdk: ">=2.16.0 <3.0.0"
Expand Down
Loading

0 comments on commit 0c57b7f

Please sign in to comment.