まだどこにもないアプリを作る

アプリ開発でつまづいたところなどを中心に記事にして行きます。

Flutter

Flutter でGooglePhotoアプリのサンプル作ってた時の備忘録

codelabs.developers.google.com ↑のサンプルでflutterでgoogle PhotoのAPIを使った簡単なアプリができるようになります。 このサイトどうりにやってみて出たエラーなどを書いていきます エラー Your app is missing support for the following URL schemes:…

MacでSafariのExperimental features(実験的な機能)の設定をオンオフする方法

MacをMacOSBig Sur 11.6 Safariをバージョン15.0 にアップデートしたところ Flutterを使って作られているWebサイトにアクセスすることができなくなってしまいました。 こことか Flutterラボ|動画で学ぶFlutter学習サイト これはiPhone iPadのSafariでもiOS1…

FutureBuilderにてNull check operator used on a null value in Futerbuilderと出るときの対処法。<初心者>

stackoverflow.com こちらの記事を全面的に参考にさせていただきました。 Futurebuilderでなにかを表示する際 Null check operator used on a null value in Futerbuilderなどの このエラーが出ることがあります。 私の修正前のコードはこれでした↓ <main.dart>のStatel</main.dart>…

Flutter Dart 文字列から数値のみを取り出す方法

簡単にできると思いましたが意外と見つけるまで時間かかってしまいました。 Dartには文字列から数値のみを抽出するようなメソッドはないようです。 なので.replaceAllを使います。 RegExp(r"[^0-9]")は正規表現を使っているようです。 rはスペルミスじゃない…

Flutter Firestoreエラー Bad state: field does not exist within the DocumentSnapshotPlatform

私の場合は存在しないフィールドの名前を指定してしまっていました。 document['content']) この``で囲まれているところにスペルミスとかないかチェック 存在するフィールドに直したところ治りました。 参考になれば幸いです。

flutter エラーThe following assertion was thrown while applying parent data.: Incorrect use of ParentDataWidget. Expanded

The following assertion was thrown while applying parent data.:Incorrect use of ParentDataWidget. The ParentDataWidget Expanded(flex: 1) wants to apply ParentData of type FlexParentData to a RenderObject, which has been set up to accept Pa…

Flutter これ知ってたら便利 一度かけたContainer,Row ,ColumnなどのWidgetを簡単に外す方法

これ見つけました。 外したいWidgetの上で右クリック。 からの 💡Show Context Actions をクリックしてください。 それからこの選択肢が出ると思うので Remove this widgetを選択 これで自動的に()の数とかも調整してくれます。 ちょー便利だから試してみてく…

flutter elevatedbuttonの透過 難しかったらOutlineButtonという選択肢もあります。

flutterでelevatedbuttonを背景透過させたかったのですがうまくいかなかったので 調べてたらこれが見つかりました。OutlineButton OutlinedButton( onPressed: () {}, style: OutlinedButton.styleFrom( primary: Colors.white, shape: const CircleBorder( …

作業効率化-Android Studio スコープの中を全て選択する方法!

Android Studio スコープの中を簡単に全て選択する方法を紹介します。 かなり細かい作業で慣れが必要になりそうですがこんな感じです。 ↓この場合child:Columnのスコープの範囲を一括で選択したいとしたら childの先頭の文字の左側のスペースをダブルクリッ…

Flutter - Platform.isAndroidが出てこないerror: The name 'Platform' is defined in the libraries 'dart:html' and 'dart:io'. (ambiguous_import at [flutterlab_admob] lib/pages/point_list_page.dart:36)

stackoverflow.com ↑こちらのサイト様を参考にさせていただきました。 Platform.isAndroidと打ち込んでもうまく行かない場合は、 import 'dart:io' as io; をインポートしましょう。 そして使うときは io.Platform.isAndroid Platformの前にio.をつけましょう…

Flutterプロジェクトに画像を追加の際のエラー Error on line 48, column 4: Expected a key while parsing a block

Error detected in pubspec.yaml:Error on line 48, column 4: Expected a key while parsing a block mapping. ╷48 │ assets: │ ^ ╵Please correct the pubspec.yaml file at /Users/xxx/StudioProjects/pj名/pubspec.yaml Flutterプロジェクトに画像を追加…

Flutter 備忘録 NetworkImage()はWidgetではありません。

stackoverflow.com ↑のサイト様がわかりやすいです。 NetworkImage()はウィジェットではないらしく、 child:に設定するとerror: The argument type 'NetworkImage' can't be assigned とエラーが出ます。 backGroundImage:などのプロパティであればエラーは…

Dart - エラー Invalid constant value

error: Invalid constant value. (invalid_constant at [] lib/pages/.dart:64) どこかしらのconstを消すとエラー解消します。

Dart アンラップのやり方(初心者)

Dart error: The argument type 'String?' can't be assigned to the parameter type 'String'. (argument_type_not_assignable at [] lib/pages/top_page.dart:43) わたしはDart初心者です 上記のようなエラー String? imagePath; このように変数を定義して…

flutter:Dart - undefined class 'Bool'

class Message{ String? message; Bool? isMe; DateTime? sendTime; Message({this.message,this.isMe,this.sendTime});}このコードを書いたらこうエラーが出ました。下記のようBoolのBを小文字にしたら解決しました class Message{ String? message; bool? …

flutterでMLKITを使おうとした時のエラーCocoaPods could not find compatible versions for pod "google_ml_kit":  

google_ml_kitは2021/09/06現在 ios10以上でないと使えないようです? まずflutterのプロジェクトのXcodeのプロジェクトを開きます↓ 白いのRunner..xcworkspaceを開く なければRunner.xcdeprojを開く ここからデプロイメントターゲットをiOS10以降にあげまし…