feat : icon Blend Tester widget
This commit is contained in:
@@ -43,38 +43,15 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
|
|||||||
widelyWidget(),
|
widelyWidget(),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
|
|
||||||
SizedBox(
|
|
||||||
height: 150,
|
|
||||||
child: ListView.separated(
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
itemCount: BlendMode.values.length,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
return Column(
|
|
||||||
spacing: 8,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Text(BlendMode.values[index].toString()),
|
|
||||||
Container(
|
|
||||||
margin: EdgeInsets.all(8),
|
|
||||||
width: 100,
|
|
||||||
height: 100,
|
|
||||||
child: Assets.vec.cubeCardSvg.svg(
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
colorFilter: ColorFilter.mode(Colors.red, BlendMode.values[index]),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}, separatorBuilder: (BuildContext context, int index) => SizedBox(width: 10)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Padding mainItemWidget() {
|
Padding mainItemWidget() {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
|||||||
@@ -1,23 +1,16 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:rasadyar_core/presentation/common/app_color.dart';
|
|
||||||
import 'package:rasadyar_core/presentation/utils/color_utils.dart';
|
|
||||||
import 'package:vector_graphics/vector_graphics.dart';
|
import 'package:vector_graphics/vector_graphics.dart';
|
||||||
|
|
||||||
SvgPicture vecWidget(
|
import '../common/assets.gen.dart';
|
||||||
String assets, {
|
|
||||||
double? width,
|
SvgPicture vecWidget(String assets, {double? width, double? height, BoxFit? fit, Color? color}) {
|
||||||
double? height,
|
|
||||||
BoxFit? fit,
|
|
||||||
Color? color,
|
|
||||||
}) {
|
|
||||||
return SvgPicture(
|
return SvgPicture(
|
||||||
AssetBytesLoader(assets),
|
AssetBytesLoader(assets),
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
fit: fit ?? BoxFit.contain,
|
fit: fit ?? BoxFit.contain,
|
||||||
colorFilter:
|
colorFilter: color != null ? ColorFilter.mode(color, BlendMode.srcIn) : null,
|
||||||
color != null ? ColorFilter.mode(color, BlendMode.srcIn) : null,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,36 +22,20 @@ Widget vecWidgetWithOnTap({
|
|||||||
BoxFit? fit,
|
BoxFit? fit,
|
||||||
Color? color,
|
Color? color,
|
||||||
}) {
|
}) {
|
||||||
return InkWell(
|
return InkWell(onTap: onTap, child: child);
|
||||||
onTap: onTap,
|
|
||||||
child: child
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SvgPicture svgWidget(
|
SvgPicture svgWidget(String assets, {double? width, double? height, BoxFit? fit, Color? color}) {
|
||||||
String assets, {
|
|
||||||
double? width,
|
|
||||||
double? height,
|
|
||||||
BoxFit? fit,
|
|
||||||
Color? color,
|
|
||||||
}) {
|
|
||||||
return SvgPicture.asset(
|
return SvgPicture.asset(
|
||||||
assets,
|
assets,
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
fit: fit ?? BoxFit.contain,
|
fit: fit ?? BoxFit.contain,
|
||||||
colorFilter:
|
colorFilter: color != null ? ColorFilter.mode(color, BlendMode.srcIn) : null,
|
||||||
color != null ? ColorFilter.mode(color, BlendMode.srcIn) : null,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget vecWidget2(
|
Widget vecWidget2(String assets, {double? width, double? height, BoxFit? fit, Color? color}) {
|
||||||
String assets, {
|
|
||||||
double? width,
|
|
||||||
double? height,
|
|
||||||
BoxFit? fit,
|
|
||||||
Color? color,
|
|
||||||
}) {
|
|
||||||
final resolvedColor = WidgetStateProperty.resolveWith<Color?>((states) {
|
final resolvedColor = WidgetStateProperty.resolveWith<Color?>((states) {
|
||||||
if (states.contains(WidgetState.pressed)) {
|
if (states.contains(WidgetState.pressed)) {
|
||||||
return Colors.white;
|
return Colors.white;
|
||||||
@@ -73,11 +50,37 @@ Widget vecWidget2(
|
|||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
fit: fit ?? BoxFit.contain,
|
fit: fit ?? BoxFit.contain,
|
||||||
colorFilter:
|
colorFilter: resolvedColor != null ? ColorFilter.mode(resolvedColor, BlendMode.srcIn) : null,
|
||||||
resolvedColor != null
|
|
||||||
? ColorFilter.mode(resolvedColor, BlendMode.srcIn)
|
|
||||||
: null,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SizedBox iconBlendTester(String vecPath) {
|
||||||
|
return SizedBox(
|
||||||
|
height: 150,
|
||||||
|
child: ListView.separated(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemCount: BlendMode.values.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return Column(
|
||||||
|
spacing: 8,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(BlendMode.values[index].toString()),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(8),
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
child: SvgGenImage.vec(vecPath).svg(
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
colorFilter: ColorFilter.mode(Colors.red, BlendMode.values[index]),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) => SizedBox(width: 10),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user