万年素人からHackerへの道

万年素人がHackerになれるまで殴り書きするぜ。

  • ・資産運用おすすめ
    10万円は1000円くらい利益
    資産運用ブログ アセマネ
    • ・寄付お願いします
      YENTEN:YYzNPzdsZWqr5THWAdMrKDj7GT8ietDc2W
      BitZenny:ZfpUbVya8MWQkjjGJMjA7P9pPkqaLnwPWH
      c0ban:8KG95GXdEquNpPW8xJAJf7nn5kbimQ5wj1
      Skycoin:KMqcn7x8REwwzMHPi9fV9fbNwdofYAWKRo

    AddSearchメモ

    [1, 2, 23, 33];

    Stringの配列になる

    ["1", "2", "23", "33"];

    しかも、値が1つのときは、Stringになるっぽい

    ["2"]

    "2"

    FiresoreのTimeStampはこのとうに無理やり変換??

    newData['profile.birthday'] = newData.profile['birthday']['_seconds'];

    こんな値は使えない。

    newData['test'] = {
      'a': 1,
    };

    Firestoreの配列はなぜかobjectなのでこんな感じに無理やり変換 これはおおげさ

    newData['array_prop'] = Object.values<Number>(newData['array_prop']).map((item: any) => parseInt(item));

    これでいいかもNumberにならないけど

    newData['array_prop'] = Object.values<Number>(newData['array_prop']);

    type 'int' is not a subtype of type 'String' in type castのエラー

    Map<int, List<int>> favoritePlaces;な変数 がある。 intのキー指定してnullなら初期化してaddできるようにしたいが・・。

        if (favoritePlaces[location]?.contains(index) ?? false) {
          favoritePlaces[location].remove(index);
        } else {
          // なければList<int>初期化
          if (favoritePlaces[location] == null) {
            print(favoritePlaces.runtimeType);
            favoritePlaces[location] = <int>[];
          }
    
          favoritePlaces[location].add(index);
        }

    CastMap<String, dynamic, int, List>

    ════════ Exception caught by gesture ═══════════════════════════════════════════════════════════════
    The following _CastError was thrown while handling a gesture:
    type 'int' is not a subtype of type 'String' in type cast