Skip to content

Commit

Permalink
bumped to version 2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nixrajput committed Jul 23, 2024
2 parents 380b8cf + 12c068a commit e13b01f
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 181 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog


## 2.3.0

* **Breaking Change**: New `ExpandableCarouselOptions` introduced for `ExpandableCarousel`.
* **Breaking Change**: New `ExpandableCarouselController` introduced for `ExpandableCarousel`.
* **Breaking Change**: New `ExpandableCarouselState` introduced for `ExpandableCarousel`.
* **Breaking Change**: All slide indicator properties have been consolidated into the `SlideIndicatorOptions` class.
* **Enhancement**: `issue #44` Added optional halo effect for slide indicators, customizable via `SlideIndicatorOptions` properties (`enableHalo`, `haloPadding`, `haloDecoration`).
* **Chore**: Removed dead code.
* **Fix**: `issue #46` fixed.
* **Fix**: `issue #44` fixed.
* **Fix**: `issue #40` fixed.

## 2.2.0

* **New Feature**: Support for custom slide indicators added.
Expand Down
1 change: 1 addition & 0 deletions lib/flutter_carousel_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ export 'package:flutter_carousel_widget/src/helpers/flutter_expandable_carousel_
export 'package:flutter_carousel_widget/src/indicators/circular_slide_indicator.dart';
export 'package:flutter_carousel_widget/src/indicators/circular_static_indicator.dart';
export 'package:flutter_carousel_widget/src/indicators/circular_wave_slide_indicator.dart';
export 'package:flutter_carousel_widget/src/indicators/models/slide_indicator_options_model.dart';
export 'package:flutter_carousel_widget/src/indicators/sequential_fill_indicator.dart';
export 'package:flutter_carousel_widget/src/indicators/slide_indicator.dart';
74 changes: 30 additions & 44 deletions lib/src/indicators/circular_slide_indicator.dart
Original file line number Diff line number Diff line change
@@ -1,56 +1,42 @@
import 'package:flutter/material.dart' hide CarouselController;
import 'package:flutter/material.dart';
import 'package:flutter_carousel_widget/src/indicators/models/slide_indicator_options_model.dart';

import 'slide_indicator.dart';

