This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// show chat screen | |
import 'dart:developer'; | |
import 'package:chat/consts.dart'; | |
import 'package:cloud_firestore/cloud_firestore.dart'; | |
import 'package:flutter/material.dart'; | |
class ChatPage extends StatelessWidget { | |
ChatPage({Key? key, required this.roomId}) : super(key: key); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:developer'; | |
import 'package:chatapp/const.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:geolocator/geolocator.dart'; | |
import 'package:google_maps_flutter/google_maps_flutter.dart'; | |
class MapPage extends StatefulWidget { | |
MapPage({Key? key}) : super(key: key); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To parse this JSON data, do | |
// | |
// final station = stationFromJson(jsonString); | |
//import 'package:meta/meta.dart'; | |
import 'dart:convert'; | |
import 'dart:developer'; | |
import 'package:evstation/const.dart'; | |
import 'package:flutter/services.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": "2", | |
"station_favorite": false, | |
"name": "สยามพารากอน", | |
"address": "ปทุมวัน, ปทุมวัน, กรุงเทพมหานคร", | |
"description": "GA [North] B18-B19,C18-C19", | |
"latitude": 13.745764, | |
"longitude": 100.53473, | |
"status": "ปิดบริการ", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* https://pub.dev/packages/google_maps_flutter | |
* https://pub.dev/packages/geoflutterfire | |
* https://pub.dev/packages/geolocator | |
* https://pub.dev/packages/google_maps_utils | |
* https://pub.dev/packages/google_maps_cluster_manager | |
* https://pub.dev/packages/permission_handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double bmi = _weight / ((_height / 100) * (_height / 100)); | |
setState(() { | |
if (bmi < 18.5) { | |
_result = "Underweight"; | |
_color = Colors.lightBlue; | |
} else if (bmi < 25) { | |
_result = "Normal"; | |
_color = Colors.green; | |
} else if (bmi < 30) { | |
_result = "Overweight"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:developer' as dev; | |
import 'dart:math'; | |
import 'package:cloud_firestore/cloud_firestore.dart'; | |
import 'package:firebase_core/firebase_core.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:intl/intl.dart'; | |
import 'package:location/location.dart'; | |
import 'package:url_launcher/url_launcher.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// (6) set value to drop down here | |
dev.log('goto page with docId = $value'); | |
snapshot.data!.docs.where((e) => e.id == value).forEach((e) { | |
dev.log('${e.data()}'); | |
setState(() { | |
dropdownValue = value.toString(); | |
// set your value here | |
dev.log(e["timestamp"]); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// show dropdown | |
Center( | |
child: Container( | |
height: 50, | |
padding: const EdgeInsets.only( | |
left: 10.0, | |
right: 10.0, | |
), | |
decoration: BoxDecoration( | |
borderRadius: BorderRadius.circular(50.0), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get log history | |
FutureBuilder( | |
future: FirebaseFirestore.instance.collection('sick').doc(widget.idcard).collection('logs').get(), | |
builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) { | |
if (snapshot.hasError) { | |
return Text('Error: ${snapshot.error}'); | |
} | |
if (!snapshot.hasData) { | |
return Text('Loading...'); |