String xml file in Flutter

后端 未结 7 1890
难免孤独
难免孤独 2021-02-01 15:18

In flutter string text are directly set to the TextField widget like:

new Text(\'Hello,  How are you?\')

Is correct way ? or we ca

7条回答
  •  时光取名叫无心
    2021-02-01 15:27

      create "Strings.dart" file and add the below line==>
    
    
     class Strings
     {
          static String welcomeScreen="WelCome Page";
          static String loadingMessage="Loading Please Wait...!";
     }
    
     And then call the file using the below line using the widget
     Text(Strings.loadingMessage)
    
     Make sure that the String.dart file has been imported
    

提交回复
热议问题