sniper-fly / comfortable_diary Goto Github PK
View Code? Open in Web Editor NEWdiary app created by flutter
diary app created by flutter
dayタブで+ボタンを押した後、
①ポップアップメニューから追加するプロパティのタイプを選択する(文章、画像、etc)
②選択したタイプ毎のページに遷移する
これは項目ごとに違うページに遷移するのでday_property_choose_dialogの中でそれぞれ設定する
③遷移先ページでプロパティのタイトル、コンテンツ(画像or文章)を入力し、firestoreにアップロードする。
④遷移先で入力が終わったらdayメインページに戻り、firestoreの変更を読み取る
このとき、戻るボタンが機能するとまずいのでnavigatePage funcは使えない
テキストフィールドは現在複数行に対応していますが、
一定の行数を超えると
BOTTOM OVERFLOWED BY ~~ PIXELSエラーを吐いてしまいます。
evernoteやgoogle docのようなフルスクリーンのテキストフィールドを上手く実装する必要がありそうです。
アプリの目指す形が決まったので、拙いですがイメージを描きました。
前回お話したときは、復習管理アプリにしたいという旨の発言をしましたが、
ウェブアプリでの実装もやりたいので、実装が煩雑になりそうなこと、
復習管理アプリは他にも使えるアプリがあるため、他作者のアプリを使う中で不満に感じることがあったらまたの機会に自分でアプリを作ろうかと思います。
ということで今回のコンセプトは日毎にプロパティを追加可能な日記です。
・メイン画面上にアイコンがあり、それをタップすることでプロパティの詳細ページに遷移します。
・メイン画面では各プロパティのハイライト(文の先頭部分の表示、サムネイル表示みたいなのができると嬉しい)を表示したいです。
・月ごとのカレンダー表示ができるようにしたいです。
・searchタブで日記の検索ができるようにしたいです。
・プロパティアイコンの大きさを任意で変更できると嬉しい。
・これだけだと全然普通にありそうなアプリなので、ウェブアプリの実装もやりたい!
その他オプション
・statisticsで日記の統計データを表示できると楽しい
画像やテキストなどの異なる形式のデータをまとめて扱うPropertyクラスを定義しました。
画像があれば画像を、テキストがあればテキストを返すメソッドを定義する必要がありそうです。
インターバルタイマーを音無しでデジタル時計でChangeNotifierとProviderで実装する
・コールバックではなくfirebaseに送って実装する
・ログイン後にログイン画面に戻れないようにする
・ローディング画面を改善する
(initial_page : snapshot connection state)
・ログアウトボタンを実装する
・diary_detailのcontentを左と右 16pixelずつ空ける
画面遷移後に上図のようなエラーが発生する。
コンソールのエラーメッセージは以下。
════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following assertion was thrown building DiaryDetail(dirty):
A non-null String must be provided to a Text widget.
'package:flutter/src/widgets/text.dart':
Failed assertion: line 285 pos 10: 'data != null'
Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=BUG.md
When the exception was thrown, this was the stack:
#2 new Text (package:flutter/src/widgets/text.dart:285:10)
#3 DiaryDetail.build (package:flutterapp/diary_detail.dart:30:22)
#4 StatelessElement.build (package:flutter/src/widgets/framework.dart:4291:28)
#5 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4223:15)
#6 Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
...
════════════════════════════════════════════════════════════════════════════════════════════════════
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) {
return Hogehoge();
},
),
);
上記のような画面遷移の一連の文は、いたるところで使われるので
関数化して簡潔に記述できるようにしたいのですが、うまくいきません。
例えば
`void navigatePage(var page) {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) {
return page;
},
),
);
}`
このように書いて onPressedに
onPressed: navigatePage(CreateEntry());
と書いても
The expression here has a type of 'void', and therefore can't be used.
と表示され使うことができない。
(widget型に変更して試したが、void型でないとダメと怒られた)
今週の宿題
(1)article入力画面の画面崩れを直す
comfortable_diary/lib/create_entry.dart
Lines 13 to 21 in 191da07
イギリスの時刻になってしまう。
(1)main.dartのコードがめちゃくちゃ見づらいので関数分割して整理
(2)どのようなUI/UXにするのかイメージの共有
(3)googleアカウント等によるログインを可能に
(4)一度ログインしたら何度もログインしなくても済むようにする。
(5)日記エントリーの並び替え機能
(1)firebaseから受け取ったプロパティのtype(str)をpropertyTypeに変換する
(2)画像のデコレーション
(3)テーマカラーの変更機能
(4)ログインメールアドレスの表示
(5)カレンダーで整理
(6)プロパティの削除機能
comfortable_diary/lib/create_entry.dart
Lines 36 to 40 in 191da07
なぜかprintされなくなってしまった。
a
ファイル名は小文字とアンダーバーで命名するように修正してください
例)
initialPage → initial_page
間違って[email protected](いつもこのユーザでログインしてます)のデータを消してしまったので新しくユーザーをレジスターしようとしたら
登録情報がないにも関わらずメインページが表示されてしまいました。
(1)デバイスの写真をピックする
(2)ピックした写真をfirebaseのストレージにアップする
(3)アップロードした写真のURLを写真のプロパティに持たせる (Image image-> String imageUrl)
カレンダーのパッケージを予習
次週
(4)日付によるスイッチ
(5)カレンダー月表示
nameをdateに変えてみる。プログラムを使って、日記の日付を表示する。
詳細画面、作成画面を少しデザインしてみる。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.