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 cityWeather = cityWeatherFromJson(jsonString); | |
//import 'package:meta/meta.dart'; | |
import 'dart:convert'; | |
CityWeather cityWeatherFromJson(String str) => CityWeather.fromJson(json.decode(str)); | |
String cityWeatherToJson(CityWeather data) => json.encode(data.toJson()); |
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 cityWeather = cityWeatherFromJson(jsonString); | |
//import 'package:meta/meta.dart'; | |
import 'dart:convert'; | |
CityWeather cityWeatherFromJson(String str) => CityWeather.fromJson(json.decode(str)); | |
String cityWeatherToJson(CityWeather data) => json.encode(data.toJson()); |
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 'package:http/http.dart' as http; | |
import 'package:http/http.dart'; | |
// | |
// | |
// https://api.openweathermap.org/data/2.5/weather?q=Bangkok&units=metric&appid=92f90171a9639b008090aa98c05df965 | |
Future<Response> getCityWeather({required String name}) async { | |
String endpoint = "https://api.openweathermap.org/data/2.5/weather?q=" + | |
name + |
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
target 'Runner' do | |
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '9.5.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
// elevate button | |
ElevatedButton( | |
child: const Text("Calculate BMI"), | |
onPressed: () { | |
double bmi = _weight / ((_height / 100) * (_height / 100)); | |
setState(() { | |
if (bmi < 18.5) { | |
_result = "Underweight"; | |
_color = Colors.lightBlue; | |
} else if (bmi < 25) { |
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
// add demo member | |
var timeStamp = new Date().getTime() * 1000; | |
auth | |
.createUser({ | |
email: "user@example.com", | |
emailVerified: true, | |
password: "demodemo", | |
disabled: false, | |
}) | |
.then((userRecord) => { |
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:http/http.dart' as http; | |
import 'package:mobile/models/product.dart'; | |
String baseUrl = "http://7fa6-2001-fb1-148-9046-b9ee-2df1-108f-68d8.ngrok.io"; | |
Map<String, String> headers = { | |
'Content-Type': 'application/json', | |
'Accept': 'application/json', |
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
#include <Arduino.h> | |
#include <BleMouse.h> | |
BleMouse bleMouse; | |
void setup() { | |
Serial.begin(115200); | |
Serial.println("Starting BLE work!"); | |
bleMouse.begin(); | |
} |
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
#include <Arduino.h> | |
#include <BleKeyboard.h> | |
BleKeyboard bleKeyboard; | |
void setup() { | |
Serial.begin(115200); | |
Serial.println("Starting BLE work!"); | |
bleKeyboard.begin(); | |
} |
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
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
automaticallyImplyLeading: false, | |
title: MainMenu(), | |
), | |
body: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
Container( |