I want to add 3d tags in my Flutter App UI like red tag in corner shown in reference image below. Is there any package available for these?
2
Try using Tooltip Widget reference and to customize refer this link.
Tooltip( verticalOffset:6.0, message: "${_getServiceList(position)}", textStyle: TextStyle( color: ColorConstants.whiteTwo, fontWeight: FontWeight.w500, fontSize: 14), showDuration: Duration(seconds: 6), decoration: BoxDecoration( border: Border.all( width: 1, color: ColorConstants.pinkishGrey, ), borderRadius: BorderRadius.circular(5), gradient: const LinearGradient(colors: [ ColorConstants.toolTipRed, ColorConstants.toolTipRed ]), ), triggerMode: TooltipTriggerMode.tap, child: Icon( size: 14, Icons.info_outlined, color: ColorConstants.appRed, ), )
3d tag image I made custom 3d tag view you want just like that, Use this below code.
import 'package:flutter/material.dart'; class ToolTipViewScreen extends StatelessWidget { const ToolTipViewScreen({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Scaffold( body: Center( child: Stack( alignment: Alignment.center, children: [ Container( height: 300, width: 320, decoration: BoxDecoration( border: Border.all( color: Colors.blue.withOpacity(0.2), ), borderRadius: BorderRadius.circular(10), ), child: Column( mainAxisSize: MainAxisSize.min, children: [ Container( height: 35, decoration: const BoxDecoration( color: Color(0xffc9d6ea), borderRadius: BorderRadius.only( topLeft: Radius.circular(10), topRight: Radius.circular(10), ), ), ), ], ), ), Positioned( right: 0, top: 60, child: Transform.translate( offset: const Offset(16, 0), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.end, children: [ Container( height: 37, decoration: BoxDecoration( color: const Color(0xfff2d6d3), boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.3), blurRadius: 7.0, spreadRadius: 4, offset: const Offset( 5, 5, ), ) ], ), child: const Padding( padding: EdgeInsets.all(10.0), child: Text( "TAT +80 D", style: TextStyle( color: Color(0xffc94e40), fontWeight: FontWeight.w500, ), ), ), ), Padding( padding: const EdgeInsets.only(right: 2.0), child: ClipPath( clipper: TriangleClipper(), child: Container( color: const Color(0xffd7bfc9), height: 10, width: 22, ), ), ) ], ), ), ), ], ), ), ); } } class TriangleClipper extends CustomClipper<Path> { @override Path getClip(Size size) { final path = Path(); path.lineTo(size.width, 0.0); path.lineTo(size.width / 2, size.height); path.close(); return path; } @override bool shouldReclip(TriangleClipper oldClipper) => false; }
Click here to cancel reply.
2
Answers
Try using Tooltip Widget reference
and to customize refer this link.
3d tag image I made custom 3d tag view you want just like that, Use this below code.