feat : action
add supervisons
This commit is contained in:
@@ -42,6 +42,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
child: leading,
|
||||
),
|
||||
actions: [
|
||||
if (additionalActions != null) ...additionalActions!,
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: IconButton(
|
||||
@@ -50,7 +51,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
color: iconColor,
|
||||
),
|
||||
),
|
||||
if (additionalActions != null) ...additionalActions!,
|
||||
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,25 +2,27 @@ import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/presentation/common/app_color.dart';
|
||||
import 'package:rasadyar_core/presentation/common/app_fonts.dart';
|
||||
|
||||
class RElevated extends StatefulWidget {
|
||||
class RElevated extends StatelessWidget {
|
||||
RElevated({
|
||||
super.key,
|
||||
required this.text,
|
||||
required this.onPressed,
|
||||
foregroundColor,
|
||||
backgroundColor,
|
||||
disabledBackgroundColor,
|
||||
disabledForegroundColor,
|
||||
radius,
|
||||
textStyle,
|
||||
this.foregroundColor,
|
||||
this.backgroundColor,
|
||||
this.disabledBackgroundColor,
|
||||
this.disabledForegroundColor,
|
||||
this.radius,
|
||||
this.textStyle,
|
||||
this.width = 150.0,
|
||||
this.height = 56.0,
|
||||
this.isFullWidth,
|
||||
});
|
||||
|
||||
final String text;
|
||||
final VoidCallback? onPressed;
|
||||
final double width;
|
||||
final double height;
|
||||
final bool? isFullWidth;
|
||||
Color? foregroundColor;
|
||||
Color? backgroundColor;
|
||||
Color? disabledForegroundColor;
|
||||
@@ -28,29 +30,24 @@ class RElevated extends StatefulWidget {
|
||||
double? radius;
|
||||
TextStyle? textStyle;
|
||||
|
||||
@override
|
||||
State<RElevated> createState() => _RElevatedState();
|
||||
}
|
||||
|
||||
class _RElevatedState extends State<RElevated> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ElevatedButton(
|
||||
onPressed: widget.onPressed,
|
||||
onPressed: onPressed,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: widget.backgroundColor ?? AppColor.blueNormal,
|
||||
foregroundColor: widget.foregroundColor ?? Colors.white,
|
||||
backgroundColor: backgroundColor ?? AppColor.blueNormal,
|
||||
foregroundColor: foregroundColor ?? Colors.white,
|
||||
disabledBackgroundColor:
|
||||
widget.disabledBackgroundColor ?? AppColor.blueNormal.withAlpha(38),
|
||||
disabledForegroundColor: widget.disabledForegroundColor ?? Colors.white,
|
||||
disabledBackgroundColor ?? AppColor.blueNormal.withAlpha(38),
|
||||
disabledForegroundColor: disabledForegroundColor ?? Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(widget.radius ?? 8),
|
||||
borderRadius: BorderRadius.circular(radius ?? 8),
|
||||
),
|
||||
fixedSize: Size(widget.width, widget.height),
|
||||
minimumSize: Size((isFullWidth ??false) ? double.infinity : width, height),
|
||||
padding: EdgeInsets.zero,
|
||||
textStyle: widget.textStyle ?? AppFonts.yekan24,
|
||||
textStyle: textStyle ?? AppFonts.yekan24,
|
||||
),
|
||||
child: Text(widget.text),
|
||||
child: Text(text),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
@immutable
|
||||
class RTextField extends StatefulWidget {
|
||||
@@ -27,6 +28,7 @@ class RTextField extends StatefulWidget {
|
||||
this.minLines,
|
||||
this.radius,
|
||||
this.filled,
|
||||
this.filledColor,
|
||||
this.enabled,
|
||||
this.errorStyle,
|
||||
this.labelStyle,
|
||||
@@ -61,6 +63,7 @@ class RTextField extends StatefulWidget {
|
||||
this.readonly = false,
|
||||
this.label,
|
||||
this.filled,
|
||||
this.filledColor,
|
||||
this.errorStyle,
|
||||
this.labelStyle,
|
||||
this.enabled}) {
|
||||
@@ -95,6 +98,7 @@ class RTextField extends StatefulWidget {
|
||||
this.readonly = false,
|
||||
this.label,
|
||||
this.filled,
|
||||
this.filledColor,
|
||||
this.errorStyle,
|
||||
this.labelStyle,
|
||||
this.enabled}) {
|
||||
@@ -132,6 +136,7 @@ class RTextField extends StatefulWidget {
|
||||
Widget? suffixIcon;
|
||||
Widget? prefixIcon;
|
||||
bool? filled;
|
||||
Color? filledColor;
|
||||
bool _isPassword = false;
|
||||
|
||||
final BoxConstraints? boxConstraints;
|
||||
@@ -204,8 +209,9 @@ class _RTextFieldState extends State<RTextField> {
|
||||
prefixIconConstraints: widget.boxConstraints,
|
||||
hintText: widget.hintText,
|
||||
labelText: widget.label,
|
||||
labelStyle: widget.labelStyle,
|
||||
labelStyle: widget.labelStyle??AppFonts.yekan14.copyWith(color: AppColor.lightGreyDarkActive),
|
||||
filled: widget.filled,
|
||||
fillColor: widget.filledColor,
|
||||
counter: widget.showCounter ? null : const SizedBox(),
|
||||
hintStyle: widget.hintStyle,
|
||||
enabledBorder: widget._inputBorder,
|
||||
|
||||
Reference in New Issue
Block a user