Flutter convert int variable to string

后端 未结 4 905
北荒
北荒 2020-12-03 17:06

I\'m new with Flutter and I wonder about how difficult is (for me) to find a solution on how to convert my variable var int counter = 0; into a variable var String $

4条回答
  •  失恋的感觉
    2020-12-03 17:45

    // String to int

    String s = "45";
    int i = int.parse(s);
    

    // int to String

    int j = 45;
    String t = "$j";
    

    // If the latter one looks weird, look into string interpolation on https://dart.dev

提交回复
热议问题