Wytex System
Wytex System

Reputation: 147

Import a list of string from another file in flutter

I would create a class with a list of string in flutter on a another file and import this file to a main file that I am working.... for example:

class OrderDetails {

  final email = 'Email';
  final name = 'Mario';
  final city = 'Milano';

}

have this class into a file called details.dart and import these strings to another main file

Upvotes: 0

Views: 1638

Answers (1)

Neeraj Amoli
Neeraj Amoli

Reputation: 1016

 details.dart

class OrderDetails {
  static final email = 'Email';
  static final name = 'Mario';
  static final city = 'Milano';
}

import this file to that file where you want to use this file using

 import '/your_file_path/details.dart';

now use those value like this

 OrderDetails.email etc

Upvotes: 3

Related Questions