I'm new to Flutter/programming and can't solve this, any help is appreciated.
Just trying to return the name of a day ie. 2 = Tue

```
String dayname = dayGetter(day).toString();

  dayGetter(int daynumber){
   var daynames = ['none','Mon','Tue','Wed','Thur','Fri','Sat','Sun'];
   return daynames[daynumber];
  }

```

This works fine, but I want to separate the function to its own file.

```
String dayname = NumberToDay(daynumber: day).toString();

```

.

```
 class NumberToDay {

      final int daynumber;
      NumberToDay({this.daynumber});

      var daynames = ['n/a','Mon','Tue','Wed','Thur','Fri','Sat','Sun'];

     test(){
       return daynames[daynumber];
      }
 }

```

But this returns: Instance of 'NumberToDay' and I have no idea why or how to solve it.

Thanks