title: Flutter : How to remove duplicates Json Object list
body: <p>I want to remove duplicated Profilemodel by name only  in items list ,  so I should get NO duplicated items in screen.
  I want to remove duplicated Profilemodel by name only  in items list ,  so I should get NO duplicated items in screen.</p>
  <p>I used <code>items.toSet().toList()</code> but its not work with my need.</p>
  <p><a href="https://i.stack.imgur.com/EDg3T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EDg3T.png" alt="What I want " /></a></p>
  <p><a href="https://i.stack.imgur.com/WF3Sa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WF3Sa.png" alt="What I DONT want " /></a></p>
  <p>Full code :</p>
  <pre><code>import 'package:flutter/material.dart';
  
  void main() =&gt; runApp(MyApp());
  
  
  class MyApp extends StatelessWidget {
    // This widget is the root of your application.
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        // Application name
        title: 'Flutter Hello World',
        // Application theme data, you can set the colors for the application as
        // you want
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        // A widget which will be started on application startup
        home: MyHomePage(),
      );
    }
  }
  
  class MyHomePage extends StatefulWidget {
    @override
    _MyHomePageState createState() =&gt; _MyHomePageState();
  }
  List&lt;Profilemodel&gt; items = [
    Profilemodel( age: 20 , name: 'Ahmed' ) ,
    Profilemodel( age: 30 , name: 'Fatma' ),
    Profilemodel( age: 15 , name: 'Ahmed' ),
    Profilemodel( age: 15 , name: 'jon' ),
    Profilemodel( age: 25 , name: 'Fatma' )];
  class _MyHomePageState extends State&lt;MyHomePage&gt; {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
          body : ListView.builder(
  itemBuilder: (context, index){
    return ListTile(
      title: Text('${items[index].name}'),
    );
  },
            itemCount: items.length,
          )
  
      );
    }
  }
  
  class Profilemodel{
    final String name;
    final int age;
    Profilemodel({this.name , this.age});
  }
  </code></pre>