The argument type 'List<Widget>' can't be assigned to the parameter type 'List<String>?'

1,201

Solution 1

You can check the HTTP referer header in .htaccess. The referer indicates the address of the web page that linked to the resource being fetched - so you could check that the referer points to a page on the right domain.

For details, see e.g. this question: control apache referrer to restrict downloads in htaccess file

Warning:

This is easy to circumvent if people know the name of the domain that you are checking for. Most browsers and download tools allow setting the referer directly, so if you know that only referers pointing to http://foo.example/ are allowed, you can just set your referer to http://foo.example/blah, and the access check will not block you.

If you want serious security, the only sensible option it probably proper authentication (by username/password or by certificat), combined with an HTTPS-only website.

Solution 2

You cannot use List<Widget> inplace of List<String> in items field.You need to use list which contain String. Currently you use Text() List and Text is Widget. You need to use items like this

items: con.mainCategoryList.map((value) {
                    return value.categoryName!;
                  }).toList(),
Share:
1,201

Related videos on Youtube

praveen
Author by

praveen

Updated on January 03, 2023

Comments

  • praveen
    praveen over 1 year

    My dart

    List<Widget> getcategoryname() {
        List<Widget> category_name = categorynameController.CategoryNameList
            .map((e) {
              var index = categorynameController.CategoryNameList.length;
              print(index);
              for (int i = 0; i < index; i++) {
                var name = e.name.toString();
                print(name);
    
                return Text(name);
              }
            })
            .cast<Widget>()
            .toList();
        return category_name;
      }
    
    
    Widget pet_category()=>DropdownSearch<String>(
        mode: Mode.MENU,
                  
    
                    items: getcategoryname(),
        label: "Menu mode",
        hint: "country in menu mode",
        popupItemDisabled: (String s) => s.startsWith('I'),
        onChanged: print,
        selectedItem: "Brazil");
    

    i am using dropdown_search 2.0.1 plugin items:getcategoryname() show error how to fix this error**

  • Ravi Limbani
    Ravi Limbani about 2 years
    @praveen if its working for you give upvote and verify answer for encourage Thanks