Question: Below is a snippet of my code:

```
class _MyHomePageState extends State<MyHomePage> {
  Widget buildButton(String buttonText) {
    return Expanded(
      child: new OutlineButton(
        padding: EdgeInsets.all(24.0),
        child: new Text(buttonText),
        style: TextStyle(fontWeight: FontWeight.bold),
        onPressed: () => {},
      ),
    );
  }

```

I am getting the following error:

```
lib/main.dart:30:7: Error: No named parameter with the name 'style'.
      style: TextStyle(fontWeight: FontWeight.bold),
      ^^^^^

Context: Found this candidate, but the arguments don't match.
  const OutlineButton({
        ^^^^^^^^^^^^^

```

I am new to flutter and don't know what is wrong with my style statement.

Answer: 
The cleanest way do do it I think would be to use list comprehension to remove all the appeareances of the element, and then add the element to the end.
You can do something like that:

```
def removeDuplicates(my_list,current):
    return [ element for element in my_list if element != current] + [current]

```

And calling the function:

```
>>> my_list
['sam', 'sam', 'is', 'a', 'is', 'sam', 'good', 'person', 'person']

>>> my_list2 = removeDuplicates(my_list,"sam")
>>> my_list2
['is', 'a', 'is', 'good', 'person', 'person', 'sam']

>>> my_list3 = removeDuplicates(my_list2,"person")
>>> my_list3
['is', 'a', 'is', 'good', 'sam', 'person']

```
try this,

```
def remove(key, value):
    filter_ = []
    for v in value:
        if key == v and key in filter_:
            continue

        filter_.append(v)
    return filter_

my_list = ["sam","sam", "is", "a", "is", "sam" , "good", "person", "person"]

my_list = remove("sam", my_list)
print(my_list)

my_list = remove("person", my_list)
print(my_list)

```

---

```
['sam', 'is', 'a', 'is', 'good', 'person', 'person']

['sam', 'is', 'a', 'is', 'good', 'person']

```