Commit 3ffbc5c4 authored by Gavin An's avatar Gavin An

test

parent 2e705874
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
class FireStoreTestPage extends StatefulWidget {
const FireStoreTestPage({super.key});
@override
State<FireStoreTestPage> createState() => _FireStoreTestPageState();
}
class _FireStoreTestPageState extends State<FireStoreTestPage> {
final FirebaseFirestore store = FirebaseFirestore.instance;
late Stream<QuerySnapshot<Map<String, dynamic>>> querySnapShot;
@override
void initState() {
super.initState();
querySnapShot =
store.collection('baecha')
// .where('baljuGroupId', whereIn: ['baecha_group_001', 'baecha_group_002'])
.snapshots();
}
@override
Widget build(BuildContext context) {
return StreamBuilder(
stream: querySnapShot,
builder: (context, snapshot) {
if (!snapshot.hasData) {
return const CircularProgressIndicator();
}
List<QueryDocumentSnapshot<Map<String, dynamic>>> documents = snapshot.data!.docs;
return Expanded(
child: ListView.builder(
shrinkWrap: true,
reverse: true,
itemCount: documents.length,
itemBuilder: (context, index) {
final item = documents[index];
String id = item.id;
String groupId = item['baljuGroupId'];
String createDate = item['createDate'];
int callCnt = item['callCnt'];
int passCnt = item['passCnt'];
return Container(
margin: const EdgeInsets.all(10),
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
decoration: BoxDecoration(
color: Colors.amber,
border: Border.all(color: Colors.black, width: 1),
borderRadius: const BorderRadius.all(Radius.circular(20)),
),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('id: $id'),
Text('groupId: $groupId'),
Text('createDate: $createDate'),
Text('callCnt: ${callCnt.toString()}'),
Text('passCnt: ${passCnt.toString()}'),
],
),
);
},
),
);
},
);
}
}
This diff is collapsed.
...@@ -28,7 +28,7 @@ class _SpeechToTextPageState extends State<SpeechToTextPage> { ...@@ -28,7 +28,7 @@ class _SpeechToTextPageState extends State<SpeechToTextPage> {
/// Each time to start a speech recognition session /// Each time to start a speech recognition session
void _startListening() async { void _startListening() async {
await _speechToText.listen(onResult: _onSpeechResult); await _speechToText.listen(onResult: _onSpeechResultListener);
setState(() {}); setState(() {});
} }
...@@ -43,7 +43,8 @@ class _SpeechToTextPageState extends State<SpeechToTextPage> { ...@@ -43,7 +43,8 @@ class _SpeechToTextPageState extends State<SpeechToTextPage> {
/// This is the callback that the SpeechToText plugin calls when /// This is the callback that the SpeechToText plugin calls when
/// the platform returns recognized words. /// the platform returns recognized words.
void _onSpeechResult(SpeechRecognitionResult result) { void _onSpeechResultListener(SpeechRecognitionResult result) {
print('isFinal: ${result.finalResult}');
_lastWords = result.recognizedWords; _lastWords = result.recognizedWords;
setState(() {}); setState(() {});
} }
......
...@@ -761,10 +761,10 @@ packages: ...@@ -761,10 +761,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: uuid name: uuid
sha256: "83d37c7ad7aaf9aa8e275490669535c8080377cfa7a7004c24dfac53afffaa90" sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.4.2" version: "4.5.1"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
...@@ -777,10 +777,10 @@ packages: ...@@ -777,10 +777,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: vm_service name: vm_service
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "14.2.4" version: "14.2.5"
web: web:
dependency: transitive dependency: transitive
description: description:
......
...@@ -44,6 +44,8 @@ dependencies: ...@@ -44,6 +44,8 @@ dependencies:
firebase_messaging: ^15.0.4 firebase_messaging: ^15.0.4
kakao_flutter_sdk_user: ^1.9.5 # 카카오 로그인 API 패키지 kakao_flutter_sdk_user: ^1.9.5 # 카카오 로그인 API 패키지
uuid: ^4.5.1
# inversion of control(service locator) # inversion of control(service locator)
get_it: ^7.7.0 get_it: ^7.7.0
...@@ -52,8 +54,6 @@ dependencies: ...@@ -52,8 +54,6 @@ dependencies:
pretty_dio_logger: ^1.4.0 pretty_dio_logger: ^1.4.0
fluttertoast: ^8.2.8 fluttertoast: ^8.2.8
uuid: ^4.4.2
# secure storage # secure storage
flutter_secure_storage: ^9.2.2 flutter_secure_storage: ^9.2.2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment