null seafty bug fixes

design_3.0_latest
muhammad.abbasi 1 year ago
parent f694252828
commit a9ef3a827c

@ -10,26 +10,26 @@ enum BorderType { normal, dotted }
class BaseStep extends StatelessWidget { class BaseStep extends StatelessWidget {
const BaseStep({ const BaseStep({
Key key, Key ?key,
@required this.step, required this.step,
@required this.isActive, required this.isActive,
@required this.isFinished, required this.isFinished,
@required this.isAlreadyReached, required this.isAlreadyReached,
@required this.radius, required this.radius,
@required this.isUnreached, required this.isUnreached,
@required this.activeStepBackgroundColor, required this.activeStepBackgroundColor,
@required this.unreachedBackgroundColor, required this.unreachedBackgroundColor,
@required this.activeStepBorderColor, required this.activeStepBorderColor,
@required this.unreachedBorderColor, required this.unreachedBorderColor,
@required this.activeTextColor, required this.activeTextColor,
@required this.activeIconColor, required this.activeIconColor,
@required this.unreachedTextColor, required this.unreachedTextColor,
@required this.unreachedIconColor, required this.unreachedIconColor,
@required this.padding, required this.padding,
@required this.stepRadius, required this.stepRadius,
@required this.showStepBorder, required this.showStepBorder,
@required this.lineLength, required this.lineLength,
@required this.enabled, required this.enabled,
}) : super(key: key); }) : super(key: key);
final StepModel step; final StepModel step;
final bool isActive; final bool isActive;
@ -122,20 +122,7 @@ class BaseStep extends StatelessWidget {
return SizedBox( return SizedBox(
width: (radius * 4.5) + width: (radius * 4.5) +
(padding ?? 0), (padding ?? 0),
child: step.customTitle ?? child: step.customTitle,
Text(
step.title ?? '',
maxLines: 3,
textAlign: TextAlign.center,
softWrap: false,
overflow: TextOverflow.visible,
style: Theme.of(context).textTheme.bodyMedium.copyWith(
color: _handleTitleColor(
context, isFinished, isActive, isAlreadyReached),
height: 1,
// fontSize: radius * 0.45,
),
),
); );
} }
@ -163,7 +150,7 @@ class StepModel {
final Icon icon; final Icon icon;
final Icon finishIcon; final Icon finishIcon;
final Icon activeIcon; final Icon activeIcon;
final Widget customStep; final Widget? customStep;
final String title; final String title;
final Widget customTitle; final Widget customTitle;
final String lineText; final String lineText;
@ -171,16 +158,16 @@ class StepModel {
final bool topTitle; final bool topTitle;
final bool enabled; final bool enabled;
const StepModel({ const StepModel({
this.icon, required this.icon,
this.finishIcon, required this.finishIcon,
this.activeIcon, required this.activeIcon,
this.title, required this.title,
this.lineText, required this.lineText,
this.customStep, this.customStep,
this.customTitle, required this.customTitle,
this.customLineWidget, required this.customLineWidget,
this.topTitle = false, this.topTitle = false,
this.enabled = true, this.enabled = true,
}) : assert(icon != null || customStep != null); });
} }

@ -8,8 +8,8 @@ class BaseStepDelegate extends MultiChildLayoutDelegate {
final bool topTitle; final bool topTitle;
BaseStepDelegate({ BaseStepDelegate({
@required this.stepRadius, required this.stepRadius,
@required this.direction, required this.direction,
this.topTitle = false, this.topTitle = false,
}); });

@ -6,7 +6,7 @@ class EasyLine extends StatelessWidget {
final Color color; final Color color;
final double thickness; final double thickness;
final double spacing; final double spacing;
final LineType lineType; final LineType? lineType;
final Axis axis; final Axis axis;
const EasyLine({ const EasyLine({
@ -43,20 +43,20 @@ enum LineType {
dashed, dashed,
} }
class LineStyle { class LineStyle {
final Color defaultLineColor; final Color ?defaultLineColor;
final Color unreachedLineColor; final Color ?unreachedLineColor;
final Color activeLineColor; final Color ?activeLineColor;
final Color finishedLineColor; final Color ?finishedLineColor;
final double lineLength; final double lineLength;
final double lineThickness; final double lineThickness;
final double lineWidth; final double lineWidth;
final double lineSpace; final double lineSpace;
final LineType lineType; final LineType lineType;
final LineType unreachedLineType; final LineType ?unreachedLineType;
final Color progressColor; final Color ?progressColor;
final double progress; final double ?progress;
const LineStyle({ const LineStyle({
Key key, Key ?key,
this.lineType = LineType.dotted, this.lineType = LineType.dotted,
this.defaultLineColor, this.defaultLineColor,
this.unreachedLineColor, this.unreachedLineColor,

@ -6,25 +6,25 @@ import 'components/base_step.dart';
import 'components/custom_line.dart'; import 'components/custom_line.dart';
class CustomStepper extends StatefulWidget { class CustomStepper extends StatefulWidget {
final List<StepModel> steps; final List<StepModel> steps;
final OnStepReached onStepReached; final OnStepReached ?onStepReached;
final Color unreachedStepBackgroundColor; final Color ?unreachedStepBackgroundColor;
final Color unreachedStepTextColor; final Color ?unreachedStepTextColor;
final Color unreachedStepIconColor; final Color ?unreachedStepIconColor;
final Color unreachedStepBorderColor; final Color ?unreachedStepBorderColor;
final BorderType unreachedStepBorderType; final BorderType ?unreachedStepBorderType;
final Color activeStepBackgroundColor; final Color activeStepBackgroundColor;
final Color activeStepTextColor; final Color? activeStepTextColor;
final Color activeStepIconColor; final Color activeStepIconColor;
final Color activeStepBorderColor; final Color activeStepBorderColor;
final BorderType activeStepBorderType; final BorderType ?activeStepBorderType;
final Color finishedStepBackgroundColor; final Color finishedStepBackgroundColor;
final Color finishedStepBorderColor; final Color ?finishedStepBorderColor;
final Color finishedStepTextColor; final Color ?finishedStepTextColor;
final Color finishedStepIconColor; final Color ?finishedStepIconColor;
final BorderType finishedStepBorderType; final BorderType ?finishedStepBorderType;
final double stepRadius; final double stepRadius;
final int activeStep; final int activeStep;
final int maxReachedStep; final int ?maxReachedStep;
final Set<int>? reachedSteps; final Set<int>? reachedSteps;
final AlignmentGeometry alignment; final AlignmentGeometry alignment;
final double internalPadding; final double internalPadding;
@ -34,11 +34,11 @@ class CustomStepper extends StatefulWidget {
final Duration stepAnimationDuration; final Duration stepAnimationDuration;
final double borderThickness; final double borderThickness;
final StepShape stepShape; final StepShape stepShape;
final double stepBorderRadius; final double ?stepBorderRadius;
final bool showStepBorder; final bool showStepBorder;
final bool showScrollbar; final bool showScrollbar;
final bool fitWidth; final bool fitWidth;
final LineStyle lineStyle; final LineStyle ?lineStyle;
const CustomStepper({ const CustomStepper({
Key? key, Key? key,
@ -85,9 +85,9 @@ class CustomStepper extends StatefulWidget {
class _CustomStepperState extends State<CustomStepper> { class _CustomStepperState extends State<CustomStepper> {
late ScrollController _scrollController; late ScrollController _scrollController;
int _selectedIndex; int ?_selectedIndex;
LineStyle lineStyle; LineStyle? lineStyle;
EdgeInsetsGeometry _padding; EdgeInsetsGeometry? _padding;
@override @override
void initState() { void initState() {
@ -97,14 +97,14 @@ class _CustomStepperState extends State<CustomStepper> {
_padding = const EdgeInsetsDirectional.all(10); _padding = const EdgeInsetsDirectional.all(10);
if (widget.steps.any((element) => element.topTitle)) { if (widget.steps.any((element) => element.topTitle)) {
_padding = _padding.add(const EdgeInsetsDirectional.only(top: 45)); _padding = _padding!.add(const EdgeInsetsDirectional.only(top: 45));
} }
if (widget.titlesAreLargerThanSteps) { if (widget.titlesAreLargerThanSteps) {
_padding = _padding.add(EdgeInsetsDirectional.symmetric( _padding = _padding!.add(EdgeInsetsDirectional.symmetric(
horizontal: lineStyle.lineLength / 2)); horizontal: lineStyle!.lineLength / 2));
} }
if (widget.padding != null) { if (widget.padding != null) {
_padding.add(widget.padding); _padding!.add(widget.padding);
} }
super.initState(); super.initState();
@ -126,21 +126,6 @@ class _CustomStepperState extends State<CustomStepper> {
super.dispose(); super.dispose();
} }
/// Controls the step scrolling.
void _afterLayout(_) {
for (int i = 0; i < widget.steps.length; i++) {
_scrollController.animateTo(
i *
((widget.stepRadius * 2) +
widget.internalPadding +
lineStyle.lineLength),
duration: widget.stepAnimationDuration,
curve: widget.stepAnimationCurve,
);
if (_selectedIndex == i) break;
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -184,26 +169,26 @@ class _CustomStepperState extends State<CustomStepper> {
radius: widget.stepRadius, radius: widget.stepRadius,
isActive: index == widget.activeStep, isActive: index == widget.activeStep,
isFinished: widget.reachedSteps != null isFinished: widget.reachedSteps != null
? index < widget.activeStep && widget.reachedSteps.contains(index) ? index < widget.activeStep && widget.reachedSteps!.contains(index)
: index < widget.activeStep, : index < widget.activeStep,
isUnreached: index > widget.activeStep, isUnreached: index > widget.activeStep,
isAlreadyReached: widget.reachedSteps != null isAlreadyReached: widget.reachedSteps != null
? widget.reachedSteps.contains(index) ? widget.reachedSteps!.contains(index)
: widget.maxReachedStep != null : widget.maxReachedStep != null
? index <= widget.maxReachedStep ? index <= widget.maxReachedStep!
: false, : false,
activeStepBackgroundColor: widget.activeStepBackgroundColor, activeStepBackgroundColor: widget.activeStepBackgroundColor,
activeStepBorderColor: widget.activeStepBorderColor, activeStepBorderColor: widget.activeStepBorderColor,
activeTextColor: widget.activeStepTextColor, activeTextColor: widget.activeStepTextColor??AppColor.neutral100,
activeIconColor: widget.activeStepIconColor, activeIconColor: widget.activeStepIconColor,
unreachedBackgroundColor: widget.unreachedStepBackgroundColor, unreachedBackgroundColor: widget.unreachedStepBackgroundColor??AppColor.white10,
unreachedBorderColor: widget.unreachedStepBorderColor, unreachedBorderColor: widget.unreachedStepBorderColor??AppColor.neutral100,
unreachedTextColor: widget.unreachedStepTextColor, unreachedTextColor: widget.unreachedStepTextColor??AppColor.neutral100,
unreachedIconColor: widget.unreachedStepIconColor, unreachedIconColor: widget.unreachedStepIconColor??AppColor.neutral100,
padding: max(widget.internalPadding, 0), padding: max(widget.internalPadding, 0),
stepRadius: widget.stepBorderRadius, stepRadius: widget.stepBorderRadius??10,
showStepBorder: widget.showStepBorder, showStepBorder: widget.showStepBorder,
lineLength: lineStyle.lineLength, lineLength: lineStyle!.lineLength,
enabled: widget.steps[index].enabled, enabled: widget.steps[index].enabled,
); );
} }
@ -224,20 +209,20 @@ class _CustomStepperState extends State<CustomStepper> {
// } // }
Color _getLineColor(int index) { Color _getLineColor(int index) {
Color preferredColor; Color ?preferredColor;
if (index == widget.activeStep) { if (index == widget.activeStep) {
//Active Step //Active Step
preferredColor = lineStyle.activeLineColor; preferredColor = lineStyle!.activeLineColor??AppColor.primary10;
} else if (index > widget.activeStep) { } else if (index > widget.activeStep) {
//Unreached Step //Unreached Step
preferredColor = lineStyle.unreachedLineColor; preferredColor = lineStyle!.unreachedLineColor??AppColor.primary10;
} else if (index < widget.activeStep) { } else if (index < widget.activeStep) {
//Finished Step //Finished Step
preferredColor = lineStyle.finishedLineColor; preferredColor = lineStyle!.finishedLineColor??AppColor.primary10;
} }
return preferredColor ?? return preferredColor ??
lineStyle.defaultLineColor ?? lineStyle!.defaultLineColor ??
Theme.of(context).colorScheme.primary; Theme.of(context).colorScheme.primary;
} }
@ -248,7 +233,7 @@ class _CustomStepperState extends State<CustomStepper> {
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: axis == Axis.horizontal top: axis == Axis.horizontal
? (widget.stepRadius - lineStyle.lineThickness) ? (widget.stepRadius - lineStyle!.lineThickness)
: 0, : 0,
), ),
child: _buildBaseLine(index, axis), child: _buildBaseLine(index, axis),
@ -257,7 +242,7 @@ class _CustomStepperState extends State<CustomStepper> {
widget.steps[index].lineText != null) ...[ widget.steps[index].lineText != null) ...[
const SizedBox(height: 5), const SizedBox(height: 5),
SizedBox( SizedBox(
width: lineStyle.lineLength, width: lineStyle!.lineLength,
child: widget.steps[index].customLineWidget ?? child: widget.steps[index].customLineWidget ??
Text( Text(
widget.steps[index].lineText, widget.steps[index].lineText,
@ -274,16 +259,16 @@ class _CustomStepperState extends State<CustomStepper> {
EasyLine _buildBaseLine(int index, Axis axis) { EasyLine _buildBaseLine(int index, Axis axis) {
return EasyLine( return EasyLine(
length: lineStyle.lineLength, length: lineStyle!.lineLength,
color: _getLineColor(index), color: _getLineColor(index),
thickness: lineStyle.lineThickness, thickness: lineStyle!.lineThickness,
spacing: lineStyle.lineSpace, spacing: lineStyle!.lineSpace,
width: lineStyle.lineWidth, width: lineStyle!.lineWidth,
axis: axis, axis: axis,
lineType: lineType:
index > widget.activeStep - 1 && lineStyle.unreachedLineType != null index > widget.activeStep - 1 && lineStyle!.unreachedLineType != null
? lineStyle.unreachedLineType ? lineStyle!.unreachedLineType
: lineStyle.lineType, : lineStyle!.lineType,
); );
} }
} }

@ -106,7 +106,7 @@ class DashBoardProvider extends ChangeNotifier {
isDetailLoading = false; isDetailLoading = false;
notifyListeners(); notifyListeners();
} else { } else {
requestDetailList!.data!.addAll(DD.Data.fromJson(json.decode(response.body)["data"][0]).data); requestDetailList!.data!.addAll(DD.DashboardDetail.fromJson(json.decode(response.body)['data']);
isDetailLoading = false; isDetailLoading = false;
notifyListeners(); notifyListeners();
} }

@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.2.2+9 version: 1.2.2+9
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=3.5.0 <4.0.0"
localization_dir: assets\translations localization_dir: assets\translations
@ -38,54 +38,57 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.5 cupertino_icons: ^1.0.5
font_awesome_flutter: ^10.2.1 font_awesome_flutter: ^10.2.1
http: ^0.13.5 http: ^1.2.2
provider: ^6.0.3 provider: ^6.0.3
shared_preferences: ^2.0.15 shared_preferences: ^2.0.15
fluttertoast: ^8.0.9 fluttertoast: ^8.0.9
image_picker: ^0.8.6 image_picker: ^1.1.2
url_launcher: ^6.1.6 url_launcher: ^6.1.6
flutter_launcher_icons: ^0.10.0 flutter_launcher_icons: ^0.13.1
package_info: ^2.0.2 package_info: ^2.0.2
share: ^2.0.4 share: ^2.0.4
flutter_local_notifications: ^12.0.1+1 flutter_local_notifications: ^17.2.2
cached_network_image: ^3.2.2 cached_network_image: ^3.2.2
carousel_slider: ^4.1.1 carousel_slider: ^5.0.0
intl: ^0.17.0 intl: ^0.19.0
flutter_typeahead: ^4.1.1 flutter_typeahead: ^5.2.0
speech_to_text: ^6.1.1 speech_to_text: ^7.0.0
firebase_core: ^2.4.0 firebase_core: ^3.4.1
firebase_messaging: ^14.2.0 firebase_messaging: ^15.1.1
qr_code_scanner: ^1.0.1 qr_code_scanner: ^1.0.1
flutter_sound: ^9.2.13 flutter_sound: ^9.2.13
permission_handler: ^10.2.0 permission_handler: ^11.3.1
rive: ^0.9.1 rive: ^0.13.13
another_flushbar: another_flushbar:
pinput: pinput:
audioplayers: ^1.1.1 audioplayers: ^6.1.0
flare_flutter: ^3.0.2 flare_flutter: ^3.0.2
signature: ^5.3.0 signature: ^5.3.0
flutter_svg: ^1.1.6 flutter_svg: ^2.0.10+1
file_picker: ^5.2.5 file_picker: ^8.1.2
record_mp3: ^2.1.0 record_mp3_plus: any
path_provider: ^2.1.0 path_provider: ^2.1.0
open_file: ^3.3.2 open_file: ^3.3.2
localization: ^2.1.0 localization: ^2.1.0
dotted_border: ^2.1.0 dotted_border: ^2.1.0
lottie: ^2.3.0 lottie: ^3.1.2
shimmer: ^2.0.0 shimmer: ^3.0.0
flutter_advanced_switch: ^3.0.1 flutter_advanced_switch: ^3.0.1
table_calendar: ^3.0.8 table_calendar: ^3.0.8
image_cropper: ^3.0.3 image_cropper: ^8.0.2
touchable: ^0.2.1
badges: ^3.1.1 badges: ^3.1.1
flutter_month_picker: ^0.0.2 # buttons_tabbar: ^1.1.2
syncfusion_flutter_charts: ^21.2.3 flutter_custom_month_picker: ^0.1.3
local_auth: ^2.1.6 syncfusion_flutter_charts: ^26.2.14
local_auth: ^2.3.0
local_auth_darwin: any
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
dependency_overrides:
win32: ^5.5.4
# The "flutter_lints" package below contains a set of recommended lints to # The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is # encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your # activated in the `analysis_options.yaml` file located at the root of your

Loading…
Cancel
Save