Widget not returning view on Future<bool> condition in flutter

Widget not returning view. isAttrAssignedToProduct in this method I'm trying to find the assigned attribute in the table if the product exists in the table then return true and the image will be inflated in listview item on the base of true or false. My database returning true or false on condition but the view is not visible.

Widget isAttrAssigned(int index){
Future result = isAttrAssignedToProduct(index);
return FutureBuilder(
    future: result,
    builder: (BuildContext context, AsyncSnapshot snapshot) {
        debugPrint('FUTURE VALE ${v}');
 Widget attr(bool v){
    return v==true?Container(
      width: 20.0,
      height: 20.0,
      decoration: BoxDecoration(
          color: Colors.yellow),
      child: Image.asset('assets/images/right.png'),

My Query working fine

 Future<bool> isAttrAssignedToProduct(int index) async {
    List<Map<String, dynamic>> assd=new List<Map<String, dynamic>>();
      assd= await dbHelper.queryReadGroupAssignedAttribute(productList[index][DatabaseHelper.columnpid]);
       // debugPrint('ASSIGNED ATTR PRESENT ${assd.length}');
        return true;
        return false;
      //debugPrint('ASSIGNED ATTR EXCEPTION ${e}');
      return false;

My List Tile

          contentPadding: EdgeInsets.only(left: height*0.03,right: height*0.03 ),
          onTap: (){
              MaterialPageRoute(builder: (context) => ProductDetails(pid: productList[index]["pid"],),
                  settings: RouteSettings(name: '/productdetail')),).then((value){
                    setState(() {
                    debugPrint('CEHCK BACK FROM DAETAIL $length');
          title: Text(
              style: TextStyle(fontFamily: 'semibold',color: MyColors.colorPrimaryDark,fontSize: 18.0)),
          subtitle: Text(
              'Price \$${price}',
              style: TextStyle(color: Colors.grey,fontSize: 14.0,fontFamily: 'semibold')),
          trailing:isAttrAssigned( index), //here i'm trying to inflate image


  • your function Widget isAttrAssigned is not returning anything.

    If you want to build a widget based on a Future, you can use a FutureBuilder.

    Widget isAttrAssigned(int index) {
       // maybe you want to cache your result here, to avoid doing a call at each rebuild
       Future result = isAttrAssignedToProduct(index);
       return FutureBuilder(
          future: result
          builder: (BuildContext context, AsyncSnapshot snapshot) {
         // return widget
 is your boolean

    switch (snapshot.connectionState) { 
    case ConnectionState.none: 
    return Container(); // empty or show a placeholder 
    case ConnectionState.waiting: 
    return Text('Loading ...'); 
    case ConnectionState.done: 
    if (snapshot.hasError) { 
    return Text('Error: ${snapshot.error}'); 
    return attr(;