feat : button , outlined button
fab button , fab outlined button , input , pagination widget's
This commit is contained in:
47
lib/presentation/widget/vec_widget.dart
Normal file
47
lib/presentation/widget/vec_widget.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:vector_graphics/vector_graphics.dart';
|
||||
|
||||
SvgPicture vecWidget(
|
||||
String assets, {
|
||||
double? width,
|
||||
double? height,
|
||||
BoxFit? fit,
|
||||
Color? color,
|
||||
}) {
|
||||
return SvgPicture(
|
||||
AssetBytesLoader(assets),
|
||||
width: width,
|
||||
height: height,
|
||||
fit: fit ?? BoxFit.contain,
|
||||
colorFilter:
|
||||
color != null ? ColorFilter.mode(color, BlendMode.srcIn) : null,
|
||||
);
|
||||
}
|
||||
Widget vecWidget2(
|
||||
String assets, {
|
||||
double? width,
|
||||
double? height,
|
||||
BoxFit? fit,
|
||||
Color? color,
|
||||
}) {
|
||||
final resolvedColor = WidgetStateProperty.resolveWith<Color?>((states) {
|
||||
if (states.contains(WidgetState.pressed)) {
|
||||
return Colors.white;
|
||||
}
|
||||
return color;
|
||||
}).resolve({}); // You can pass actual states if needed
|
||||
|
||||
return IconTheme(
|
||||
data: IconThemeData(color: resolvedColor),
|
||||
child: SvgPicture(
|
||||
AssetBytesLoader(assets),
|
||||
width: width,
|
||||
height: height,
|
||||
fit: fit ?? BoxFit.contain,
|
||||
colorFilter: resolvedColor != null
|
||||
? ColorFilter.mode(resolvedColor, BlendMode.srcIn)
|
||||
: null,
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user