class CircularSlideIndicator implements SlideIndicator {
const CircularSlideIndicator({
this.itemSpacing = 20,
this.indicatorRadius = 6,
this.indicatorBorderWidth = 1,
this.indicatorBorderColor,
this.padding,
this.alignment = Alignment.bottomCenter,
this.currentIndicatorColor,
this.indicatorBackgroundColor,
});
const CircularSlideIndicator(
{this.slideIndicatorOptions = const SlideIndicatorOptions()});

final AlignmentGeometry alignment;
final Color? currentIndicatorColor;
final Color? indicatorBackgroundColor;
final Color? indicatorBorderColor;
final double indicatorBorderWidth;
final double indicatorRadius;
final double itemSpacing;
final EdgeInsets? padding;
final SlideIndicatorOptions slideIndicatorOptions;

@override
Widget build(int currentPage, double pageDelta, int itemCount) {
var activeColor = const Color(0xFFFFFFFF);
var backgroundColor = const Color(0x66FFFFFF);

// if (SchedulerBinding.instance.window.platformBrightness ==
// Brightness.light) {
// activeColor = const Color(0xFF000000);
// backgroundColor = const Color.fromARGB(255, 163, 159, 159);
// }

return Container(
alignment: alignment,
padding: padding,
child: SizedBox(
width: itemCount * itemSpacing,
height: indicatorRadius * 2,
child: CustomPaint(
painter: CircularIndicatorPainter(
currentIndicatorColor: currentIndicatorColor ?? activeColor,
indicatorBackgroundColor:
indicatorBackgroundColor ?? backgroundColor,
currentPage: currentPage,
pageDelta: pageDelta,
itemCount: itemCount,
radius: indicatorRadius,
indicatorBorderColor: indicatorBorderColor,
borderWidth: indicatorBorderWidth,
alignment: slideIndicatorOptions.alignment,
padding: slideIndicatorOptions.padding,
child: Container(
decoration: slideIndicatorOptions.enableHalo
? slideIndicatorOptions.haloDecoration
: null,
padding: slideIndicatorOptions.enableHalo
? slideIndicatorOptions.haloPadding
: null,
child: SizedBox(
width: itemCount * slideIndicatorOptions.itemSpacing,
height: slideIndicatorOptions.indicatorRadius * 2,
child: CustomPaint(
painter: CircularIndicatorPainter(
currentIndicatorColor:
slideIndicatorOptions.currentIndicatorColor,
indicatorBackgroundColor:
slideIndicatorOptions.indicatorBackgroundColor,
currentPage: currentPage,
pageDelta: pageDelta,
itemCount: itemCount,
radius: slideIndicatorOptions.indicatorRadius,
indicatorBorderColor: slideIndicatorOptions.indicatorBorderColor,
borderWidth: slideIndicatorOptions.indicatorBorderWidth,
),
),
),
),
Expand Down
75 changes: 29 additions & 46 deletions lib/src/indicators/circular_static_indicator.dart
Original file line number Diff line number Diff line change
@@ -1,59 +1,42 @@
import 'package:flutter/material.dart' hide CarouselController;

import 'slide_indicator.dart';
import 'package:flutter_carousel_widget/flutter_carousel_widget.dart';

class CircularStaticIndicator extends SlideIndicator {
CircularStaticIndicator({
this.itemSpacing = 20,
this.indicatorRadius = 6,
this.padding,
this.alignment = Alignment.bottomCenter,
this.currentIndicatorColor,
this.indicatorBackgroundColor,
this.enableAnimation = false,
this.indicatorBorderWidth = 1,
this.indicatorBorderColor,
this.slideIndicatorOptions = const SlideIndicatorOptions(),
});

final AlignmentGeometry alignment;
final Color? currentIndicatorColor;
final bool enableAnimation;
final Color? indicatorBackgroundColor;
final Color? indicatorBorderColor;
final double indicatorBorderWidth;
final double indicatorRadius;
final double itemSpacing;
final EdgeInsets? padding;
final SlideIndicatorOptions slideIndicatorOptions;

@override
Widget build(int currentPage, double pageDelta, int itemCount) {
var activeColor = const Color(0xFFFFFFFF);
var backgroundColor = const Color(0x66FFFFFF);

// if (SchedulerBinding.instance.window.platformBrightness ==
// Brightness.light) {
// activeColor = const Color(0xFF000000);
// backgroundColor = const Color(0xFF878484);
// }

return Container(
alignment: alignment,
padding: padding,
child: SizedBox(
width: itemCount * itemSpacing,
height: indicatorRadius * 2,
child: CustomPaint(
painter: CircularStaticIndicatorPainter(
currentIndicatorColor: currentIndicatorColor ?? activeColor,
indicatorBackgroundColor:
indicatorBackgroundColor ?? backgroundColor,
currentPage: currentPage,
pageDelta: pageDelta,
itemCount: itemCount,
radius: indicatorRadius,
enableAnimation: enableAnimation,
indicatorBorderColor: indicatorBorderColor,
borderWidth: indicatorBorderWidth,
alignment: slideIndicatorOptions.alignment,
padding: slideIndicatorOptions.padding,
child: Container(
decoration: slideIndicatorOptions.enableHalo
? slideIndicatorOptions.haloDecoration
: null,
padding: slideIndicatorOptions.enableHalo
? slideIndicatorOptions.haloPadding
: null,
child: SizedBox(
width: itemCount * slideIndicatorOptions.itemSpacing,
height: slideIndicatorOptions.indicatorRadius * 2,
child: CustomPaint(
painter: CircularStaticIndicatorPainter(
currentIndicatorColor:
slideIndicatorOptions.currentIndicatorColor,
indicatorBackgroundColor:
slideIndicatorOptions.indicatorBackgroundColor,
currentPage: currentPage,
pageDelta: pageDelta,
itemCount: itemCount,
radius: slideIndicatorOptions.indicatorRadius,
enableAnimation: slideIndicatorOptions.enableAnimation,
indicatorBorderColor: slideIndicatorOptions.indicatorBorderColor,
borderWidth: slideIndicatorOptions.indicatorBorderWidth,
),
),
),
),
Expand Down
73 changes: 29 additions & 44 deletions lib/src/indicators/circular_wave_slide_indicator.dart
Original file line number Diff line number Diff line change
@@ -1,56 +1,41 @@
import 'package:flutter/material.dart' hide CarouselController;

import 'slide_indicator.dart';
import 'package:flutter/material.dart';
import 'package:flutter_carousel_widget/flutter_carousel_widget.dart';

class CircularWaveSlideIndicator implements SlideIndicator {
CircularWaveSlideIndicator({
this.itemSpacing = 20,
this.indicatorRadius = 6,
this.padding,
this.alignment = Alignment.bottomCenter,
this.currentIndicatorColor,
this.indicatorBackgroundColor,
this.indicatorBorderWidth = 1,
this.indicatorBorderColor,
this.slideIndicatorOptions = const SlideIndicatorOptions(),
});

final AlignmentGeometry alignment;
final Color? currentIndicatorColor;
final Color? indicatorBackgroundColor;
final Color? indicatorBorderColor;
final double indicatorBorderWidth;
final double indicatorRadius;
final double itemSpacing;
final EdgeInsets? padding;
final SlideIndicatorOptions slideIndicatorOptions;

@override
Widget build(int currentPage, double pageDelta, int itemCount) {
var activeColor = const Color(0xFFFFFFFF);
var backgroundColor = const Color(0x66FFFFFF);

// if (SchedulerBinding.instance.window.platformBrightness ==
// Brightness.light) {
// activeColor = const Color(0xFF000000);
// backgroundColor = const Color(0xFF878484);
// }

return Container(
alignment: alignment,
padding: padding,
child: SizedBox(
width: itemCount * itemSpacing,
height: indicatorRadius * 2,
child: CustomPaint(
painter: CircularWaveIndicatorPainter(
currentIndicatorColor: currentIndicatorColor ?? activeColor,
indicatorBackgroundColor:
indicatorBackgroundColor ?? backgroundColor,
currentPage: currentPage,
pageDelta: pageDelta,
itemCount: itemCount,
radius: indicatorRadius,
indicatorBorderColor: indicatorBorderColor,
borderWidth: indicatorBorderWidth,
alignment: slideIndicatorOptions.alignment,
padding: slideIndicatorOptions.padding,
child: Container(
decoration: slideIndicatorOptions.enableHalo
? slideIndicatorOptions.haloDecoration
: null,
padding: slideIndicatorOptions.enableHalo
? slideIndicatorOptions.haloPadding
: null,
child: SizedBox(
width: itemCount * slideIndicatorOptions.itemSpacing,
height: slideIndicatorOptions.indicatorRadius * 2,
child: CustomPaint(
painter: CircularWaveIndicatorPainter(
currentIndicatorColor:
slideIndicatorOptions.currentIndicatorColor,
indicatorBackgroundColor:
slideIndicatorOptions.indicatorBackgroundColor,
currentPage: currentPage,
pageDelta: pageDelta,
itemCount: itemCount,
radius: slideIndicatorOptions.indicatorRadius,
indicatorBorderColor: slideIndicatorOptions.indicatorBorderColor,
borderWidth: slideIndicatorOptions.indicatorBorderWidth,
),
),
),
),
Expand Down
Loading

0 comments on commit e13b01f

Please sign in to comment.