โ ์กธ์ ์ํ ์์ฑ
23.09.27 ~ 10.01
โ
์ถ์ ์ฐํด์ ํฑํก ์กธ์
์ํ ๋ง๋ค๊ธฐ ์๋ฃ
23.10.02
โ
Day57-Implicit Animations 1/2
23.10.03
โ
Day57-Implicit Animations 2/2 ์๋ฃ
์กธ์ ์ํ์ ๋ง๋ค๋ฉด์ ๋์จ ์ด์๋ค
subscribeMyPosts(String userId) => _db
.collection("posts")
.where("creatorId", isEqualTo: userId)
.orderBy("createdAt", descending: true)
.snapshots()
.map(
(event) => event.docs
.map(
(doc) => fromSnapshotToPostModel(doc, userId),
)
.where((x) => x != null)
.map((e) => e!)
.toList(),
);
flutter: [cloud_firestore/failed-precondition] The query requires an index. You can create it here:
https://console.firebase.google.com/v1/r/project/../firestore/indexes?create_composite=Ck9wcm..
class PostModel {
final String id;
final String payload;
final Mood mood;
final Timestamp createdAt;
final bool liked;
final int likes; // redundant
final int commentCount; // redundant
final String creatorEmail;
final String creatorId;
final bool hasAvatar; // redundant
}
void _onTap(int index) {
context.go("/${_tabs[index]}");
setState(() {
_selectedIndex = index;
});
}
RotatedBox(
quarterTurns: -1,
child: ListWheelScrollView(
magnification: 2.0,
onSelectedItemChanged: (x) {
setState(() {
selected = x;
});
print(selected);
},
controller: _scrollController,
children: List.generate(
itemCount,
(x) => RotatedBox(
quarterTurns: 1,
child: AnimatedContainer(
duration: Duration(milliseconds: 400),
width: x == selected ? 60 : 50,
height: x == selected ? 60 : 50,
alignment: Alignment.center,
decoration: BoxDecoration(
color: x == selected ? Colors.red : Colors.grey,
shape: BoxShape.circle),
child: Text('$x')))),
itemExtent: itemWidth,
)
)
enum Mood {
happy("happy", "๐"),
thoughtful("thoughtful", "๐ค"),
love("love", "๐"),
amazed("amazed", "๐คฉ"),
laughing("laughing", "๐"),
sad("sad", "๐ข"),
angry("angry", "๐ก"),
shocked("shocked", "๐คฏ");
const Mood(this.id, this.emoji);
final String id;
final String emoji;
factory Mood.from(String id) {
return Mood.values.firstWhere(
(value) => value.id == id,
);
}
}
Image.network.errorBuilder ์ค๋์
์ ์ฌ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ try catch ๋ชจ๋ ์๋ ํด๋ณด์์ผ๋ 404 ์ผ ์ panic
=> ๊ฒฐ๊ตญ hasAvatar ๋ฅผ post ์๋ ํ ๋ฒ ๋ ์ ์ฅํ์ฌ ๋ก์ง์์ผ๋ก ์ฐจ๋จ
3๊ฐ ์ด์์ Hero๋ฅผ ์ฐ๊ณ ์ถ์ ๊ฒฝ์ฐ ์ด๋ป๊ฒ ํด์ผํ ๊น?
๊ฐ๋์ฉ IOS ์๋ฎฌ๋ ์ดํฐ ๋ฌผ๋ฆฌํค๋ณด๋ ์๋์ด ๋จ๋ฉด์ ํค๋ณด๋ ์
๋ ฅ์ด ์๋๋ ์ด์ ์์..
์๋ก๊ณ ์นจ์ผ๋ก ํด๊ฒฐ์ด ๋๊ธดํ์ง๋ง ๋น๋ฒํ๊ฒ ๋ฐ์
โโโโโโโโ Exception caught by services library โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
A KeyUpEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyUpEvent#20d1f(physicalKey: PhysicalKeyboardKey#f0183(usbHidUsage: "0x000700e2", debugName: "Alt Left"), logicalKey: LogicalKeyboardKey#e5ce6(keyId: "0x200000104", keyLabel: "Alt Left", debugName: "Alt Left"), character: null, timeStamp: 910:04:52.571258)
'package:flutter/src/services/hardware_keyboard.dart':
hardware_keyboard.dart:1
Failed assertion: line 432 pos 16: '_pressedKeys.containsKey(event.physicalKey)'