getSecondVersion method
Widget
getSecondVersion(
{ - IconData? icon,
- String? label,
- String? asset,
- int? i,
- int? pos,
- dynamic onTap()?,
- Color? coloricon,
- Color? coloractive,
- String? urlImage,
- bool? hasDataNew,
- Widget? iconNotification,
})
Implementation
Widget getSecondVersion(
{IconData? icon,
String? label,
String? asset,
int? i,
int? pos,
Function()? onTap,
Color? coloricon,
Color? coloractive,
String? urlImage,
bool? hasDataNew,
Widget? iconNotification,
}) {
return Expanded(
child: GestureDetector(
onTap: onTap,
child: hasDataNew != null
? Stack(
alignment: Alignment.center,
children: [
Container(
alignment: Alignment.topCenter,
color: Colors.white,
// height: 20,
width: MediaQuery.of(Config.navigatorKey.currentContext!).size.width,
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
urlImage != null
? Container(
padding: EdgeInsets.all(pos == i ? 4 : 0),
decoration: BoxDecoration(
color: Config.colorPrimary,
borderRadius: BorderRadius.circular(100)),
child: DefaultImageView(
imageUrl: urlImage,
circle: 100,
height: pos == i ? 24 : 30,
width: pos == i ? 24 : 30,
),
)
: asset != null ? Image.asset(
asset,
color: coloricon != null
? coloricon
: pos == i
? Config.colorPrimary
: Colors.grey,
height: 25,
width: 40,
) : Container(),
label == null
? Container()
: DefaultText(
sizeText: 10,
textLabel: label,
maxLines: 1,
textOverflow: TextOverflow.ellipsis,
colorsText: pos == i
? Config.colorPrimary
: Colors.grey,
)
],
)),
hasDataNew != null && hasDataNew == true
? iconNotification ?? Positioned(
top: 20,
right: 30,
child: Container(
height: 10,
width: 10,
decoration: BoxDecoration(
color: Config.colorPrimary ?? Colors.red,
borderRadius: BorderRadius.circular(5)),
),
)
: Container()
],
)
: Container(
alignment: Alignment.topCenter,
color: Colors.white,
// height: 20,
width: 40,
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
urlImage != null
? Container(
padding: EdgeInsets.all(pos == i ? 4 : 0),
decoration: BoxDecoration(
color: Config.colorPrimary,
borderRadius: BorderRadius.circular(100)),
child: DefaultImageView(
imageUrl: urlImage,
circle: 100,
height: pos == i ? 24 : 30,
width: pos == i ? 24 : 30,
),
)
: asset != null ? Image.asset(
asset,
color: coloricon != null
? coloricon
: pos == i
? coloractive
: Colors.grey,
height: 25,
width: 40,
) : Container(),
label == null
? Container()
: DefaultText(
sizeText: 10,
textLabel: label,
colorsText:
pos == i ? coloractive : Colors.grey,
)
],
)),
),
);
}