2023-03-02から1日間の記事一覧
pubspec.yamlを更新した。 - realm: ^0.4.0+beta + realm: ^1.0.2 モデルファイルはそのままで行けないので、 以下で再生成した。 flutter pub run realm generate realmはrealm.Realm?なインスタンスが格納されているとする そうしたら次は、以下のようにqu…
Null check operator used on a null value なるエラーがFadeInImage.assetNetworkで発生 @override Widget build(BuildContext context) { final copiedUrl = imageUrl; if (copiedUrl == null || copiedUrl.isEmpty) { } else { print('おかしいかい?'); …
class CurrentIndexNotifier extends StateNotifier<int> { CurrentIndexNotifier() : super( // 初期値として適当なデータを入れています 0, ); void setIndex(int index) { state = index; } } final currentIndexProvider = StateNotifierProvider<CurrentIndexNotifier, int>((ref) { ret</currentindexnotifier,></int>…
import 'package:flutter/material.dart'; class Jilkken extends StatelessWidget { const Jilkken( this.wiredStr, { Key? key, }) : super(key: key); // エラーになるOptionalなString final String? wiredStr; @override Widget build(BuildContext con…
TextFieldのクリアボタンを以下のようにしたが、 decoration: InputDecoration( // クリアボタンはオンオフ表示 suffixIcon: (ref.watch(_textProvider) != '') ? IconButton( onPressed: () { textEditingController.clear(); ref .read(_textProvider.noti…
こんな感じの実装をしている。 imageUrlは存在する画像。 FadeInImage.assetNetwork( image: imageUrl, placeholder: 'images/icon_loading.png', ), ======== Exception caught by image resource service ===============================================…