From 0a809aa8ffd3f312986c728cc45dc631e9e56263 Mon Sep 17 00:00:00 2001 From: jhih_yu Date: Sun, 2 Jul 2023 14:48:31 +0800 Subject: [PATCH 01/11] [New] Layout color with name --- lib/setting.dart | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/lib/setting.dart b/lib/setting.dart index 645a9d5c..7a722ac8 100644 --- a/lib/setting.dart +++ b/lib/setting.dart @@ -19,6 +19,39 @@ class SettingPage extends StatefulWidget { } class _SettingPageState extends State { + final Map _colors = { + Colors.red: 'Red', + Colors.pink: 'Pink', + Colors.purple: 'Purple', + Colors.deepPurple: 'Deep Purple', + Colors.indigo: 'Indigo', + Colors.blue: 'Blue', + Colors.lightBlue: 'Light Blue', + Colors.cyan: 'Cyan', + Colors.teal: 'Teal', + Colors.green: 'Green', + Colors.lightGreen: 'Light Green', + Colors.lime: 'Lime', + Colors.yellow: 'Yellow', + Colors.amber: 'Amber', + Colors.orange: 'Orange', + Colors.deepOrange: 'Deep Orange', + Colors.brown: 'Brown', + Colors.grey: 'Grey', + Colors.blueGrey: 'Blue Grey', + }; + String colorString(Color color) { + String colorHashCode(Color color) { + return color.toString().replaceAll('Color(0xff', '').replaceAll('MaterialColor(primary value: ', '').replaceAll('ColorSwatch(primary value: ', '').replaceAll(')', ''); + } + for (MapEntry entry in _colors.entries) { + if (colorHashCode(entry.key) == colorHashCode(color)) { + return entry.value; + } + } + return colorHashCode(color); + } + @override Widget build(BuildContext context) { int themeMode = Provider.of(context, listen: true).themeMode; @@ -92,7 +125,7 @@ class _SettingPageState extends State { ListTile( leading: const Icon(Icons.color_lens), title: const Text('Theme Color'), - subtitle: Text('#${themeColor.toString().replaceAll('Color(0xff', '').replaceAll('MaterialColor(primary value: ', '').replaceAll('ColorSwatch(primary value: ', '').replaceAll(')', '')}'), + subtitle: Text(colorString(themeColor)), trailing: InkWell( borderRadius: BorderRadius.circular(16), child: Container( @@ -113,6 +146,7 @@ class _SettingPageState extends State { content: SingleChildScrollView( physics: const BouncingScrollPhysics(), child: BlockPicker( + availableColors: _colors.keys.toList(), pickerColor: themeColor, onColorChanged: (color) { setState(() { From 3e800a23e44cb660c8d674097e9c8bcd738fd59b Mon Sep 17 00:00:00 2001 From: jhih_yu Date: Sun, 2 Jul 2023 15:21:19 +0800 Subject: [PATCH 02/11] [New] Add Custom Slide Transition --- lib/widget/slide_transition.dart | 61 ++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 lib/widget/slide_transition.dart diff --git a/lib/widget/slide_transition.dart b/lib/widget/slide_transition.dart new file mode 100644 index 00000000..8b3b8261 --- /dev/null +++ b/lib/widget/slide_transition.dart @@ -0,0 +1,61 @@ +import 'package:flutter/material.dart'; + +class CustomSlideTransition extends AnimatedWidget { + CustomSlideTransition({ + Key? key, + required Animation position, + this.transformHitTests = true, + this.direction = AxisDirection.down, + required this.child, + }) : super(key: key, listenable: position) { + switch (direction) { + case AxisDirection.up: + _tween = Tween(begin: const Offset(0, 1), end: const Offset(0, 0)); + break; + case AxisDirection.right: + _tween = Tween(begin: const Offset(-1, 0), end: const Offset(0, 0)); + break; + case AxisDirection.down: + _tween = Tween(begin: const Offset(0, -1), end: const Offset(0, 0)); + break; + case AxisDirection.left: + _tween = Tween(begin: const Offset(1, 0), end: const Offset(0, 0)); + break; + } + } + + final bool transformHitTests; + + final Widget child; + + final AxisDirection direction; + + late final Tween _tween; + + @override + Widget build(BuildContext context) { + final position = listenable as Animation; + Offset offset = _tween.evaluate(position); + if (position.status == AnimationStatus.reverse) { + switch (direction) { + case AxisDirection.up: + offset = Offset(offset.dx, -offset.dy); + break; + case AxisDirection.right: + offset = Offset(-offset.dx, offset.dy); + break; + case AxisDirection.down: + offset = Offset(offset.dx, -offset.dy); + break; + case AxisDirection.left: + offset = Offset(-offset.dx, offset.dy); + break; + } + } + return FractionalTranslation( + translation: offset, + transformHitTests: transformHitTests, + child: child, + ); + } +} \ No newline at end of file From 3a14a27fcd4eca347de5e6ce560af4bc9c2af3ea Mon Sep 17 00:00:00 2001 From: jhih_yu Date: Thu, 27 Jul 2023 18:19:36 +0800 Subject: [PATCH 03/11] [Upgrade] Package --- pubspec.lock | 210 +++++++++++++++++++++++++-------------------------- pubspec.yaml | 2 +- 2 files changed, 102 insertions(+), 110 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index e020e61c..348ec4e5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: a742f71d7f3484253a623b30e19256aa4668ecbb3de6ad1beb0bcf8d4777ecd8 + sha256: "5dce45a06d386358334eb1689108db6455d90ceb0d75848d5f4819283d4ee2b8" url: "https://pub.dev" source: hosted - version: "1.3.3" + version: "1.3.4" animated_text_kit: dependency: "direct main" description: @@ -101,26 +101,26 @@ packages: dependency: "direct main" description: name: cloud_firestore - sha256: "988351d4fcc58c47578d95d014018888b2ce7a228f84ce322fea4a127707a0d4" + sha256: f1a06ad4499ed9ab73703560d44893e6b9e66ce3923c9121f4ef3981c972057f url: "https://pub.dev" source: hosted - version: "4.8.1" + version: "4.8.4" cloud_firestore_platform_interface: dependency: transitive description: name: cloud_firestore_platform_interface - sha256: b6652ce95507e604f00cb0c9c9be2363d21746e82667f2f3d61edf2d33cad3bf + sha256: "86bd1865abbeb09a7d09da3e70364a09f894937270651fc611a1c6d6a9f7b02c" url: "https://pub.dev" source: hosted - version: "5.15.1" + version: "5.15.3" cloud_firestore_web: dependency: transitive description: name: cloud_firestore_web - sha256: "22d02595eb7a304c0f1b4a717e78cc054522e8f237eb7b1122886f93130f3f7a" + sha256: ac2eeb2a7ab1928c3aacc30eed750fa839d6f620e112a5459e321df217be2f47 url: "https://pub.dev" source: hosted - version: "3.6.1" + version: "3.6.3" collection: dependency: transitive description: @@ -181,10 +181,10 @@ packages: dependency: transitive description: name: dio - sha256: a9d76e72985d7087eb7c5e7903224ae52b337131518d127c554b9405936752b8 + sha256: "3866d67f93523161b643187af65f5ac08bc991a5bcdaf41a2d587fe4ccb49993" url: "https://pub.dev" source: hosted - version: "5.2.1+1" + version: "5.3.0" email_validator: dependency: transitive description: @@ -229,90 +229,90 @@ packages: dependency: transitive description: name: file_selector_linux - sha256: d17c5e450192cdc40b718804dfb4eaf79a71bed60ee9530703900879ba50baa3 + sha256: "770eb1ab057b5ae4326d1c24cc57710758b9a46026349d021d6311bd27580046" url: "https://pub.dev" source: hosted - version: "0.9.1+3" + version: "0.9.2" file_selector_macos: dependency: transitive description: name: file_selector_macos - sha256: "6290eec24fc4cc62535fe609e0c6714d3c1306191dc8c3b0319eaecc09423a3a" + sha256: "4ada532862917bf16e3adb3891fe3a5917a58bae03293e497082203a80909412" url: "https://pub.dev" source: hosted - version: "0.9.2" + version: "0.9.3+1" file_selector_platform_interface: dependency: transitive description: name: file_selector_platform_interface - sha256: "2a7f4bbf7bd2f022ecea85bfb1754e87f7dd403a9abc17a84a4fa2ddfe2abc0a" + sha256: "412705a646a0ae90f33f37acfae6a0f7cbc02222d6cd34e479421c3e74d3853c" url: "https://pub.dev" source: hosted - version: "2.5.1" + version: "2.6.0" file_selector_windows: dependency: transitive description: name: file_selector_windows - sha256: ef246380b66d1fb9089fc65622c387bf3780bca79f533424c31d07f12c2c7fd8 + sha256: "1372760c6b389842b77156203308940558a2817360154084368608413835fc26" url: "https://pub.dev" source: hosted - version: "0.9.2" + version: "0.9.3" firebase_app_check: dependency: "direct main" description: name: firebase_app_check - sha256: d4dd83e8c8d5941751423916388a9f755a56235cc4ed71ea17c0360cbfc20f30 + sha256: "9ed115cea8828a6c5b3f9f8a451177f2024587f3c18490e48924c0547a5436b3" url: "https://pub.dev" source: hosted - version: "0.1.4+3" + version: "0.1.5+1" firebase_app_check_platform_interface: dependency: transitive description: name: firebase_app_check_platform_interface - sha256: "5db716826759410d9afe048b63e8452a1b4f899eeabb8bc28d02492b8eec2f74" + sha256: "09bfbebef7905f303f77e57c01cb48b9136ff660f8d2115d86807cff3e3074b6" url: "https://pub.dev" source: hosted - version: "0.0.8+3" + version: "0.0.9+1" firebase_app_check_web: dependency: transitive description: name: firebase_app_check_web - sha256: "624994394cf9be486b69f3b297707d24d394aca0c1557f09d97c519c4ad74c27" + sha256: ef71760ce624c18e5bca8ac0156c695da921bedaee83f1472b8f8c3670fea4fb url: "https://pub.dev" source: hosted - version: "0.0.10+3" + version: "0.0.11+1" firebase_auth: dependency: "direct main" description: name: firebase_auth - sha256: f693c0aa998b1101453878951b171b69f0db5199003df1c943b33493a1de7917 + sha256: "49fd35ce06f2530dd460e5dc123235731cb61dd7c76b0af4b6e190404880d04d" url: "https://pub.dev" source: hosted - version: "4.6.3" + version: "4.7.2" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface - sha256: "689ae048b78ad088ba31acdec45f5badb56201e749ed8b534947a7303ddb32aa" + sha256: "817f3ceb84ef5e9adaaf50cf7a19255f6ffcdd12c6f9e9aa4cf00fc7f2eb3cfb" url: "https://pub.dev" source: hosted - version: "6.15.3" + version: "6.16.1" firebase_auth_web: dependency: transitive description: name: firebase_auth_web - sha256: f35d637a1707afd51f30090bb5234b381d5071ccbfef09b8c393bc7c65e440cd + sha256: e9044778287f1ff8f9f4cee7e247b03ec87bb8977e0e65ad27dc337e196132e8 url: "https://pub.dev" source: hosted - version: "5.5.3" + version: "5.6.2" firebase_core: dependency: "direct main" description: name: firebase_core - sha256: a4a99204da264a0aa9d54a332ea0315ce7b0768075139c77abefe98093dd98be + sha256: "2e9324f719e90200dc7d3c4f5d2abc26052f9f2b995d3b6626c47a0dfe1c8192" url: "https://pub.dev" source: hosted - version: "2.14.0" + version: "2.15.0" firebase_core_platform_interface: dependency: transitive description: @@ -333,50 +333,50 @@ packages: dependency: "direct main" description: name: firebase_database - sha256: "36699bda00feb31433606f034078c690f148c15a4721b351a83c796ba4bba4e7" + sha256: "08eff8d3321973f73f94633d807fb1f4589b4e2d2e0c33c7e656f42d2f9eba72" url: "https://pub.dev" source: hosted - version: "10.2.3" + version: "10.2.4" firebase_database_platform_interface: dependency: transitive description: name: firebase_database_platform_interface - sha256: "8bd62f80b51d71a81087a33fe2e2a868fb818a6e33b319a137a7bcb35dec262d" + sha256: db95e96b27c6d8ee4e1daf9ee7ff0e7433c5c340f9cfb5d855e65cbdb7430b9c url: "https://pub.dev" source: hosted - version: "0.2.5+3" + version: "0.2.5+4" firebase_database_web: dependency: transitive description: name: firebase_database_web - sha256: "05e6b0c2a192569cd5ce2be4a708756ca9f56e4c7b6fe1916f0f9d96a826f235" + sha256: "1ae57beac0a002d0a778bcde569c3fad2457b7ca3d9ef2936287e562d0af6962" url: "https://pub.dev" source: hosted - version: "0.2.3+3" + version: "0.2.3+4" firebase_dynamic_links: dependency: transitive description: name: firebase_dynamic_links - sha256: "9b984d0abd227a702451a997abcca763f4dbf67e260dad60e5506d55e3eff244" + sha256: "4872f4d7e94736041398bc3490c2ddd87ee159d6b051ba01ca2708e5260a7ebe" url: "https://pub.dev" source: hosted - version: "5.3.3" + version: "5.3.4" firebase_dynamic_links_platform_interface: dependency: transitive description: name: firebase_dynamic_links_platform_interface - sha256: "6ef00a0be18f3231e9727f7c4b31db89dbfa16792098beb850603c30854560ff" + sha256: "946fccfefb67e26bf63e392f1b3917d79ea031d3071488f0c5e8ab72de8219ab" url: "https://pub.dev" source: hosted - version: "0.2.6+3" + version: "0.2.6+4" firebase_ui_auth: dependency: "direct main" description: name: firebase_ui_auth - sha256: "97fc61ac046c105c4292d1170bcc16a76f9f72de0e98afb44547c29ba69078a4" + sha256: e439571fcad7ed48450eed8d64c70b93765526b876327055469806a51101eff0 url: "https://pub.dev" source: hosted - version: "1.4.3" + version: "1.6.2" firebase_ui_localizations: dependency: transitive description: @@ -389,34 +389,34 @@ packages: dependency: transitive description: name: firebase_ui_oauth - sha256: "4c55c00b92dcebeedd60914833f64a1211e7495725222e5189441c000d8563dd" + sha256: "2cbe5a8996134f1a57205a5ebfa5863c5d599c03a07aae70867de2ecdfbbde0e" url: "https://pub.dev" source: hosted - version: "1.4.3" + version: "1.4.7" firebase_ui_oauth_facebook: dependency: "direct main" description: name: firebase_ui_oauth_facebook - sha256: "7aca3d1b6e4d88529af21eda4fe2127f97796dbbf886e7f1c275dd67d55c5b6f" + sha256: "638acc35f039a9c581b336a28d66e257b964edbe6b6a913d5bb9a0530fb32f26" url: "https://pub.dev" source: hosted - version: "1.2.3" + version: "1.2.7" firebase_ui_oauth_google: dependency: "direct main" description: name: firebase_ui_oauth_google - sha256: "9e24bd75ebdf8fb7248f8a2981743ac46f34b72266a8f9bf5d7f724e6c33af3c" + sha256: "0e255ced67023871040b3d349c966a281a54ce1a093128733ccbd0a6b00a95d1" url: "https://pub.dev" source: hosted - version: "1.2.3" + version: "1.2.7" firebase_ui_oauth_twitter: dependency: "direct main" description: name: firebase_ui_oauth_twitter - sha256: "42e803c93fb42ff607a70ef1de3ec94b332f9a009fbc59d0d251492569bfa10f" + sha256: "7ad65636f6c3806cafdc6b51c53f3060630b9155dcc95c7c258795b45ef3b494" url: "https://pub.dev" source: hosted - version: "1.2.3" + version: "1.2.7" firebase_ui_shared: dependency: transitive description: @@ -506,10 +506,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" flutter_localizations: dependency: transitive description: flutter @@ -519,10 +519,10 @@ packages: dependency: "direct main" description: name: flutter_markdown - sha256: dc6d5258653f6857135b32896ccda7f7af0c54dcec832495ad6835154c6c77c0 + sha256: "4b1bfbb802d76320a1a46d9ce984106135093efd9d969765d07c2125af107bdf" url: "https://pub.dev" source: hosted - version: "0.6.15" + version: "0.6.17" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -633,10 +633,10 @@ packages: dependency: transitive description: name: google_sign_in_android - sha256: f58a17ac07d783d000786a6c313fa4a0d2ee599a346d69b24fc48fb378d5d150 + sha256: "8d60a787b29cb7d2bcf29230865f4a91f17323c6ac5b6b9027a6418e48d9ffc3" url: "https://pub.dev" source: hosted - version: "6.1.16" + version: "6.1.18" google_sign_in_ios: dependency: transitive description: @@ -705,18 +705,18 @@ packages: dependency: "direct main" description: name: image_picker - sha256: b6951e25b795d053a6ba03af5f710069c99349de9341af95155d52665cb4607c + sha256: "6296e98782726d37f59663f0727d0e978eee1ced1ffed45ccaba591786a7f7b3" url: "https://pub.dev" source: hosted - version: "0.8.9" + version: "1.0.1" image_picker_android: dependency: transitive description: name: image_picker_android - sha256: "216dbfb6609e46f78613b8913d046a162588ad4f34909ae7bf85e9f94ea6d922" + sha256: "8179b54039b50eee561676232304f487602e2950ffb3e8995ed9034d6505ca34" url: "https://pub.dev" source: hosted - version: "0.8.7" + version: "0.8.7+4" image_picker_for_web: dependency: transitive description: @@ -753,10 +753,10 @@ packages: dependency: transitive description: name: image_picker_platform_interface - sha256: "7c7b96bb9413a9c28229e717e6fd1e3edd1cc5569c1778fcca060ecf729b65ee" + sha256: c1134543ae2187e85299996d21c526b2f403854994026d575ae4cf30d7bb2a32 url: "https://pub.dev" source: hosted - version: "2.8.0" + version: "2.9.0" image_picker_windows: dependency: transitive description: @@ -817,10 +817,10 @@ packages: dependency: transitive description: name: markdown - sha256: "8e332924094383133cee218b676871f42db2514f1f6ac617b6cf6152a7faab8e" + sha256: acf35edccc0463a9d7384e437c015a3535772e09714cf60e07eeef3a15870dcd url: "https://pub.dev" source: hosted - version: "7.1.0" + version: "7.1.1" matcher: dependency: transitive description: @@ -929,10 +929,10 @@ packages: dependency: transitive description: name: path_provider_foundation - sha256: "1995d88ec2948dac43edf8fe58eb434d35d22a2940ecee1a9fefcd62beee6eb3" + sha256: "916731ccbdce44d545414dd9961f26ba5fbaa74bcbb55237d8e65a623a8c7297" url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.2.4" path_provider_linux: dependency: transitive description: @@ -977,10 +977,10 @@ packages: dependency: transitive description: name: plugin_platform_interface - sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" pointycastle: dependency: transitive description: @@ -989,14 +989,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.7.3" - process: - dependency: transitive - description: - name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" - url: "https://pub.dev" - source: hosted - version: "4.2.4" provider: dependency: "direct main" description: @@ -1049,58 +1041,58 @@ packages: dependency: "direct main" description: name: shared_preferences - sha256: "396f85b8afc6865182610c0a2fc470853d56499f75f7499e2a73a9f0539d23d0" + sha256: "0344316c947ffeb3a529eac929e1978fcd37c26be4e8468628bac399365a3ca1" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.2.0" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "6478c6bbbecfe9aced34c483171e90d7c078f5883558b30ec3163cf18402c749" + sha256: fe8401ec5b6dcd739a0fe9588802069e608c3fdbfd3c3c93e546cf2f90438076 url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: e014107bb79d6d3297196f4f2d0db54b5d1f85b8ea8ff63b8e8b391a02700feb + sha256: f39696b83e844923b642ce9dd4bd31736c17e697f6731a5adf445b1274cf3cd4 url: "https://pub.dev" source: hosted - version: "2.2.2" + version: "2.3.2" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - sha256: "9d387433ca65717bbf1be88f4d5bb18f10508917a8fa2fb02e0fd0d7479a9afa" + sha256: "71d6806d1449b0a9d4e85e0c7a917771e672a3d5dc61149cc9fac871115018e1" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.3.0" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - sha256: fb5cf25c0235df2d0640ac1b1174f6466bd311f621574997ac59018a6664548d + sha256: "23b052f17a25b90ff2b61aad4cc962154da76fb62848a9ce088efe30d7c50ab1" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.3.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - sha256: "74083203a8eae241e0de4a0d597dbedab3b8fef5563f33cf3c12d7e93c655ca5" + sha256: "7347b194fb0bbeb4058e6a4e87ee70350b6b2b90f8ac5f8bd5b3a01548f6d33a" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.2.0" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - sha256: "5e588e2efef56916a3b229c3bfe81e6a525665a454519ca51dbcc4236a274173" + sha256: f95e6a43162bce43c9c3405f3eb6f39e5b5d11f65fab19196cf8225e2777624d url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.3.0" sky_engine: dependency: transitive description: flutter @@ -1214,18 +1206,18 @@ packages: dependency: "direct main" description: name: url_launcher - sha256: eb1e00ab44303d50dd487aab67ebc575456c146c6af44422f9c13889984c00f3 + sha256: "781bd58a1eb16069412365c98597726cd8810ae27435f04b3b4d3a470bacd61e" url: "https://pub.dev" source: hosted - version: "6.1.11" + version: "6.1.12" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: eed4e6a1164aa9794409325c3b707ff424d4d1c2a785e7db67f8bbda00e36e51 + sha256: "78cb6dea3e93148615109e58e42c35d1ffbf5ef66c44add673d0ab75f12ff3af" url: "https://pub.dev" source: hosted - version: "6.0.35" + version: "6.0.37" url_launcher_ios: dependency: transitive description: @@ -1246,34 +1238,34 @@ packages: dependency: transitive description: name: url_launcher_macos - sha256: "91ee3e75ea9dadf38036200c5d3743518f4a5eb77a8d13fda1ee5764373f185e" + sha256: "1c4fdc0bfea61a70792ce97157e5cc17260f61abbe4f39354513f39ec6fd73b1" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.6" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - sha256: "6c9ca697a5ae218ce56cece69d46128169a58aa8653c1b01d26fcd4aad8c4370" + sha256: bfdfa402f1f3298637d71ca8ecfe840b4696698213d5346e9d12d4ab647ee2ea url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" url_launcher_web: dependency: transitive description: name: url_launcher_web - sha256: "6bb1e5d7fe53daf02a8fee85352432a40b1f868a81880e99ec7440113d5cfcab" + sha256: cc26720eefe98c1b71d85f9dc7ef0cada5132617046369d9dc296b3ecaa5cbb4 url: "https://pub.dev" source: hosted - version: "2.0.17" + version: "2.0.18" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: "254708f17f7c20a9c8c471f67d86d76d4a3f9c1591aad1e15292008aceb82771" + sha256: "7967065dd2b5fccc18c653b97958fdf839c5478c28e767c61ee879f4e7882422" url: "https://pub.dev" source: hosted - version: "3.0.6" + version: "3.0.7" vector_graphics: dependency: transitive description: @@ -1310,18 +1302,18 @@ packages: dependency: transitive description: name: win32 - sha256: "7dacfda1edcca378031db9905ad7d7bd56b29fd1a90b0908b71a52a12c41e36b" + sha256: f2add6fa510d3ae152903412227bda57d0d5a8da61d2c39c1fb022c9429a41c0 url: "https://pub.dev" source: hosted - version: "5.0.3" + version: "5.0.6" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1 + sha256: e0b1147eec179d3911f1f19b59206448f78195ca1d20514134e10641b7d7fbff url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.1" xml: dependency: transitive description: @@ -1340,4 +1332,4 @@ packages: version: "3.1.2" sdks: dart: ">=3.0.0 <4.0.0" - flutter: ">=3.7.0" + flutter: ">=3.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index 20a745e2..1a94954d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -23,7 +23,7 @@ dependencies: flutter_colorpicker: ^1.0.3 provider: ^6.0.5 qr_flutter: ^4.0.0 - image_picker: ^0.8.6+1 + image_picker: ^1.0.1 three_dart: ^0.0.16 three_dart_jsm: ^0.0.10 flutter_gl: ^0.0.21 From 9a47f9affea46537032bf685d76b57ac63b15f64 Mon Sep 17 00:00:00 2001 From: jhih_yu Date: Thu, 27 Jul 2023 18:21:28 +0800 Subject: [PATCH 04/11] [Fix] Error A value of type 'String?' can't be assigned to a variable of type 'String'. --- lib/pages/long_url.dart | 4 ++-- lib/pages/short_url.dart | 4 ++-- lib/pages/vpn.dart | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pages/long_url.dart b/lib/pages/long_url.dart index 1b882c6d..a835c552 100644 --- a/lib/pages/long_url.dart +++ b/lib/pages/long_url.dart @@ -57,9 +57,9 @@ class _LongURLPageState extends State { FirebaseAuth auth = FirebaseAuth.instance; User user = auth.currentUser!; String uid = user.uid; - String token = await user.getIdToken(); + String? token = await user.getIdToken(); await http - .post(lURLServerCreate, body: jsonEncode({'firebase_uid': uid, 'original_url': lURLURLController.text}), headers: {'Content-Type': 'application/json', 'X-Firebase-AppCheck': token}) + .post(lURLServerCreate, body: jsonEncode({'firebase_uid': uid, 'original_url': lURLURLController.text}), headers: {'Content-Type': 'application/json', 'X-Firebase-AppCheck': token ?? ''}) .then((value) => { setState(() { _lurl = jsonDecode(value.body)['url']; diff --git a/lib/pages/short_url.dart b/lib/pages/short_url.dart index 5284f70d..3e916e53 100644 --- a/lib/pages/short_url.dart +++ b/lib/pages/short_url.dart @@ -52,12 +52,12 @@ class _ShortURLPageState extends State { FirebaseAuth auth = FirebaseAuth.instance; User user = auth.currentUser!; String uid = user.uid; - String token = await user.getIdToken(); + String? token = await user.getIdToken(); await http .post( sURLServerCreate, body: jsonEncode({'firebase_uid': uid, 'original_url': sURLURLController.text}), - headers: {'Content-Type': 'application/json', 'X-Firebase-AppCheck': token}, + headers: {'Content-Type': 'application/json', 'X-Firebase-AppCheck': token ?? ''}, ) .then((value) => { setState(() { diff --git a/lib/pages/vpn.dart b/lib/pages/vpn.dart index 98c900d7..3a260009 100644 --- a/lib/pages/vpn.dart +++ b/lib/pages/vpn.dart @@ -109,7 +109,7 @@ class _VPNPageState extends State { FirebaseAuth auth = FirebaseAuth.instance; User user = auth.currentUser!; String uid = user.uid; - String token = await user.getIdToken(); + String? token = await user.getIdToken(); // print(uid); // print(token); // print(serverId); From 75f6bd09b2a7f45076d48474fcb3dc906da791fb Mon Sep 17 00:00:00 2001 From: jhih_yu Date: Thu, 27 Jul 2023 19:13:25 +0800 Subject: [PATCH 05/11] [New] Add map search title --- lib/pages/zhsh_3d_map.dart | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/pages/zhsh_3d_map.dart b/lib/pages/zhsh_3d_map.dart index a79e5f39..e74dc016 100644 --- a/lib/pages/zhsh_3d_map.dart +++ b/lib/pages/zhsh_3d_map.dart @@ -2084,6 +2084,23 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM clipBehavior: Clip.antiAlias, child: Column( children: [ + Offstage( + offstage: _searchSelected == true || _searchResult.isEmpty, + child: const Column( + children: [ + SizedBox( + height: 10, + ), + ListTile( + leading: IconButton( + icon: Icon(Icons.search), + onPressed: null, + ), + title: Text('搜尋結果'), + ), + ] + ), + ), Offstage( offstage: _notFound == true || _searchSelected == true, child: Container( From a18504b4b0842df77dbd076982fb942b5fee96ec Mon Sep 17 00:00:00 2001 From: jhih_yu Date: Thu, 27 Jul 2023 19:23:00 +0800 Subject: [PATCH 06/11] [New] keyword of map --- lib/pages/zhsh_3d_map.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/zhsh_3d_map.dart b/lib/pages/zhsh_3d_map.dart index e74dc016..726eac9e 100644 --- a/lib/pages/zhsh_3d_map.dart +++ b/lib/pages/zhsh_3d_map.dart @@ -419,7 +419,7 @@ const Map settingData = { 'build5_4f_aisle2': {'name': '謙融樓4F側郎', 'searchable': false}, 'build5_5f_room1': { 'name': '星象館', - 'keyword': ['天文館', '望遠鏡'] + 'keyword': ['天文', '天文館', '天文臺', '天文台', '望遠鏡'] }, 'build5_5f_room1_###1': {'name': '星象館上層', 'searchable': false}, 'build5_5f_room1_###2': {'name': '星象館頂部半球體', 'searchable': false}, From ebbbdae0c9ba4922afda113b69181b1021c196cc Mon Sep 17 00:00:00 2001 From: jhih_yu Date: Thu, 27 Jul 2023 20:18:07 +0800 Subject: [PATCH 07/11] [Format] --- lib/firebase_options.dart | 6 +- lib/home.dart | 12 +- lib/main.dart | 40 +- lib/pages/about.dart | 97 +- lib/pages/bmi.dart | 21 +- lib/pages/chat.dart | 327 +- lib/pages/chat_ai.dart | 113 +- lib/pages/clock.dart | 8 +- lib/pages/contact.dart | 20 +- lib/pages/load_failed.dart | 11 +- lib/pages/long_url.dart | 125 +- lib/pages/privacy_policy.dart | 6 +- lib/pages/profile.dart | 7 +- lib/pages/qr_generator.dart | 96 +- lib/pages/short_url.dart | 32 +- lib/pages/sign_in.dart | 34 +- lib/pages/spin_wheel.dart | 102 +- lib/pages/status.dart | 14 +- lib/pages/terms_of_service.dart | 6 +- lib/pages/timer.dart | 105 +- lib/pages/tw_university_result_query.dart | 89 +- lib/pages/url_launcher.dart | 14 +- lib/pages/vpn.dart | 91 +- lib/pages/zhsh_3d_map.dart | 3289 ++++++++++++++++++--- lib/provider/theme.dart | 6 +- lib/setting.dart | 78 +- lib/tool.dart | 6 +- lib/widget/image.dart | 17 +- lib/widget/launch_url.dart | 3 +- lib/widget/linear_progress_indicator.dart | 6 +- lib/widget/scaffold_messenger.dart | 3 +- lib/widget/slide_transition.dart | 2 +- 32 files changed, 3968 insertions(+), 818 deletions(-) diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart index f5cbf2b7..32208cc7 100644 --- a/lib/firebase_options.dart +++ b/lib/firebase_options.dart @@ -1,7 +1,8 @@ // File generated by FlutterFire CLI. // ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; -import 'package:flutter/foundation.dart' show defaultTargetPlatform, kIsWeb, TargetPlatform; +import 'package:flutter/foundation.dart' + show defaultTargetPlatform, kIsWeb, TargetPlatform; /// Default [FirebaseOptions] for use with your Firebase apps. /// @@ -57,7 +58,8 @@ class DefaultFirebaseOptions { messagingSenderId: '897798864282', projectId: 'webpage-349c7', authDomain: 'auth.jhihyulin.live', - databaseURL: 'https://webpage-349c7-default-rtdb.asia-southeast1.firebasedatabase.app', + databaseURL: + 'https://webpage-349c7-default-rtdb.asia-southeast1.firebasedatabase.app', storageBucket: 'webpage-349c7.appspot.com', measurementId: 'G-JDZTQWRMLT', ); diff --git a/lib/home.dart b/lib/home.dart index 54502937..89968a0c 100644 --- a/lib/home.dart +++ b/lib/home.dart @@ -16,7 +16,11 @@ class HomePage extends StatelessWidget { padding: const EdgeInsets.all(20), constraints: BoxConstraints( //maxWidth: 700, - minHeight: MediaQuery.of(context).size.height - AppBar().preferredSize.height - (MediaQuery.of(context).size.width > 700 ? 0 : 80), //NavigationBar Height + minHeight: MediaQuery.of(context).size.height - + AppBar().preferredSize.height - + (MediaQuery.of(context).size.width > 700 + ? 0 + : 80), //NavigationBar Height ), child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -34,7 +38,8 @@ class HomePage extends StatelessWidget { speed: const Duration(milliseconds: 200), textStyle: TextStyle( // fontFamily: GoogleFonts.firaCode().fontFamily, - fontSize: Theme.of(context).textTheme.displayLarge?.fontSize, + fontSize: + Theme.of(context).textTheme.displayLarge?.fontSize, ), cursor: '|', ), @@ -44,7 +49,8 @@ class HomePage extends StatelessWidget { speed: const Duration(milliseconds: 50), textStyle: TextStyle( fontFamily: GoogleFonts.firaCode().fontFamily, - fontSize: Theme.of(context).textTheme.displaySmall?.fontSize, + fontSize: + Theme.of(context).textTheme.displaySmall?.fontSize, ), cursor: '|', ), diff --git a/lib/main.dart b/lib/main.dart index 1fab93c8..25a7041e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -28,7 +28,8 @@ import '../pages/qr_generator.dart' deferred as qr_generator; import '../pages/clock.dart' deferred as clock; import '../pages/zhsh_3d_map.dart' deferred as zhsh_3d_map; import '../pages/not_found.dart' deferred as not_found; -import '../pages/tw_university_result_query.dart' deferred as tw_university_result_query; +import '../pages/tw_university_result_query.dart' + deferred as tw_university_result_query; import '../pages/spin_wheel.dart' deferred as spin_wheel; import '../pages/privacy_policy.dart' deferred as privacy_policy; import '../pages/terms_of_service.dart' deferred as terms_of_service; @@ -50,7 +51,9 @@ void main() async { webRecaptchaSiteKey: '6LcPhjgkAAAAAAUtPybk3GHCkYZTxDd6w4kVOiQJ', ); // Load IanSui Font - await CustomLoadFont.loadFont('https://raw.githubusercontent.com/ButTaiwan/iansui/main/Iansui-Regular.ttf', 'IanSui'); + await CustomLoadFont.loadFont( + 'https://raw.githubusercontent.com/ButTaiwan/iansui/main/Iansui-Regular.ttf', + 'IanSui'); usePathUrlStrategy(); runApp(const MyApp()); } @@ -63,7 +66,8 @@ class MyApp extends StatefulWidget { } class _MyAppState extends State { - Widget Function(BuildContext) loadPage(Future Function() loadLibrary, Widget Function(BuildContext) page) { + Widget Function(BuildContext) loadPage( + Future Function() loadLibrary, Widget Function(BuildContext) page) { return (BuildContext context) => FutureBuilder( future: loadLibrary(), builder: (BuildContext context, AsyncSnapshot snapshot) { @@ -229,14 +233,18 @@ class _MyAppState extends State { break; case '/twuniversityresultquery': if (parameters != null) { - builder = loadPage(tw_university_result_query.loadLibrary, (context) { - return tw_university_result_query.TWUniversityResultQueryPage( + builder = loadPage(tw_university_result_query.loadLibrary, + (context) { + return tw_university_result_query + .TWUniversityResultQueryPage( id: parameters!['id'] ?? '', ); }); } else { - builder = loadPage(tw_university_result_query.loadLibrary, (context) { - return tw_university_result_query.TWUniversityResultQueryPage(); + builder = loadPage(tw_university_result_query.loadLibrary, + (context) { + return tw_university_result_query + .TWUniversityResultQueryPage(); }); } break; @@ -266,7 +274,8 @@ class _MyAppState extends State { }); break; case '/': - builder = (BuildContext context) => const NavigationController(); + builder = + (BuildContext context) => const NavigationController(); break; default: builder = loadPage(not_found.loadLibrary, (context) { @@ -444,20 +453,27 @@ class _NavigationControllerState extends State { ), bottomNavigationBar: MediaQuery.of(context).size.width < desktopModeWidth ? NavigationBar( - labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected, + labelBehavior: + NavigationDestinationLabelBehavior.onlyShowSelected, selectedIndex: _currentIndex, onDestinationSelected: _onItemClick, destinations: [ NavigationDestination( - icon: _currentIndex == 0 ? const Icon(Icons.home) : const Icon(Icons.home_outlined), + icon: _currentIndex == 0 + ? const Icon(Icons.home) + : const Icon(Icons.home_outlined), label: 'Home', ), NavigationDestination( - icon: _currentIndex == 1 ? const Icon(Icons.build) : const Icon(Icons.build_outlined), + icon: _currentIndex == 1 + ? const Icon(Icons.build) + : const Icon(Icons.build_outlined), label: 'Tool', ), NavigationDestination( - icon: _currentIndex == 2 ? const Icon(Icons.settings) : const Icon(Icons.settings_outlined), + icon: _currentIndex == 2 + ? const Icon(Icons.settings) + : const Icon(Icons.settings_outlined), label: 'Setting', ), ], diff --git a/lib/pages/about.dart b/lib/pages/about.dart index ae940105..070be035 100644 --- a/lib/pages/about.dart +++ b/lib/pages/about.dart @@ -164,7 +164,8 @@ class _AboutPageState extends State { bool _ghLoaded = false; getGitHubPinnedRepo() async { - var uri = Uri.parse('https://gh-pinned-repos.egoist.dev/?username=jhihyulin'); + var uri = + Uri.parse('https://gh-pinned-repos.egoist.dev/?username=jhihyulin'); http.get(uri).then((response) { var data = jsonDecode(response.body); setState(() { @@ -195,7 +196,10 @@ class _AboutPageState extends State { padding: const EdgeInsets.all(20), constraints: BoxConstraints( maxWidth: 700, - minHeight: MediaQuery.of(context).size.height - AppBar().preferredSize.height - MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.bottom, + minHeight: MediaQuery.of(context).size.height - + AppBar().preferredSize.height - + MediaQuery.of(context).padding.top - + MediaQuery.of(context).padding.bottom, ), child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -270,7 +274,9 @@ class _AboutPageState extends State { }, leading: const Icon(Icons.school), title: const Text("Education"), - subtitle: _isExpanded ? null : Text(school.keys.first), + subtitle: _isExpanded + ? null + : Text(school.keys.first), children: [ for (var key in school.keys) ListTile( @@ -287,7 +293,8 @@ class _AboutPageState extends State { if (school[key]!['part'] != null) SizedBox( width: double.infinity, - child: Text(school[key]!['part']!), + child: + Text(school[key]!['part']!), ), SizedBox( width: double.infinity, @@ -299,7 +306,8 @@ class _AboutPageState extends State { ], ), onTap: () { - CustomLaunchUrl.launch(context, school[key]!['url']!); + CustomLaunchUrl.launch( + context, school[key]!['url']!); }, ), ], @@ -350,20 +358,25 @@ class _AboutPageState extends State { children: [ for (var key in _pinnedData) SizedBox( - width: _isDesktop(context) ? 320 : double.infinity, + width: + _isDesktop(context) ? 320 : double.infinity, height: 160, child: CustomCard( child: InkWell( borderRadius: BorderRadius.circular(16), - onTap: () => CustomLaunchUrl.launch(context, key['link']), + onTap: () => CustomLaunchUrl.launch( + context, key['link']), child: Container( padding: const EdgeInsets.all(20), child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Row( children: [ @@ -374,7 +387,9 @@ class _AboutPageState extends State { Text( '${key['repo']}', style: TextStyle( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context) + .colorScheme + .onBackground, ), maxLines: 1, ), @@ -384,15 +399,23 @@ class _AboutPageState extends State { height: 10, ), Offstage( - offstage: key['description'] == null, + offstage: + key['description'] == null, child: Column( children: [ Text( - utf8.decode(key['description'].toString().codeUnits), + utf8.decode( + key['description'] + .toString() + .codeUnits), maxLines: 2, - overflow: TextOverflow.ellipsis, + overflow: + TextOverflow.ellipsis, style: TextStyle( - color: Theme.of(context).colorScheme.onBackground.withOpacity(0.6), + color: Theme.of(context) + .colorScheme + .onBackground + .withOpacity(0.6), ), ), const SizedBox( @@ -404,10 +427,12 @@ class _AboutPageState extends State { ], ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, children: [ const Icon(Icons.star_border), Text(' ${key['stars']}'), @@ -421,25 +446,41 @@ class _AboutPageState extends State { Row( children: [ Offstage( - offstage: key['languageColor'] == null, + offstage: + key['languageColor'] == + null, child: Container( width: 10, height: 10, decoration: BoxDecoration( shape: BoxShape.circle, - color: key['languageColor'] == null ? Colors.transparent : Color(int.parse(key['languageColor'].toString().substring(1), radix: 16) + 0xFF000000), + color: key['languageColor'] == + null + ? Colors.transparent + : Color(int.parse( + key['languageColor'] + .toString() + .substring( + 1), + radix: 16) + + 0xFF000000), ), ), ), Offstage( - offstage: key['language'] == null || key['languageColor'] == null, + offstage: key['language'] == + null || + key['languageColor'] == + null, child: const SizedBox( width: 5, ), ), Offstage( - offstage: key['language'] == null, - child: Text(key['language'] ?? 'null'), + offstage: + key['language'] == null, + child: Text(key['language'] ?? + 'null'), ), ], ), @@ -473,13 +514,17 @@ class _AboutPageState extends State { for (var key in socialMedia.keys) _isDesktop(context) ? ElevatedButton.icon( - onPressed: () => CustomLaunchUrl.launch(context, socialMedia[key]!['url'] as String), - icon: Icon(socialMedia[key]!['icon'] as IconData), + onPressed: () => CustomLaunchUrl.launch(context, + socialMedia[key]!['url'] as String), + icon: + Icon(socialMedia[key]!['icon'] as IconData), label: Text(key), ) : IconButton( - onPressed: () => CustomLaunchUrl.launch(context, socialMedia[key]!['url'] as String), - icon: Icon(socialMedia[key]!['icon'] as IconData), + onPressed: () => CustomLaunchUrl.launch(context, + socialMedia[key]!['url'] as String), + icon: + Icon(socialMedia[key]!['icon'] as IconData), tooltip: key, ), ], diff --git a/lib/pages/bmi.dart b/lib/pages/bmi.dart index dc091e8e..c2193793 100644 --- a/lib/pages/bmi.dart +++ b/lib/pages/bmi.dart @@ -74,7 +74,10 @@ class _BMIPageState extends State { child: Container( constraints: BoxConstraints( maxWidth: 700, - minHeight: MediaQuery.of(context).size.height - AppBar().preferredSize.height - MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.bottom, + minHeight: MediaQuery.of(context).size.height - + AppBar().preferredSize.height - + MediaQuery.of(context).padding.top - + MediaQuery.of(context).padding.bottom, ), padding: const EdgeInsets.all(10), child: Column( @@ -89,7 +92,10 @@ class _BMIPageState extends State { prefixIcon: const Icon(Icons.height), labelText: 'Height', suffixIcon: CustomToggleButtons( - isSelected: [_heightUnit == 'cm', _heightUnit == 'in'], + isSelected: [ + _heightUnit == 'cm', + _heightUnit == 'in' + ], onPressed: (index) { setState(() { if (index == 0) { @@ -122,7 +128,10 @@ class _BMIPageState extends State { prefixIcon: const Icon(Icons.scale), labelText: 'Weight', suffixIcon: CustomToggleButtons( - isSelected: [_weightUnit == 'kg', _weightUnit == 'lb'], + isSelected: [ + _weightUnit == 'kg', + _weightUnit == 'lb' + ], onPressed: (index) { setState(() { if (index == 0) { @@ -148,13 +157,15 @@ class _BMIPageState extends State { }, ), Offstage( - offstage: _weightController.text == '' || _heightController.text == '', + offstage: _weightController.text == '' || + _heightController.text == '', child: const SizedBox( height: 10, ), ), Offstage( - offstage: _weightController.text == '' || _heightController.text == '', + offstage: _weightController.text == '' || + _heightController.text == '', child: Wrap( spacing: 10, runSpacing: 10, diff --git a/lib/pages/chat.dart b/lib/pages/chat.dart index c3343c9e..95b76592 100644 --- a/lib/pages/chat.dart +++ b/lib/pages/chat.dart @@ -37,7 +37,10 @@ class _ChatPageState extends State { bool _handleScrollNotification(UserScrollNotification notification) { final ScrollDirection direction = notification.direction; setState(() { - if (notification.metrics.maxScrollExtent - notification.metrics.pixels > 100 && (direction == ScrollDirection.reverse || direction == ScrollDirection.idle)) { + if (notification.metrics.maxScrollExtent - notification.metrics.pixels > + 100 && + (direction == ScrollDirection.reverse || + direction == ScrollDirection.idle)) { _showFab = true; } else { _showFab = false; @@ -63,23 +66,32 @@ class _ChatPageState extends State { } void initChat() { - _onChatAddedSubscription = _fireBaseDB.child('chat').onChildAdded.listen((event) { + _onChatAddedSubscription = + _fireBaseDB.child('chat').onChildAdded.listen((event) { if (event.snapshot.value != null) { var chat = event.snapshot.value as Map; debugPrint('listened chat $chat'); - debugPrint('listened chat ${chat['uid']} ${chat['name']} ${chat['message']} ${chat['timestamp']} ${chat['photoUrl']}'); - addChat(chat['uid'] as String, chat['name'] as String, chat['message'] as String, chat['timestamp'] as int, chat['photoUrl'] as String); + debugPrint( + 'listened chat ${chat['uid']} ${chat['name']} ${chat['message']} ${chat['timestamp']} ${chat['photoUrl']}'); + addChat( + chat['uid'] as String, + chat['name'] as String, + chat['message'] as String, + chat['timestamp'] as int, + chat['photoUrl'] as String); } }, onError: (Object o) { final error = o as FirebaseException; debugPrint('Error: ${error.code} ${error.message}'); - CustomScaffoldMessenger.showErrorMessageSnackBar(context, '${error.code} ${error.message}'); + CustomScaffoldMessenger.showErrorMessageSnackBar( + context, '${error.code} ${error.message}'); }, onDone: () { debugPrint('Done'); }, cancelOnError: true); } - void addChat(String? uid, String? name, String? message, int? timestamp, String? photoUrl) { + void addChat(String? uid, String? name, String? message, int? timestamp, + String? photoUrl) { setState(() { _chat.add({ 'uid': uid ?? '', @@ -151,20 +163,47 @@ class _ChatPageState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ for (int i = 0; i < _chat.length; i++) - if (_chat[i]['uid'] == (FirebaseAuth.instance.currentUser != null ? FirebaseAuth.instance.currentUser!.uid : '')) + if (_chat[i]['uid'] == + (FirebaseAuth.instance.currentUser != + null + ? FirebaseAuth + .instance.currentUser!.uid + : '')) Column( children: [ - if (i == 0 || DateTime.fromMillisecondsSinceEpoch(int.parse(_chat[i]['timestamp'].toString())).day != DateTime.fromMillisecondsSinceEpoch(int.parse(_chat[i - 1]['timestamp'].toString())).day) + if (i == 0 || + DateTime.fromMillisecondsSinceEpoch( + int.parse(_chat[i] + ['timestamp'] + .toString())) + .day != + DateTime.fromMillisecondsSinceEpoch( + int.parse(_chat[i - 1] + ['timestamp'] + .toString())) + .day) Text( - DateTime.fromMillisecondsSinceEpoch(int.parse(_chat[i]['timestamp'].toString())).toString().substring(0, 10), + DateTime.fromMillisecondsSinceEpoch( + int.parse(_chat[i] + ['timestamp'] + .toString())) + .toString() + .substring(0, 10), style: TextStyle( - color: Theme.of(context).colorScheme.onSurface, - fontSize: Theme.of(context).textTheme.labelLarge?.fontSize, + color: Theme.of(context) + .colorScheme + .onSurface, + fontSize: Theme.of(context) + .textTheme + .labelLarge + ?.fontSize, ), ), Row( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.end, children: [ Container( margin: const EdgeInsets.only( @@ -173,35 +212,82 @@ class _ChatPageState extends State { right: 5, ), child: Text( - DateTime.fromMillisecondsSinceEpoch(int.parse(_chat[i]['timestamp'].toString())).toString().substring(11, 16), + DateTime.fromMillisecondsSinceEpoch( + int.parse(_chat[i] + ['timestamp'] + .toString())) + .toString() + .substring(11, 16), style: TextStyle( - color: Theme.of(context).colorScheme.onSurface, - fontSize: Theme.of(context).textTheme.labelLarge?.fontSize, + color: Theme.of(context) + .colorScheme + .onSurface, + fontSize: Theme.of(context) + .textTheme + .labelLarge + ?.fontSize, ), ), ), Container( constraints: BoxConstraints( - maxWidth: _messageWidth().toDouble(), + maxWidth: _messageWidth() + .toDouble(), ), - padding: const EdgeInsets.all(10), + padding: + const EdgeInsets.all(10), margin: EdgeInsets.only( - top: i == 0 || _chat[i]['uid'] != _chat[i - 1]['uid'] ? 5 : 1, - bottom: i == _chat.length - 1 || _chat[i]['uid'] != _chat[i + 1]['uid'] ? 5 : 1, + top: i == 0 || + _chat[i]['uid'] != + _chat[i - 1] + ['uid'] + ? 5 + : 1, + bottom: + i == _chat.length - 1 || + _chat[i]['uid'] != + _chat[i + 1] + ['uid'] + ? 5 + : 1, ), decoration: BoxDecoration( - color: Theme.of(context).colorScheme.primary, - borderRadius: BorderRadius.only( - topRight: Radius.circular(i == 0 || _chat[i]['uid'] != _chat[i - 1]['uid'] ? 10 : 0), - topLeft: const Radius.circular(10), - bottomRight: Radius.circular(i == _chat.length - 1 || _chat[i]['uid'] != _chat[i + 1]['uid'] ? 10 : 0), - bottomLeft: const Radius.circular(10), + color: Theme.of(context) + .colorScheme + .primary, + borderRadius: + BorderRadius.only( + topRight: Radius.circular( + i == 0 || + _chat[i][ + 'uid'] != + _chat[i - 1] + ['uid'] + ? 10 + : 0), + topLeft: + const Radius.circular( + 10), + bottomRight: Radius.circular( + i == _chat.length - 1 || + _chat[i] + [ + 'uid'] != + _chat[i + 1] + ['uid'] + ? 10 + : 0), + bottomLeft: + const Radius.circular( + 10), ), ), child: Text( _chat[i]['message'] as String, style: TextStyle( - color: Theme.of(context).colorScheme.onPrimary, + color: Theme.of(context) + .colorScheme + .onPrimary, ), ), ), @@ -212,17 +298,39 @@ class _ChatPageState extends State { else Column( children: [ - if (i == 0 || DateTime.fromMillisecondsSinceEpoch(int.parse(_chat[i]['timestamp'].toString())).day != DateTime.fromMillisecondsSinceEpoch(int.parse(_chat[i - 1]['timestamp'].toString())).day) + if (i == 0 || + DateTime.fromMillisecondsSinceEpoch( + int.parse(_chat[i] + ['timestamp'] + .toString())) + .day != + DateTime.fromMillisecondsSinceEpoch( + int.parse(_chat[i - 1] + ['timestamp'] + .toString())) + .day) Text( - DateTime.fromMillisecondsSinceEpoch(int.parse(_chat[i]['timestamp'].toString())).toString().substring(0, 10), + DateTime.fromMillisecondsSinceEpoch( + int.parse(_chat[i] + ['timestamp'] + .toString())) + .toString() + .substring(0, 10), style: TextStyle( - color: Theme.of(context).colorScheme.onSurface, - fontSize: Theme.of(context).textTheme.labelLarge?.fontSize, + color: Theme.of(context) + .colorScheme + .onSurface, + fontSize: Theme.of(context) + .textTheme + .labelLarge + ?.fontSize, ), ), Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ // photo Container( @@ -231,11 +339,21 @@ class _ChatPageState extends State { bottom: 5, left: 5, ), - child: _chat[i]['uid'] != _chat[i == 0 ? i : i - 1]['uid'] || i == 0 + child: _chat[i]['uid'] != + _chat[i == 0 + ? i + : i - 1] + ['uid'] || + i == 0 ? CircleAvatar( radius: 20, - backgroundImage: NetworkImage(_chat[i]['photoUrl'] as String), - backgroundColor: Colors.transparent, + backgroundImage: + NetworkImage(_chat[ + i] + ['photoUrl'] + as String), + backgroundColor: + Colors.transparent, ) : Container( width: 40, @@ -245,60 +363,143 @@ class _ChatPageState extends State { width: 5, ), Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - if (_chat[i]['uid'] != _chat[i == 0 ? i : i - 1]['uid'] || i == 0) + if (_chat[i]['uid'] != + _chat[i == 0 + ? i + : i - 1]['uid'] || + i == 0) Text( - _chat[i]['name'] as String, + _chat[i]['name'] + as String, style: TextStyle( - color: Theme.of(context).colorScheme.onSurface, - fontSize: Theme.of(context).textTheme.labelLarge?.fontSize, + color: Theme.of(context) + .colorScheme + .onSurface, + fontSize: + Theme.of(context) + .textTheme + .labelLarge + ?.fontSize, ), ), Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.end, children: [ Container( - constraints: BoxConstraints( - maxWidth: _messageWidth().toDouble(), + constraints: + BoxConstraints( + maxWidth: + _messageWidth() + .toDouble(), ), - padding: const EdgeInsets.all(10), + padding: + const EdgeInsets + .all(10), margin: EdgeInsets.only( - top: i == 0 || _chat[i]['uid'] != _chat[i - 1]['uid'] ? 5 : 1, - bottom: i == _chat.length - 1 || _chat[i]['uid'] != _chat[i + 1]['uid'] ? 5 : 1, + top: i == 0 || + _chat[i][ + 'uid'] != + _chat[i - + 1] + [ + 'uid'] + ? 5 + : 1, + bottom: i == + _chat.length - + 1 || + _chat[i][ + 'uid'] != + _chat[i + + 1] + [ + 'uid'] + ? 5 + : 1, ), - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.primary, - borderRadius: BorderRadius.only( - topRight: const Radius.circular(10), - topLeft: Radius.circular(i == 0 || _chat[i]['uid'] != _chat[i - 1]['uid'] ? 10 : 0), - bottomRight: const Radius.circular(10), - bottomLeft: Radius.circular( - i == _chat.length - 1 || _chat[i]['uid'] != _chat[i + 1]['uid'] ? 10 : 0, + decoration: + BoxDecoration( + color: + Theme.of(context) + .colorScheme + .primary, + borderRadius: + BorderRadius.only( + topRight: const Radius + .circular(10), + topLeft: Radius.circular(i == + 0 || + _chat[i][ + 'uid'] != + _chat[i - + 1] + [ + 'uid'] + ? 10 + : 0), + bottomRight: + const Radius + .circular(10), + bottomLeft: + Radius.circular( + i == _chat.length - 1 || + _chat[i][ + 'uid'] != + _chat[i + 1] + [ + 'uid'] + ? 10 + : 0, ), ), ), child: Text( - _chat[i]['message'] as String, + _chat[i]['message'] + as String, style: TextStyle( - color: Theme.of(context).colorScheme.onPrimary, + color: Theme.of( + context) + .colorScheme + .onPrimary, ), ), ), Container( - margin: const EdgeInsets.only( + margin: const EdgeInsets + .only( top: 5, bottom: 5, left: 5, ), child: Text( - DateTime.fromMillisecondsSinceEpoch(int.parse(_chat[i]['timestamp'].toString())).toString().substring(11, 16), + DateTime.fromMillisecondsSinceEpoch( + int.parse(_chat[ + i] + [ + 'timestamp'] + .toString())) + .toString() + .substring( + 11, 16), style: TextStyle( - color: Theme.of(context).colorScheme.onSurface, - fontSize: Theme.of(context).textTheme.labelLarge?.fontSize, + color: Theme.of( + context) + .colorScheme + .onSurface, + fontSize: Theme.of( + context) + .textTheme + .labelLarge + ?.fontSize, ), ), ), diff --git a/lib/pages/chat_ai.dart b/lib/pages/chat_ai.dart index 31f34670..3190bdc8 100644 --- a/lib/pages/chat_ai.dart +++ b/lib/pages/chat_ai.dart @@ -58,7 +58,10 @@ class _ChatAIPageState extends State { @override initState() { _chatData = >[]; - openAI = OpenAI.instance.build(token: 'sk-', baseOption: HttpSetup(receiveTimeout: const Duration(minutes: 1)), enableLog: kDebugMode); + openAI = OpenAI.instance.build( + token: 'sk-', + baseOption: HttpSetup(receiveTimeout: const Duration(minutes: 1)), + enableLog: kDebugMode); getToken(); getSystemMessage(); getTemperature(); @@ -112,14 +115,18 @@ class _ChatAIPageState extends State { temperature: _temperature, ); final raw = await openAI.onChatCompletion(request: request).catchError((e) { - CustomScaffoldMessenger.showErrorMessageSnackBar(context, 'Error: ${e.toString()}'); + CustomScaffoldMessenger.showErrorMessageSnackBar( + context, 'Error: ${e.toString()}'); setState(() { _generating = false; }); return null; }); setState(() { - _chatData.add({'role': raw!.choices[0].message!.role, 'content': raw.choices[0].message!.content}); + _chatData.add({ + 'role': raw!.choices[0].message!.role, + 'content': raw.choices[0].message!.content + }); _generating = false; if (_scrollController.hasClients) { _scrollController.animateTo( @@ -271,13 +278,16 @@ class _ChatAIPageState extends State { bottom: 5, ), decoration: BoxDecoration( - color: Theme.of(context).colorScheme.secondary, + color: + Theme.of(context).colorScheme.secondary, borderRadius: BorderRadius.circular(10), ), child: Text( i['content']!, style: TextStyle( - color: Theme.of(context).colorScheme.onSecondary, + color: Theme.of(context) + .colorScheme + .onSecondary, ), ), ), @@ -304,7 +314,9 @@ class _ChatAIPageState extends State { child: Text( i['content']!, style: TextStyle( - color: Theme.of(context).colorScheme.onPrimary, + color: Theme.of(context) + .colorScheme + .onPrimary, ), ), ), @@ -317,7 +329,8 @@ class _ChatAIPageState extends State { text: i['content']!, ), ); - CustomScaffoldMessenger.showMessageSnackBar(context, '已複製到剪貼簿'); + CustomScaffoldMessenger.showMessageSnackBar( + context, '已複製到剪貼簿'); }, ), ], @@ -340,7 +353,9 @@ class _ChatAIPageState extends State { child: Text( i['content']!, style: TextStyle( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context) + .colorScheme + .onBackground, ), ), ), @@ -363,13 +378,16 @@ class _ChatAIPageState extends State { right: 50, ), decoration: BoxDecoration( - color: Theme.of(context).colorScheme.primary, + color: + Theme.of(context).colorScheme.primary, borderRadius: BorderRadius.circular(10), ), child: Text( _generatingMessage ?? '', style: TextStyle( - color: Theme.of(context).colorScheme.onPrimary, + color: Theme.of(context) + .colorScheme + .onPrimary, fontWeight: FontWeight.bold, ), ), @@ -404,8 +422,11 @@ class _ChatAIPageState extends State { showDialog( context: context, builder: (context) { - final TextEditingController tokenInputController = TextEditingController(text: _token); - final TextEditingController systemMessageController = TextEditingController(text: _systemMessage); + final TextEditingController tokenInputController = + TextEditingController(text: _token); + final TextEditingController + systemMessageController = + TextEditingController(text: _systemMessage); return StatefulBuilder( builder: (context, setState) { return AlertDialog( @@ -421,8 +442,10 @@ class _ChatAIPageState extends State { maxLines: 3, controller: systemMessageController, labelText: 'System Message', - hintText: 'Enter some environment settings', - prefixIcon: const Icon(Icons.description), + hintText: + 'Enter some environment settings', + prefixIcon: + const Icon(Icons.description), suffixIcon: IconButton( icon: const Icon(Icons.clear), onPressed: () { @@ -451,12 +474,16 @@ class _ChatAIPageState extends State { InputDecorator( decoration: InputDecoration( labelText: 'Temperature', - prefixIcon: const Icon(Icons.thermostat), + prefixIcon: + const Icon(Icons.thermostat), labelStyle: TextStyle( - color: Theme.of(context).colorScheme.onSurface, + color: Theme.of(context) + .colorScheme + .onSurface, ), border: OutlineInputBorder( - borderRadius: BorderRadius.circular(16.0), + borderRadius: + BorderRadius.circular(16.0), ), ), child: Slider( @@ -464,7 +491,8 @@ class _ChatAIPageState extends State { min: 0, max: 1, divisions: 100, - label: _temporaryTemperature.toStringAsFixed(2), + label: _temporaryTemperature + .toStringAsFixed(2), onChanged: (value) { setState(() { _temporaryTemperature = value; @@ -478,12 +506,16 @@ class _ChatAIPageState extends State { InputDecorator( decoration: InputDecoration( labelText: 'Model', - prefixIcon: const Icon(Icons.model_training), + prefixIcon: const Icon( + Icons.model_training), labelStyle: TextStyle( - color: Theme.of(context).colorScheme.onSurface, + color: Theme.of(context) + .colorScheme + .onSurface, ), border: OutlineInputBorder( - borderRadius: BorderRadius.circular(16.0), + borderRadius: + BorderRadius.circular(16.0), ), ), child: DropdownButtonHideUnderline( @@ -509,18 +541,27 @@ class _ChatAIPageState extends State { SizedBox( width: double.infinity, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Text( 'Where to get token?', - style: TextStyle(fontSize: Theme.of(context).textTheme.bodyLarge!.fontSize!), + style: TextStyle( + fontSize: Theme.of(context) + .textTheme + .bodyLarge! + .fontSize!), ), ElevatedButton.icon( - icon: const Icon(Icons.open_in_new), + icon: const Icon( + Icons.open_in_new), onPressed: () { - CustomLaunchUrl.launch(context, 'https://platform.openai.com/account/api-keys'); + CustomLaunchUrl.launch( + context, + 'https://platform.openai.com/account/api-keys'); }, - label: const Text('OpenAI Website'), + label: const Text( + 'OpenAI Website'), ), const SizedBox( height: 10, @@ -528,10 +569,14 @@ class _ChatAIPageState extends State { Text( 'Where will the token be saved?', style: TextStyle( - fontSize: Theme.of(context).textTheme.bodyLarge!.fontSize!, + fontSize: Theme.of(context) + .textTheme + .bodyLarge! + .fontSize!, ), ), - const Text('The token will be saved in your browser\'s cookie.'), + const Text( + 'The token will be saved in your browser\'s cookie.'), ], ), ), @@ -547,13 +592,17 @@ class _ChatAIPageState extends State { ), TextButton( onPressed: () { - if (_token != tokenInputController.text) { + if (_token != + tokenInputController.text) { setToken(tokenInputController.text); } - if (_systemMessage != systemMessageController.text) { - setSystemMessage(systemMessageController.text); + if (_systemMessage != + systemMessageController.text) { + setSystemMessage( + systemMessageController.text); } - if (_temporaryTemperature != _temperature) { + if (_temporaryTemperature != + _temperature) { setTemperature(_temporaryTemperature); } if (_temporaryModel != _model) { diff --git a/lib/pages/clock.dart b/lib/pages/clock.dart index 62964c79..003b76b8 100644 --- a/lib/pages/clock.dart +++ b/lib/pages/clock.dart @@ -115,7 +115,9 @@ class _ClockPageState extends State { : 'PM' : '', style: TextStyle( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context) + .colorScheme + .onBackground, ), ), ), @@ -178,7 +180,9 @@ class _ClockPageState extends State { ), floatingActionButton: FloatingActionButton( onPressed: () { - html.document.fullscreenElement == null ? html.document.documentElement!.requestFullscreen() : html.document.exitFullscreen(); + html.document.fullscreenElement == null + ? html.document.documentElement!.requestFullscreen() + : html.document.exitFullscreen(); html.document.fullscreenElement == null ? setState(() { _fullscreen = true; diff --git a/lib/pages/contact.dart b/lib/pages/contact.dart index 90c8fb65..99bae7d0 100644 --- a/lib/pages/contact.dart +++ b/lib/pages/contact.dart @@ -26,8 +26,10 @@ class ContactPage extends StatefulWidget { class _ContactPageState extends State { final TextEditingController contactEmailController = TextEditingController(); - final TextEditingController contactMessageController = TextEditingController(); - final TextEditingController contactSignatureController = TextEditingController(); + final TextEditingController contactMessageController = + TextEditingController(); + final TextEditingController contactSignatureController = + TextEditingController(); final _messageformKey = GlobalKey(); bool _loading = false; @@ -67,18 +69,21 @@ class _ContactPageState extends State { setState(() { _loading = false; }); - CustomScaffoldMessenger.showMessageSnackBar(context, 'Message Sent Seccessfully.'); + CustomScaffoldMessenger.showMessageSnackBar( + context, 'Message Sent Seccessfully.'); }).catchError((error) { setState(() { _loading = false; }); - CustomScaffoldMessenger.showErrorMessageSnackBar(context, error.toString()); + CustomScaffoldMessenger.showErrorMessageSnackBar( + context, error.toString()); }); }).catchError((error) { setState(() { _loading = false; }); - CustomScaffoldMessenger.showErrorMessageSnackBar(context, error.toString()); + CustomScaffoldMessenger.showErrorMessageSnackBar( + context, error.toString()); }); } @@ -95,7 +100,10 @@ class _ContactPageState extends State { padding: const EdgeInsets.all(20), constraints: BoxConstraints( maxWidth: 700, - minHeight: MediaQuery.of(context).size.height - AppBar().preferredSize.height - MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.bottom, + minHeight: MediaQuery.of(context).size.height - + AppBar().preferredSize.height - + MediaQuery.of(context).padding.top - + MediaQuery.of(context).padding.bottom, ), child: Form( key: _messageformKey, diff --git a/lib/pages/load_failed.dart b/lib/pages/load_failed.dart index 29cba9d4..67ca5498 100644 --- a/lib/pages/load_failed.dart +++ b/lib/pages/load_failed.dart @@ -6,7 +6,8 @@ import '../widget/scaffold_messenger.dart'; import '../widget/card.dart'; class LoadFailedPage extends StatefulWidget { - const LoadFailedPage({Key? key, required this.errorMessage}) : super(key: key); + const LoadFailedPage({Key? key, required this.errorMessage}) + : super(key: key); final String errorMessage; @override @@ -35,7 +36,10 @@ class _LoadFailedPageState extends State { padding: const EdgeInsets.all(20), constraints: BoxConstraints( maxWidth: 700, - minHeight: MediaQuery.of(context).size.height - AppBar().preferredSize.height - MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.bottom, + minHeight: MediaQuery.of(context).size.height - + AppBar().preferredSize.height - + MediaQuery.of(context).padding.top - + MediaQuery.of(context).padding.bottom, ), child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -81,7 +85,8 @@ class _LoadFailedPageState extends State { Clipboard.setData( ClipboardData(text: errorMessage), ); - CustomScaffoldMessenger.showMessageSnackBar(context, 'Copied to clipboard.'); + CustomScaffoldMessenger.showMessageSnackBar( + context, 'Copied to clipboard.'); }, ), ElevatedButton.icon( diff --git a/lib/pages/long_url.dart b/lib/pages/long_url.dart index a835c552..fde826a3 100644 --- a/lib/pages/long_url.dart +++ b/lib/pages/long_url.dart @@ -59,7 +59,15 @@ class _LongURLPageState extends State { String uid = user.uid; String? token = await user.getIdToken(); await http - .post(lURLServerCreate, body: jsonEncode({'firebase_uid': uid, 'original_url': lURLURLController.text}), headers: {'Content-Type': 'application/json', 'X-Firebase-AppCheck': token ?? ''}) + .post(lURLServerCreate, + body: jsonEncode({ + 'firebase_uid': uid, + 'original_url': lURLURLController.text + }), + headers: { + 'Content-Type': 'application/json', + 'X-Firebase-AppCheck': token ?? '' + }) .then((value) => { setState(() { _lurl = jsonDecode(value.body)['url']; @@ -100,7 +108,10 @@ class _LongURLPageState extends State { padding: const EdgeInsets.all(20), constraints: BoxConstraints( maxWidth: 700, - minHeight: MediaQuery.of(context).size.height - AppBar().preferredSize.height - MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.bottom, + minHeight: MediaQuery.of(context).size.height - + AppBar().preferredSize.height - + MediaQuery.of(context).padding.top - + MediaQuery.of(context).padding.bottom, ), child: Form( key: _lURLformKey, @@ -170,8 +181,12 @@ class _LongURLPageState extends State { offstage: _loading, child: ElevatedButton.icon( onPressed: _createURL, - label: _loaded ? const Text('Recreate') : const Text('Create Long URL'), - icon: _loaded ? const Icon(Icons.refresh) : const Icon(Icons.add), + label: _loaded + ? const Text('Recreate') + : const Text('Create Long URL'), + icon: _loaded + ? const Icon(Icons.refresh) + : const Icon(Icons.add), ), ), Offstage( @@ -182,10 +197,14 @@ class _LongURLPageState extends State { onPressed: () { Clipboard.setData(ClipboardData(text: _lurl)) .then((value) => { - CustomScaffoldMessenger.showMessageSnackBar(context, 'Copied to clipboard'), + CustomScaffoldMessenger + .showMessageSnackBar( + context, 'Copied to clipboard'), }) .catchError((error) => { - CustomScaffoldMessenger.showErrorMessageSnackBar(context, error), + CustomScaffoldMessenger + .showErrorMessageSnackBar( + context, error), }); }, ), @@ -212,77 +231,113 @@ class _LongURLPageState extends State { CustomExpansionTile( leading: const Icon(Icons.http), title: const Text('HTTP 414'), - subtitle: const Text('Request-URI Too Large'), + subtitle: const Text( + 'Request-URI Too Large'), children: [ Offstage( - offstage: _lURLLength <= _lURLSupportLimit, + offstage: _lURLLength <= + _lURLSupportLimit, child: Text.rich( TextSpan( children: [ const TextSpan( - text: 'The URL you generated is ', + text: + 'The URL you generated is ', ), TextSpan( text: '$_lURLLength', - style: const TextStyle( - fontWeight: FontWeight.bold, + style: + const TextStyle( + fontWeight: + FontWeight.bold, ), ), const TextSpan( - text: ' characters long, which exceeds the upper limit of ', + text: + ' characters long, which exceeds the upper limit of ', ), const TextSpan( - text: '$_lURLSupportLimit', + text: + '$_lURLSupportLimit', style: TextStyle( - fontWeight: FontWeight.bold, + fontWeight: + FontWeight.bold, ), ), const TextSpan( - text: ' characters supported by our provider.', + text: + ' characters supported by our provider.', ), const TextSpan( - text: '\nYou can use ', + text: + '\nYou can use ', ), TextSpan( style: TextStyle( - color: Theme.of(context).colorScheme.primary, + color: Theme.of( + context) + .colorScheme + .primary, ), text: 'Short URL', - recognizer: TapGestureRecognizer() - ..onTap = () { - Navigator.pushNamed(context, '/shorturl'); - }, + recognizer: + TapGestureRecognizer() + ..onTap = () { + Navigator.pushNamed( + context, + '/shorturl'); + }, ), const TextSpan( - text: ' to shorten the original URL before generating Long URL.', + text: + ' to shorten the original URL before generating Long URL.', ), ], ), ), ), Offstage( - offstage: _lURLLength > _lURLSupportLimit, + offstage: _lURLLength > + _lURLSupportLimit, child: Text.rich( TextSpan( children: [ const TextSpan( - text: 'This is a unknown error, please contact us at ', + text: + 'This is a unknown error, please contact us at ', ), TextSpan( style: TextStyle( - color: Theme.of(context).colorScheme.primary, + color: Theme.of( + context) + .colorScheme + .primary, ), - text: 'admin@jhihyulin.live', - recognizer: TapGestureRecognizer() - ..onTap = () { - CustomLaunchUrl.launch(context, 'mailto:admin@jhihyulin.live?subject=%5BLong%20URL%5D%20Bug%20Report'); - }, + text: + 'admin@jhihyulin.live', + recognizer: + TapGestureRecognizer() + ..onTap = () { + CustomLaunchUrl + .launch( + context, + 'mailto:admin@jhihyulin.live?subject=%5BLong%20URL%5D%20Bug%20Report'); + }, ), - const TextSpan(text: ' for help.'), - const TextSpan(text: '\nDon\'t forget to include the following information:'), - const TextSpan(text: '\n1. Original URL'), - const TextSpan(text: '\n2. Generated Long URL'), - const TextSpan(text: '\n3. Error ScreenShot'), + const TextSpan( + text: ' for help.'), + const TextSpan( + text: + '\nDon\'t forget to include the following information:'), + const TextSpan( + text: + '\n1. Original URL'), + const TextSpan( + text: + '\n2. Generated Long URL'), + const TextSpan( + text: + '\n3. Error ScreenShot'), ], ), ), diff --git a/lib/pages/privacy_policy.dart b/lib/pages/privacy_policy.dart index a1c71be9..f5518f19 100644 --- a/lib/pages/privacy_policy.dart +++ b/lib/pages/privacy_policy.dart @@ -14,7 +14,8 @@ class PrivacyPolicyPage extends StatefulWidget { class _PrivacyPolicyPageState extends State { _loadMarkdownData() async { - var url = 'https://raw.githubusercontent.com/jhihyulin/WEBSITE/main/privacy_policy.md'; + var url = + 'https://raw.githubusercontent.com/jhihyulin/WEBSITE/main/privacy_policy.md'; var client = http.Client(); var request = http.Request('GET', Uri.parse(url)); var response = await client.send(request); @@ -36,7 +37,8 @@ class _PrivacyPolicyPageState extends State { physics: const BouncingScrollPhysics(), child: Center( child: Container( - height: MediaQuery.of(context).size.height - AppBar().preferredSize.height, + height: MediaQuery.of(context).size.height - + AppBar().preferredSize.height, width: MediaQuery.of(context).size.width, constraints: const BoxConstraints( maxWidth: 700, diff --git a/lib/pages/profile.dart b/lib/pages/profile.dart index 22d75030..5a6239bd 100644 --- a/lib/pages/profile.dart +++ b/lib/pages/profile.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:firebase_auth/firebase_auth.dart' hide EmailAuthProvider, PhoneAuthProvider; +import 'package:firebase_auth/firebase_auth.dart' + hide EmailAuthProvider, PhoneAuthProvider; import 'package:firebase_ui_auth/firebase_ui_auth.dart'; import 'package:firebase_ui_oauth_google/firebase_ui_oauth_google.dart'; import 'package:firebase_ui_oauth_facebook/firebase_ui_oauth_facebook.dart'; @@ -28,7 +29,9 @@ class _ProfilePageState extends State { providers: [ // EmailAuthProvider(), PhoneAuthProvider(), - GoogleProvider(clientId: '897798864282-t574p0gmq20jeu9u04cbt8270k1vk4cc.apps.googleusercontent.com'), + GoogleProvider( + clientId: + '897798864282-t574p0gmq20jeu9u04cbt8270k1vk4cc.apps.googleusercontent.com'), TwitterProvider( apiKey: 'ItobTrCpFOOvmSc6zufiMLxds', apiSecretKey: 'TWITTER_SECRET', diff --git a/lib/pages/qr_generator.dart b/lib/pages/qr_generator.dart index e2ceab13..90606ccc 100644 --- a/lib/pages/qr_generator.dart +++ b/lib/pages/qr_generator.dart @@ -54,12 +54,15 @@ class _QRGeneratorPageState extends State { void _createImageFromRenderKey() async { var renderKey = globalKey; - final RenderRepaintBoundary boundary = renderKey.currentContext?.findRenderObject()! as RenderRepaintBoundary; + final RenderRepaintBoundary boundary = + renderKey.currentContext?.findRenderObject()! as RenderRepaintBoundary; final ui.Image image = await boundary.toImage(pixelRatio: 3); final ByteData? byteData = await image.toByteData( format: ui.ImageByteFormat.png, ); - final anchor = html.AnchorElement(href: 'data:image/png;base64,${base64Encode(byteData!.buffer.asUint8List())}'); + final anchor = html.AnchorElement( + href: + 'data:image/png;base64,${base64Encode(byteData!.buffer.asUint8List())}'); anchor.download = 'QRCode.png'; anchor.click(); } @@ -77,7 +80,10 @@ class _QRGeneratorPageState extends State { padding: const EdgeInsets.all(20), constraints: BoxConstraints( maxWidth: 700, - minHeight: MediaQuery.of(context).size.height - AppBar().preferredSize.height - MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.bottom, + minHeight: MediaQuery.of(context).size.height - + AppBar().preferredSize.height - + MediaQuery.of(context).padding.top - + MediaQuery.of(context).padding.bottom, ), child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -127,7 +133,8 @@ class _QRGeneratorPageState extends State { minWidth: 700, ), child: SingleChildScrollView( - physics: const BouncingScrollPhysics(), + physics: + const BouncingScrollPhysics(), child: Text.rich( TextSpan( children: [ @@ -137,13 +144,19 @@ class _QRGeneratorPageState extends State { ), TextSpan( style: TextStyle( - color: Theme.of(context).colorScheme.primary, + color: Theme.of(context) + .colorScheme + .primary, ), - text: 'https://www.qrcode.com/en/about/version.html', - recognizer: TapGestureRecognizer() - ..onTap = () { - CustomLaunchUrl.launch(context, 'https://www.qrcode.com/en/about/version.html'); - }, + text: + 'https://www.qrcode.com/en/about/version.html', + recognizer: + TapGestureRecognizer() + ..onTap = () { + CustomLaunchUrl.launch( + context, + 'https://www.qrcode.com/en/about/version.html'); + }, ), ], ), @@ -315,7 +328,8 @@ class _QRGeneratorPageState extends State { ), ListTile( title: const Text('Gapless'), - subtitle: const Text('Adds an extra pixel in size to prevent gaps'), + subtitle: const Text( + 'Adds an extra pixel in size to prevent gaps'), trailing: Switch( value: _gapless, onChanged: (value) { @@ -389,7 +403,8 @@ class _QRGeneratorPageState extends State { icon: const Icon(Icons.refresh), onPressed: () { setState(() { - _embeddedImageSize = const QrEmbeddedImageStyle( + _embeddedImageSize = + const QrEmbeddedImageStyle( size: Size(30, 30), ); _generate(); @@ -398,23 +413,33 @@ class _QRGeneratorPageState extends State { ), IconButton( icon: const Icon(Icons.remove), - onPressed: _embeddedImageSize.size != const Size(0, 0) - ? () { - setState(() { - _embeddedImageSize = (_embeddedImageSize.size != const Size(0, 0) - ? QrEmbeddedImageStyle( - size: Size( - _embeddedImageSize.size!.width - 1, - _embeddedImageSize.size!.height - 1, - ), - ) - : null)!; - _generate(); - }); - } - : null, + onPressed: + _embeddedImageSize.size != const Size(0, 0) + ? () { + setState(() { + _embeddedImageSize = + (_embeddedImageSize.size != + const Size(0, 0) + ? QrEmbeddedImageStyle( + size: Size( + _embeddedImageSize + .size! + .width - + 1, + _embeddedImageSize + .size! + .height - + 1, + ), + ) + : null)!; + _generate(); + }); + } + : null, ), - Text('${_embeddedImageSize.size!.width.toInt()}x${_embeddedImageSize.size!.height.toInt()}'), + Text( + '${_embeddedImageSize.size!.width.toInt()}x${_embeddedImageSize.size!.height.toInt()}'), IconButton( icon: const Icon(Icons.add), onPressed: () { @@ -458,7 +483,8 @@ class _QRGeneratorPageState extends State { ); if (pickedFile != null) { setState(() { - _embeddedImage = NetworkImage(pickedFile.path); + _embeddedImage = + NetworkImage(pickedFile.path); _generate(); }); } @@ -477,7 +503,9 @@ class _QRGeneratorPageState extends State { ], onPressed: (index) { setState(() { - _selectModuleShape = index == 0 ? QrDataModuleShape.circle : QrDataModuleShape.square; + _selectModuleShape = index == 0 + ? QrDataModuleShape.circle + : QrDataModuleShape.square; _generate(); }); }, @@ -511,8 +539,12 @@ class _QRGeneratorPageState extends State { color: _foregroundColor, ), padding: EdgeInsets.all(_padding.toDouble()), - embeddedImage: _useEmbeddedImage ? _embeddedImage ?? const AssetImage('assets/images/logo-512x512.png') : null, - embeddedImageStyle: _useEmbeddedImage ? _embeddedImageSize : null, + embeddedImage: _useEmbeddedImage + ? _embeddedImage ?? + const AssetImage('assets/images/logo-512x512.png') + : null, + embeddedImageStyle: + _useEmbeddedImage ? _embeddedImageSize : null, errorStateBuilder: (cxt, err) { return Center( child: Text( diff --git a/lib/pages/short_url.dart b/lib/pages/short_url.dart index 3e916e53..8085081a 100644 --- a/lib/pages/short_url.dart +++ b/lib/pages/short_url.dart @@ -56,8 +56,12 @@ class _ShortURLPageState extends State { await http .post( sURLServerCreate, - body: jsonEncode({'firebase_uid': uid, 'original_url': sURLURLController.text}), - headers: {'Content-Type': 'application/json', 'X-Firebase-AppCheck': token ?? ''}, + body: jsonEncode( + {'firebase_uid': uid, 'original_url': sURLURLController.text}), + headers: { + 'Content-Type': 'application/json', + 'X-Firebase-AppCheck': token ?? '' + }, ) .then((value) => { setState(() { @@ -72,7 +76,8 @@ class _ShortURLPageState extends State { _loading = false; _loaded = false; }), - CustomScaffoldMessenger.showErrorMessageSnackBar(context, error), + CustomScaffoldMessenger.showErrorMessageSnackBar( + context, error), }); } else { setState(() { @@ -100,7 +105,10 @@ class _ShortURLPageState extends State { padding: const EdgeInsets.all(20), constraints: BoxConstraints( maxWidth: 700, - minHeight: MediaQuery.of(context).size.height - AppBar().preferredSize.height - MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.bottom, + minHeight: MediaQuery.of(context).size.height - + AppBar().preferredSize.height - + MediaQuery.of(context).padding.top - + MediaQuery.of(context).padding.bottom, ), child: Form( key: _sURLFormKey, @@ -168,8 +176,12 @@ class _ShortURLPageState extends State { offstage: _loading, child: ElevatedButton.icon( onPressed: _createURL, - label: _loaded ? const Text('Recreate') : const Text('Create Short URL'), - icon: _loaded ? const Icon(Icons.refresh) : const Icon(Icons.add), + label: _loaded + ? const Text('Recreate') + : const Text('Create Short URL'), + icon: _loaded + ? const Icon(Icons.refresh) + : const Icon(Icons.add), ), ), Offstage( @@ -185,12 +197,16 @@ class _ShortURLPageState extends State { ) .then( (value) => { - CustomScaffoldMessenger.showMessageSnackBar(context, 'Copied to clipboard'), + CustomScaffoldMessenger + .showMessageSnackBar( + context, 'Copied to clipboard'), }, ) .catchError( (error) => { - CustomScaffoldMessenger.showErrorMessageSnackBar(context, error), + CustomScaffoldMessenger + .showErrorMessageSnackBar( + context, error), }, ); }, diff --git a/lib/pages/sign_in.dart b/lib/pages/sign_in.dart index d377fd7f..26d4cafd 100644 --- a/lib/pages/sign_in.dart +++ b/lib/pages/sign_in.dart @@ -1,7 +1,8 @@ import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:firebase_auth/firebase_auth.dart' hide EmailAuthProvider, PhoneAuthProvider; +import 'package:firebase_auth/firebase_auth.dart' + hide EmailAuthProvider, PhoneAuthProvider; import 'package:firebase_ui_auth/firebase_ui_auth.dart'; import 'package:firebase_ui_oauth_google/firebase_ui_oauth_google.dart'; import 'package:firebase_ui_oauth_facebook/firebase_ui_oauth_facebook.dart'; @@ -23,7 +24,8 @@ class _SignInPageState extends State { void _uploaduserinfo() { FirebaseAuth.instance.currentUser!.reload(); User user = FirebaseAuth.instance.currentUser!; - DocumentReference> ref = FirebaseFirestore.instance.collection('user').doc(user.uid); + DocumentReference> ref = + FirebaseFirestore.instance.collection('user').doc(user.uid); List providerData = []; for (UserInfo userInfo in user.providerData) { providerData.add({ @@ -45,12 +47,17 @@ class _SignInPageState extends State { 'phoneNumber': user.phoneNumber, 'isAnonymous': user.isAnonymous, 'isEmailVerified': user.emailVerified, - 'lastSignInTime': user.metadata.lastSignInTime?.millisecondsSinceEpoch, + 'lastSignInTime': + user.metadata.lastSignInTime?.millisecondsSinceEpoch, 'providerData': providerData, }) .then((value) => {debugPrint('User Data Updated')}) .catchError((error) => { - if (kDebugMode) {debugPrint('Failed to update user data, will try to create: $error')}, + if (kDebugMode) + { + debugPrint( + 'Failed to update user data, will try to create: $error') + }, ref .set({ 'email': user.email, @@ -61,13 +68,19 @@ class _SignInPageState extends State { 'phoneNumber': user.phoneNumber, 'isAnonymous': user.isAnonymous, 'isEmailVerified': user.emailVerified, - 'creationTime': user.metadata.creationTime?.millisecondsSinceEpoch, - 'lastSignInTime': user.metadata.lastSignInTime?.microsecondsSinceEpoch, + 'creationTime': + user.metadata.creationTime?.millisecondsSinceEpoch, + 'lastSignInTime': + user.metadata.lastSignInTime?.microsecondsSinceEpoch, 'providerData': providerData, }) .then((value) => {debugPrint('User Data Created')}) .catchError((error) => { - if (kDebugMode) {debugPrint('Failed to set and update user data: $error')} + if (kDebugMode) + { + debugPrint( + 'Failed to set and update user data: $error') + } }) }); } @@ -88,7 +101,9 @@ class _SignInPageState extends State { ); return Scaffold( appBar: AppBar( - title: _redirectPage == '/profile' ? const Text('Sign In') : const Text('Sign In to Continue'), + title: _redirectPage == '/profile' + ? const Text('Sign In') + : const Text('Sign In to Continue'), ), body: SignInScreen( showAuthActionSwitch: false, @@ -104,7 +119,8 @@ class _SignInPageState extends State { providers: [ // EmailAuthProvider(), GoogleProvider( - clientId: '897798864282-t574p0gmq20jeu9u04cbt8270k1vk4cc.apps.googleusercontent.com', + clientId: + '897798864282-t574p0gmq20jeu9u04cbt8270k1vk4cc.apps.googleusercontent.com', ), TwitterProvider( apiKey: 'ItobTrCpFOOvmSc6zufiMLxds', diff --git a/lib/pages/spin_wheel.dart b/lib/pages/spin_wheel.dart index 30b8c3bc..8804da52 100644 --- a/lib/pages/spin_wheel.dart +++ b/lib/pages/spin_wheel.dart @@ -64,8 +64,13 @@ class _SpinWheelPageState extends State { _spinTimer?.cancel(); var currentRotateSpeed = _rotateSpeed.toDouble(); _spinTimer = Timer.periodic(const Duration(milliseconds: 10), (timer) { - var needToRotateAngle = allNeedToRotateAngle - (originalSpinNumber - spinNumber) * 360 - _rotate; - currentRotateSpeed = sqrt((needToRotateAngle / 360) < 0.0001 ? 0.0001 : (needToRotateAngle / 360)) * _rotateSpeed; + var needToRotateAngle = allNeedToRotateAngle - + (originalSpinNumber - spinNumber) * 360 - + _rotate; + currentRotateSpeed = sqrt((needToRotateAngle / 360) < 0.0001 + ? 0.0001 + : (needToRotateAngle / 360)) * + _rotateSpeed; if (_rotate >= 360) { setState(() { _rotate = 0; @@ -161,7 +166,10 @@ class _SpinWheelPageState extends State { child: Center( child: Container( constraints: BoxConstraints( - minHeight: MediaQuery.of(context).size.height - AppBar().preferredSize.height - MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.bottom, + minHeight: MediaQuery.of(context).size.height - + AppBar().preferredSize.height - + MediaQuery.of(context).padding.top - + MediaQuery.of(context).padding.bottom, ), child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -181,12 +189,15 @@ class _SpinWheelPageState extends State { width: mathSquare() - 20, height: mathSquare() - 20, child: Container( - padding: const EdgeInsets.fromLTRB(10, 10, 0, 10), + padding: + const EdgeInsets.fromLTRB(10, 10, 0, 10), child: Center( child: RotationTransition( - turns: AlwaysStoppedAnimation(-_rotate / 360), + turns: + AlwaysStoppedAnimation(-_rotate / 360), child: CustomPaint( - size: Size(mathSquare() - 60, mathSquare() - 60), + size: Size( + mathSquare() - 60, mathSquare() - 60), painter: MyPainter( context: context, textList: _textList, @@ -201,7 +212,8 @@ class _SpinWheelPageState extends State { height: mathPin() - 20, child: Center( child: Container( - padding: const EdgeInsets.fromLTRB(0, 10, 10, 10), + padding: + const EdgeInsets.fromLTRB(0, 10, 10, 10), child: CustomPaint( size: Size(mathPin() - 30, mathPin() - 40), painter: PinPainter( @@ -243,9 +255,12 @@ class _SpinWheelPageState extends State { : () { spin(); }, - icon: _spinning ? const Icon(Icons.stop) : const Icon(Icons.play_arrow), + icon: _spinning + ? const Icon(Icons.stop) + : const Icon(Icons.play_arrow), iconSize: 64, - color: _spinning ? Colors.red : Colors.green, + color: + _spinning ? Colors.red : Colors.green, tooltip: _spinning ? 'Stop' : _spined @@ -331,19 +346,24 @@ class _SpinWheelPageState extends State { flex: 2, child: CustomTextFormField( validator: (value) { - if (value == null || value.isEmpty) { + if (value == null || + value.isEmpty) { return 'Required'; - } else if (int.tryParse(value) == null) { + } else if (int.tryParse( + value) == + null) { return 'Only number'; } return null; }, controller: _controller2, - keyboardType: TextInputType.number, + keyboardType: + TextInputType.number, enabled: !_spinning, labelText: 'Min', hintText: 'Min', - onChanged: (value) => onChange(), + onChanged: (value) => + onChange(), ), ), const SizedBox(width: 10), @@ -351,19 +371,24 @@ class _SpinWheelPageState extends State { flex: 2, child: CustomTextFormField( validator: (value) { - if (value == null || value.isEmpty) { + if (value == null || + value.isEmpty) { return 'Required'; - } else if (int.tryParse(value) == null) { + } else if (int.tryParse( + value) == + null) { return 'Only number'; } return null; }, controller: _controller3, - keyboardType: TextInputType.number, + keyboardType: + TextInputType.number, enabled: !_spinning, labelText: 'Max', hintText: 'Max', - onChanged: (value) => onChange(), + onChanged: (value) => + onChange(), ), ), const SizedBox( @@ -376,16 +401,39 @@ class _SpinWheelPageState extends State { onPressed: _spinning ? null : () { - if (_formKey2.currentState!.validate()) { - if (int.parse(_controller2.text) > int.parse(_controller3.text)) { - CustomScaffoldMessenger.showErrorMessageSnackBar(context, 'Error: Min must be less than Max'); + if (_formKey2 + .currentState! + .validate()) { + if (int.parse( + _controller2 + .text) > + int.parse( + _controller3 + .text)) { + CustomScaffoldMessenger + .showErrorMessageSnackBar( + context, + 'Error: Min must be less than Max'); return; } var tL = []; - for (int i = int.parse(_controller2.text); i <= int.parse(_controller3.text); i++) { - tL.add(i.toString()); + for (int i = int.parse( + _controller2 + .text); + i <= + int.parse( + _controller3 + .text); + i++) { + tL.add( + i.toString()); } - _controller.text = _controller.text == '' ? tL.join('\n') : '${_controller.text}\n${tL.join('\n')}'; + _controller + .text = _controller + .text == + '' + ? tL.join('\n') + : '${_controller.text}\n${tL.join('\n')}'; onChange(); setState(() {}); } @@ -503,7 +551,10 @@ class MyPainter extends CustomPainter { ? 0 : (2 / textList.length * size.width) > size.width / 2 ? size.width / 2 * 1 / textList[i].length * 0.8 - : (2 / textList.length * size.width) * 1 / textList[i].length * 0.8; + : (2 / textList.length * size.width) * + 1 / + textList[i].length * + 0.8; // text canvas.save(); canvas.rotate(angle + aAngle / 2); @@ -521,7 +572,8 @@ class MyPainter extends CustomPainter { textPainter.layout(); textPainter.paint( canvas, - center.translate(-textPainter.width - 10, -size.height / 2 - textPainter.height / 2), + center.translate(-textPainter.width - 10, + -size.height / 2 - textPainter.height / 2), ); canvas.restore(); } diff --git a/lib/pages/status.dart b/lib/pages/status.dart index 7ea1bf1a..3f541810 100644 --- a/lib/pages/status.dart +++ b/lib/pages/status.dart @@ -19,7 +19,8 @@ Set> _status = { 'Japan Osaka #3': 'https://stats.uptimerobot.com/plWPBU9LQz/794105153', 'Long URL': 'https://stats.uptimerobot.com/plWPBU9LQz/793129221', 'Short URL': 'https://stats.uptimerobot.com/plWPBU9LQz/793129225', - 'VPN Service Manager': 'https://stats.uptimerobot.com/plWPBU9LQz/793144839', + 'VPN Service Manager': + 'https://stats.uptimerobot.com/plWPBU9LQz/793144839', }, }, { @@ -72,7 +73,10 @@ class _StatusPageState extends State { padding: const EdgeInsets.all(20), constraints: BoxConstraints( maxWidth: 700, - minHeight: MediaQuery.of(context).size.height - AppBar().preferredSize.height - MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.bottom, + minHeight: MediaQuery.of(context).size.height - + AppBar().preferredSize.height - + MediaQuery.of(context).padding.top - + MediaQuery.of(context).padding.bottom, ), child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -102,7 +106,8 @@ class _StatusPageState extends State { onPressed: item.value == null ? null : () { - CustomLaunchUrl.launch(context, item.value); + CustomLaunchUrl.launch( + context, item.value); }, child: Text(item.key), ), @@ -111,7 +116,8 @@ class _StatusPageState extends State { trailing: IconButton( icon: const Icon(Icons.open_in_new), onPressed: () { - CustomLaunchUrl.launch(context, status['url']); + CustomLaunchUrl.launch( + context, status['url']); }, ), ), diff --git a/lib/pages/terms_of_service.dart b/lib/pages/terms_of_service.dart index ea579505..92339017 100644 --- a/lib/pages/terms_of_service.dart +++ b/lib/pages/terms_of_service.dart @@ -14,7 +14,8 @@ class TermsOfServicePage extends StatefulWidget { class _TermsOfServicePageState extends State { _loadMarkdownData() async { - var url = 'https://raw.githubusercontent.com/jhihyulin/WEBSITE/main/terms_of_service.md'; + var url = + 'https://raw.githubusercontent.com/jhihyulin/WEBSITE/main/terms_of_service.md'; var client = http.Client(); var request = http.Request('GET', Uri.parse(url)); var response = await client.send(request); @@ -36,7 +37,8 @@ class _TermsOfServicePageState extends State { physics: const BouncingScrollPhysics(), child: Center( child: Container( - height: MediaQuery.of(context).size.height - AppBar().preferredSize.height, + height: MediaQuery.of(context).size.height - + AppBar().preferredSize.height, width: MediaQuery.of(context).size.width, constraints: const BoxConstraints( maxWidth: 700, diff --git a/lib/pages/timer.dart b/lib/pages/timer.dart index 89dd50a1..f692b36a 100644 --- a/lib/pages/timer.dart +++ b/lib/pages/timer.dart @@ -25,7 +25,9 @@ class _TimerPageState extends State { int _lastTimeForMilliSeconds = 0; double _mathBox() { - return MediaQuery.of(context).size.width > 700 ? 700 * .3 : MediaQuery.of(context).size.width * .3; + return MediaQuery.of(context).size.width > 700 + ? 700 * .3 + : MediaQuery.of(context).size.width * .3; } void _startTimer(String mode) { @@ -34,16 +36,23 @@ class _TimerPageState extends State { }); if (mode == 'countdown') { setState(() { - _targetTimeForMilliSeconds = DateTime.now().millisecondsSinceEpoch + _counterHours * 3600000 + _counterMinutes * 60000 + (_counterSeconds * 1000).floor(); - _lastTimeForMilliSeconds = _targetTimeForMilliSeconds - DateTime.now().millisecondsSinceEpoch; + _targetTimeForMilliSeconds = DateTime.now().millisecondsSinceEpoch + + _counterHours * 3600000 + + _counterMinutes * 60000 + + (_counterSeconds * 1000).floor(); + _lastTimeForMilliSeconds = + _targetTimeForMilliSeconds - DateTime.now().millisecondsSinceEpoch; }); _timer = Timer.periodic(const Duration(milliseconds: 1), (timer) { if (_lastTimeForMilliSeconds > 0) { setState(() { - _lastTimeForMilliSeconds = _targetTimeForMilliSeconds - DateTime.now().millisecondsSinceEpoch; + _lastTimeForMilliSeconds = _targetTimeForMilliSeconds - + DateTime.now().millisecondsSinceEpoch; _counterHours = (_lastTimeForMilliSeconds / 3600000).floor(); - _counterMinutes = ((_lastTimeForMilliSeconds % 3600000) / 60000).floor(); - _counterSeconds = (((_lastTimeForMilliSeconds % 3600000) % 60000) / 1000); + _counterMinutes = + ((_lastTimeForMilliSeconds % 3600000) / 60000).floor(); + _counterSeconds = + (((_lastTimeForMilliSeconds % 3600000) % 60000) / 1000); }); } else { setState(() { @@ -60,15 +69,22 @@ class _TimerPageState extends State { }); } else if (mode == 'stopwatch') { setState(() { - _targetTimeForMilliSeconds = DateTime.now().millisecondsSinceEpoch - _counterHours * 3600000 - _counterMinutes * 60000 - (_counterSeconds * 1000).floor(); - _lastTimeForMilliSeconds = DateTime.now().millisecondsSinceEpoch - _targetTimeForMilliSeconds; + _targetTimeForMilliSeconds = DateTime.now().millisecondsSinceEpoch - + _counterHours * 3600000 - + _counterMinutes * 60000 - + (_counterSeconds * 1000).floor(); + _lastTimeForMilliSeconds = + DateTime.now().millisecondsSinceEpoch - _targetTimeForMilliSeconds; }); _timer = Timer.periodic(const Duration(milliseconds: 1), (timer) { setState(() { - _lastTimeForMilliSeconds = DateTime.now().millisecondsSinceEpoch - _targetTimeForMilliSeconds; + _lastTimeForMilliSeconds = DateTime.now().millisecondsSinceEpoch - + _targetTimeForMilliSeconds; _counterHours = (_lastTimeForMilliSeconds / 3600000).floor(); - _counterMinutes = ((_lastTimeForMilliSeconds % 3600000) / 60000).floor(); - _counterSeconds = (((_lastTimeForMilliSeconds % 3600000) % 60000) / 1000); + _counterMinutes = + ((_lastTimeForMilliSeconds % 3600000) / 60000).floor(); + _counterSeconds = + (((_lastTimeForMilliSeconds % 3600000) % 60000) / 1000); }); }); } @@ -126,7 +142,10 @@ class _TimerPageState extends State { child: Container( constraints: BoxConstraints( maxWidth: 700, - minHeight: MediaQuery.of(context).size.height - AppBar().preferredSize.height - MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.bottom, + minHeight: MediaQuery.of(context).size.height - + AppBar().preferredSize.height - + MediaQuery.of(context).padding.top - + MediaQuery.of(context).padding.bottom, ), child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -165,9 +184,14 @@ class _TimerPageState extends State { child: FittedBox( child: RichText( text: TextSpan( - text: _counterHours.toString().toString().padLeft(2, '0'), + text: _counterHours + .toString() + .toString() + .padLeft(2, '0'), style: TextStyle( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context) + .colorScheme + .onBackground, ), children: const [ TextSpan( @@ -188,12 +212,16 @@ class _TimerPageState extends State { width: double.infinity, height: _mathBox() * 0.25, child: TextButton( - onPressed: _isRunning || _mode != 'countdown' || _counterHours == 0 + onPressed: _isRunning || + _mode != 'countdown' || + _counterHours == 0 ? null : () { setState(() { if (_counterHours > 0) { - _counterHours = _counterHours < 1 ? 0 : _counterHours - 1; + _counterHours = _counterHours < 1 + ? 0 + : _counterHours - 1; } }); }, @@ -236,9 +264,13 @@ class _TimerPageState extends State { child: FittedBox( child: RichText( text: TextSpan( - text: _counterMinutes.toString().padLeft(2, '0'), + text: _counterMinutes + .toString() + .padLeft(2, '0'), style: TextStyle( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context) + .colorScheme + .onBackground, ), children: const [ TextSpan( @@ -259,12 +291,17 @@ class _TimerPageState extends State { width: double.infinity, height: _mathBox() * 0.25, child: TextButton( - onPressed: _isRunning || _mode != 'countdown' || _counterMinutes == 0 + onPressed: _isRunning || + _mode != 'countdown' || + _counterMinutes == 0 ? null : () { setState(() { if (_counterMinutes > 0) { - _counterMinutes = _counterMinutes < 1 ? 0 : _counterMinutes - 1; + _counterMinutes = + _counterMinutes < 1 + ? 0 + : _counterMinutes - 1; } }); }, @@ -307,9 +344,13 @@ class _TimerPageState extends State { child: FittedBox( child: RichText( text: TextSpan( - text: _counterSeconds.toStringAsFixed(2).padLeft(5, '0'), + text: _counterSeconds + .toStringAsFixed(2) + .padLeft(5, '0'), style: TextStyle( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context) + .colorScheme + .onBackground, ), children: const [ TextSpan( @@ -328,12 +369,17 @@ class _TimerPageState extends State { width: double.infinity, height: _mathBox() * 0.25, child: TextButton( - onPressed: _isRunning || _mode != 'countdown' || _counterSeconds == 0 + onPressed: _isRunning || + _mode != 'countdown' || + _counterSeconds == 0 ? null : () { setState(() { if (_counterSeconds > 0) { - _counterSeconds = _counterSeconds < 1 ? 0 : _counterSeconds - 1; + _counterSeconds = + _counterSeconds < 1 + ? 0 + : _counterSeconds - 1; } }); }, @@ -384,7 +430,11 @@ class _TimerPageState extends State { IconButton( icon: const Icon(Icons.replay), tooltip: 'Reset', - onPressed: _counterSeconds != 0 || _counterMinutes != 0 || _counterHours != 0 ? _resetTimer : null, + onPressed: _counterSeconds != 0 || + _counterMinutes != 0 || + _counterHours != 0 + ? _resetTimer + : null, ), ], ), @@ -400,7 +450,10 @@ class _TimerPageState extends State { ElevatedButton.icon( icon: Icon(_isRunning ? Icons.pause : Icons.play_arrow), label: Text(_isRunning ? 'Pause' : 'Start'), - onPressed: _counterHours == 0 && _counterMinutes == 0 && _counterSeconds == 0 && _mode == 'countdown' + onPressed: _counterHours == 0 && + _counterMinutes == 0 && + _counterSeconds == 0 && + _mode == 'countdown' ? null : _isRunning ? _pauseTimer diff --git a/lib/pages/tw_university_result_query.dart b/lib/pages/tw_university_result_query.dart index b491742d..d7e044b7 100644 --- a/lib/pages/tw_university_result_query.dart +++ b/lib/pages/tw_university_result_query.dart @@ -21,10 +21,12 @@ class TWUniversityResultQueryPage extends StatefulWidget { final String? id; @override - State createState() => _TWUniversityResultQueryPageState(); + State createState() => + _TWUniversityResultQueryPageState(); } -class _TWUniversityResultQueryPageState extends State { +class _TWUniversityResultQueryPageState + extends State { final _formKey = GlobalKey(); final TextEditingController inputIdController = TextEditingController(); @@ -102,7 +104,8 @@ class _TWUniversityResultQueryPageState extends State { padding: const EdgeInsets.all(20), constraints: BoxConstraints( maxWidth: 700, - minHeight: MediaQuery.of(context).size.height - AppBar().preferredSize.height - MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.bottom, + minHeight: MediaQuery.of(context).size.height - + AppBar().preferredSize.height - + MediaQuery.of(context).padding.top - + MediaQuery.of(context).padding.bottom, ), child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -52,7 +55,8 @@ class _URLLauncherPageState extends State { ), onFieldSubmitted: (value) { if (_formKey.currentState!.validate()) { - CustomLaunchUrl.launch(context, inputURLController.text); + CustomLaunchUrl.launch( + context, inputURLController.text); } }, ), @@ -70,7 +74,8 @@ class _URLLauncherPageState extends State { label: const Text('Launch URL'), onPressed: () { if (_formKey.currentState!.validate()) { - CustomLaunchUrl.launch(context, inputURLController.text); + CustomLaunchUrl.launch( + context, inputURLController.text); } }, ), @@ -91,7 +96,8 @@ class _URLLauncherPageState extends State { physics: BouncingScrollPhysics(), child: Column( children: [ - Text('Enter a URL and click Launch URL button to open the URL in the browser or your device\'s default app for the URL.'), + Text( + 'Enter a URL and click Launch URL button to open the URL in the browser or your device\'s default app for the URL.'), ], ), ), diff --git a/lib/pages/vpn.dart b/lib/pages/vpn.dart index 3a260009..fa8abbcf 100644 --- a/lib/pages/vpn.dart +++ b/lib/pages/vpn.dart @@ -113,10 +113,14 @@ class _VPNPageState extends State { // print(uid); // print(token); // print(serverId); - await http.post(getToken, body: jsonEncode({'firebase_uid': uid, 'token': token, 'server_id': serverId}), headers: {'Content-Type': 'application/json'}).then((value) { + await http.post(getToken, + body: jsonEncode( + {'firebase_uid': uid, 'token': token, 'server_id': serverId}), + headers: {'Content-Type': 'application/json'}).then((value) { var data = jsonDecode(value.body); setState(() { - _accessUrlController.text = data['access_url'] + '#' + data['display_name']; + _accessUrlController.text = + data['access_url'] + '#' + data['display_name']; _accessUrl = data['access_url'] + '#' + data['display_name']; _dataUsedPercentage = data['data_used_percentage']; _useBytesLimitVisualization = data['use_bytes_limit_visualization']; @@ -159,25 +163,32 @@ class _VPNPageState extends State { } switch (os) { case 'android': - CustomLaunchUrl.launch(context, 'https://play.google.com/store/apps/details?id=org.outline.android.client'); + CustomLaunchUrl.launch(context, + 'https://play.google.com/store/apps/details?id=org.outline.android.client'); break; case 'ios': - CustomLaunchUrl.launch(context, 'https://apps.apple.com/app/outline-vpn/id1356177741'); + CustomLaunchUrl.launch( + context, 'https://apps.apple.com/app/outline-vpn/id1356177741'); break; case 'mac': - CustomLaunchUrl.launch(context, 'https://itunes.apple.com/app/outline-vpn-client/id1356178125'); + CustomLaunchUrl.launch(context, + 'https://itunes.apple.com/app/outline-vpn-client/id1356178125'); break; case 'windows': - CustomLaunchUrl.launch(context, 'https://s3.amazonaws.com/outline-releases/client/windows/stable/Outline-Client.exe'); + CustomLaunchUrl.launch(context, + 'https://s3.amazonaws.com/outline-releases/client/windows/stable/Outline-Client.exe'); break; case 'chromeos': - CustomLaunchUrl.launch(context, 'https://play.google.com/store/apps/details?id=org.outline.android.client'); + CustomLaunchUrl.launch(context, + 'https://play.google.com/store/apps/details?id=org.outline.android.client'); break; case 'linux': - CustomLaunchUrl.launch(context, 'https://s3.amazonaws.com/outline-releases/client/linux/stable/Outline-Client.AppImage'); + CustomLaunchUrl.launch(context, + 'https://s3.amazonaws.com/outline-releases/client/linux/stable/Outline-Client.AppImage'); break; case 'unknown': - CustomLaunchUrl.launch(context, 'https://getoutline.org/zh-TW/get-started/#step-3'); + CustomLaunchUrl.launch( + context, 'https://getoutline.org/zh-TW/get-started/#step-3'); break; } } @@ -198,7 +209,10 @@ class _VPNPageState extends State { padding: const EdgeInsets.all(20), constraints: BoxConstraints( maxWidth: 700, - minHeight: MediaQuery.of(context).size.height - AppBar().preferredSize.height - MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.bottom, + minHeight: MediaQuery.of(context).size.height - + AppBar().preferredSize.height - + MediaQuery.of(context).padding.top - + MediaQuery.of(context).padding.bottom, ), child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -260,7 +274,8 @@ class _VPNPageState extends State { ), ), Offstage( - offstage: _selectedServerId == _defaultSelect || !_getResponse, + offstage: + _selectedServerId == _defaultSelect || !_getResponse, child: Column( children: [ Row( @@ -295,11 +310,16 @@ class _VPNPageState extends State { TextButton( child: const Icon(Icons.copy), onPressed: () async { - await Clipboard.setData(ClipboardData(text: _accessUrl)).then((value) { - CustomScaffoldMessenger.showMessageSnackBar(context, 'Copied to clipboard'); + await Clipboard.setData( + ClipboardData(text: _accessUrl)) + .then((value) { + CustomScaffoldMessenger.showMessageSnackBar( + context, 'Copied to clipboard'); }).catchError( (error) { - CustomScaffoldMessenger.showErrorMessageSnackBar(context, error.toString()); + CustomScaffoldMessenger + .showErrorMessageSnackBar( + context, error.toString()); }, ); }, @@ -311,32 +331,40 @@ class _VPNPageState extends State { context: context, builder: (BuildContext context) { return AlertDialog( - title: const Text('How to use Outline VPN?'), + title: + const Text('How to use Outline VPN?'), content: Container( constraints: const BoxConstraints( maxWidth: 700, minWidth: 700, ), child: SingleChildScrollView( - physics: const BouncingScrollPhysics(), + physics: + const BouncingScrollPhysics(), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Text.rich( TextSpan( children: [ const TextSpan( - text: '1. If you don\'t have Outline APP on your device, click ', + text: + '1. If you don\'t have Outline APP on your device, click ', ), TextSpan( style: TextStyle( - color: Theme.of(context).colorScheme.primary, + color: Theme.of(context) + .colorScheme + .primary, ), - text: 'Install Outline VPN APP', - recognizer: TapGestureRecognizer() - ..onTap = () { - _installOutlineVPN(); - }, + text: + 'Install Outline VPN APP', + recognizer: + TapGestureRecognizer() + ..onTap = () { + _installOutlineVPN(); + }, ), const TextSpan( text: ' to install it.', @@ -344,11 +372,16 @@ class _VPNPageState extends State { ], ), ), - const Text('2. Turn back to this page and click "Add To APP"'), - const Text('3. Will open Outline VPN APP, click "ADD SERVER"'), - const Text('4. Access key will save in Outline APP'), - const Text('5. Click "CONNECT" to connect to VPN server'), - const Text('* If you are first time to use Outline APP, will need to allow Outline APP to access your device.'), + const Text( + '2. Turn back to this page and click "Add To APP"'), + const Text( + '3. Will open Outline VPN APP, click "ADD SERVER"'), + const Text( + '4. Access key will save in Outline APP'), + const Text( + '5. Click "CONNECT" to connect to VPN server'), + const Text( + '* If you are first time to use Outline APP, will need to allow Outline APP to access your device.'), ], ), ), diff --git a/lib/pages/zhsh_3d_map.dart b/lib/pages/zhsh_3d_map.dart index 726eac9e..5ba1ca8b 100644 --- a/lib/pages/zhsh_3d_map.dart +++ b/lib/pages/zhsh_3d_map.dart @@ -173,10 +173,22 @@ const Map settingData = { 'name': '學務處', 'description': '訓育組、社團活動組、衛生組、生輔組、教官', 'link': { - '學務處網站': 'https://sites.google.com/mail2.chshs.ntpc.edu.tw/studentaffairs', + '學務處網站': + 'https://sites.google.com/mail2.chshs.ntpc.edu.tw/studentaffairs', '教官室網站': 'https://sites.google.com/mail2.chshs.ntpc.edu.tw/military', }, - 'keyword': ['訓育組', '訓育', '社團活動組', '社團活動', '社團', '衛生組', '衛生', '生輔組', '生輔', '教官'], + 'keyword': [ + '訓育組', + '訓育', + '社團活動組', + '社團活動', + '社團', + '衛生組', + '衛生', + '生輔組', + '生輔', + '教官' + ], }, 'build1_1f_room2': { 'name': '健康中心', @@ -193,13 +205,15 @@ const Map settingData = { 'description': '教學組、註冊組、試務組、實研組', 'keyword': ['教學組', '教學', '註冊組', '註冊', '試務組', '試務', '實研組', '實研'], 'link': { - '教務處網站': 'https://sites.google.com/mail2.chshs.ntpc.edu.tw/teacheraffairs', + '教務處網站': + 'https://sites.google.com/mail2.chshs.ntpc.edu.tw/teacheraffairs', } }, 'build1_2f_room2': { 'name': '輔導處', 'link': { - '輔導處網站': 'https://sites.google.com/mail2.chshs.ntpc.edu.tw/consultation', + '輔導處網站': + 'https://sites.google.com/mail2.chshs.ntpc.edu.tw/consultation', } }, 'build1_3f_room1': { @@ -207,7 +221,8 @@ const Map settingData = { 'description': '文書組、事務組、出納組', 'keyword': ['文書組', '文書', '事務組', '事務', '出納組', '出納'], 'link': { - '總務處網站': 'https://sites.google.com/mail2.chshs.ntpc.edu.tw/generalaffairs', + '總務處網站': + 'https://sites.google.com/mail2.chshs.ntpc.edu.tw/generalaffairs', '人事室網站': 'https://sites.google.com/mail2.chshs.ntpc.edu.tw/personnel', } }, @@ -443,7 +458,8 @@ const Map settingData = { 'description': '資訊媒體組', 'keyword': ['資訊媒體組', '資訊組', '資訊'], 'link': { - '圖書館網站': 'https://sites.google.com/mail2.chshs.ntpc.edu.tw/library/%E9%A6%96%E9%A0%81', + '圖書館網站': + 'https://sites.google.com/mail2.chshs.ntpc.edu.tw/library/%E9%A6%96%E9%A0%81', } }, 'build6_1f_room5': {'name': 'TED講堂'}, @@ -518,7 +534,10 @@ const Map settingData = { 'facility_gate_slidedoor_###c7': {'name': '大門滑門#c7', 'searchable': false}, 'facility_gate_slidedoor_###c8': {'name': '大門滑門#c8', 'searchable': false}, 'facility_gate_slidedoor_###c9': {'name': '大門滑門#c9', 'searchable': false}, - 'facility_gate_slidedoor_###c10': {'name': '大門滑門#c10', 'searchable': false}, + 'facility_gate_slidedoor_###c10': { + 'name': '大門滑門#c10', + 'searchable': false + }, 'facility_court1': {'name': '籃球場B'}, 'facility_court2': {'name': '排球場'}, 'facility_court3': {'name': '籃球場A'}, @@ -534,7 +553,8 @@ const Map settingData = { 'description': '民國89年以貳佰參拾玖萬伍仟元建成', 'nameSearch': false, 'link': { - '決標公告': 'https://web.pcc.gov.tw/tps/atm/AtmAwardWithoutSso/QueryAtmAwardDetail?pkAtmMain=MjM1NzU4', + '決標公告': + 'https://web.pcc.gov.tw/tps/atm/AtmAwardWithoutSso/QueryAtmAwardDetail?pkAtmMain=MjM1NzU4', } }, 'facility_electronic1': {'name': '電箱'}, @@ -576,14 +596,77 @@ const Map settingData = { // build, floor, x, y, z, height, width, length, color, render, rotate, nameSearch const Map> mapData = { // build - 'build_base2': {'x': 13, 'y': 0, 'z': 61, 'height': 1, 'width': 6, 'length': 5}, - 'build_1f': {'floor': 1, 'x': 13, 'y': 1, 'z': 51.5, 'height': 4, 'width': 13, 'length': 5}, - 'build_2f': {'floor': 2, 'x': 13, 'y': 5, 'z': 51.5, 'height': 3, 'width': 13, 'length': 5}, - 'build_3f': {'floor': 3, 'x': 13, 'y': 8, 'z': 51.5, 'height': 3, 'width': 13, 'length': 5}, - 'build_4f': {'floor': 4, 'x': 13, 'y': 11, 'z': 51.5, 'height': 3, 'width': 13, 'length': 5}, - 'build_5f': {'floor': 5, 'x': 13, 'y': 14, 'z': 51.5, 'height': 3, 'width': 13, 'length': 5}, - 'build_6f': {'floor': 6, 'x': 13, 'y': 17, 'z': 51.5, 'height': 3, 'width': 13, 'length': 5}, - 'build_7f': {'floor': 7, 'x': 13, 'y': 20, 'z': 51.5, 'height': 3, 'width': 13, 'length': 5}, + 'build_base2': { + 'x': 13, + 'y': 0, + 'z': 61, + 'height': 1, + 'width': 6, + 'length': 5 + }, + 'build_1f': { + 'floor': 1, + 'x': 13, + 'y': 1, + 'z': 51.5, + 'height': 4, + 'width': 13, + 'length': 5 + }, + 'build_2f': { + 'floor': 2, + 'x': 13, + 'y': 5, + 'z': 51.5, + 'height': 3, + 'width': 13, + 'length': 5 + }, + 'build_3f': { + 'floor': 3, + 'x': 13, + 'y': 8, + 'z': 51.5, + 'height': 3, + 'width': 13, + 'length': 5 + }, + 'build_4f': { + 'floor': 4, + 'x': 13, + 'y': 11, + 'z': 51.5, + 'height': 3, + 'width': 13, + 'length': 5 + }, + 'build_5f': { + 'floor': 5, + 'x': 13, + 'y': 14, + 'z': 51.5, + 'height': 3, + 'width': 13, + 'length': 5 + }, + 'build_6f': { + 'floor': 6, + 'x': 13, + 'y': 17, + 'z': 51.5, + 'height': 3, + 'width': 13, + 'length': 5 + }, + 'build_7f': { + 'floor': 7, + 'x': 13, + 'y': 20, + 'z': 51.5, + 'height': 3, + 'width': 13, + 'length': 5 + }, 'build_stair': { 'x': 13, 'y': 1, @@ -594,7 +677,15 @@ const Map> mapData = { }, // build1 - 'build1_base': {'build': 'build1', 'x': -12, 'y': 0, 'z': 52.5, 'height': 1, 'width': 15, 'length': 5}, + 'build1_base': { + 'build': 'build1', + 'x': -12, + 'y': 0, + 'z': 52.5, + 'height': 1, + 'width': 15, + 'length': 5 + }, 'build1_base_###1': { 'build': 'build1', 'x': -10.5, @@ -604,13 +695,69 @@ const Map> mapData = { 'width': 14, 'length': 2 }, - 'build1_base_###2': {'build': 'build1', 'x': -14.1, 'y': 0, 'z': 67.5, 'height': 1, 'width': 15, 'length': 0.8}, - 'build1_base_###3': {'build': 'build1', 'x': -11.6, 'y': 0, 'z': 67.5, 'height': 2, 'width': 15, 'length': 0.2}, - 'build1_stair': {'build': 'build1', 'x': -10, 'y': 0, 'z': 42.5, 'height': 29, 'width': 5, 'length': 9}, - 'build1_stair1': {'build': 'build1', 'x': -10.5, 'y': 0, 'z': 74.4, 'height': 0.2, 'width': 0.8, 'length': 2}, - 'build1_stair1_###1': {'build': 'build1', 'x': -10.5, 'y': 0.2, 'z': 74.3, 'height': 0.2, 'width': 0.6, 'length': 2}, - 'build1_stair1_###2': {'build': 'build1', 'x': -10.5, 'y': 0.4, 'z': 74.2, 'height': 0.2, 'width': 0.4, 'length': 2}, - 'build1_stair1_###3': {'build': 'build1', 'x': -10.5, 'y': 0.6, 'z': 74.1, 'height': 0.2, 'width': 0.2, 'length': 2}, + 'build1_base_###2': { + 'build': 'build1', + 'x': -14.1, + 'y': 0, + 'z': 67.5, + 'height': 1, + 'width': 15, + 'length': 0.8 + }, + 'build1_base_###3': { + 'build': 'build1', + 'x': -11.6, + 'y': 0, + 'z': 67.5, + 'height': 2, + 'width': 15, + 'length': 0.2 + }, + 'build1_stair': { + 'build': 'build1', + 'x': -10, + 'y': 0, + 'z': 42.5, + 'height': 29, + 'width': 5, + 'length': 9 + }, + 'build1_stair1': { + 'build': 'build1', + 'x': -10.5, + 'y': 0, + 'z': 74.4, + 'height': 0.2, + 'width': 0.8, + 'length': 2 + }, + 'build1_stair1_###1': { + 'build': 'build1', + 'x': -10.5, + 'y': 0.2, + 'z': 74.3, + 'height': 0.2, + 'width': 0.6, + 'length': 2 + }, + 'build1_stair1_###2': { + 'build': 'build1', + 'x': -10.5, + 'y': 0.4, + 'z': 74.2, + 'height': 0.2, + 'width': 0.4, + 'length': 2 + }, + 'build1_stair1_###3': { + 'build': 'build1', + 'x': -10.5, + 'y': 0.6, + 'z': 74.1, + 'height': 0.2, + 'width': 0.2, + 'length': 2 + }, 'build1_ramp': { 'build': 'build1', 'x': -12.7, @@ -621,38 +768,295 @@ const Map> mapData = { 'length': 2, 'rotate': {'x': 0.0664, 'y': 0, 'z': 0} }, - 'build1_elevator': {'build': 'build1', 'x': -4, 'y': -2, 'z': 42.5, 'height': 29, 'width': 5, 'length': 3}, - 'build1_colunm': {'build': 'build1', 'x': -14.1, 'y': 1, 'z': 74.6, 'height': 10, 'width': 0.8, 'length': 0.8}, - 'build1_colunm_###1': {'build': 'build1', 'x': -14.1, 'y': 1, 'z': 69.7, 'height': 10, 'width': 0.8, 'length': 0.8}, - 'build1_colunm_###2': {'build': 'build1', 'x': -14.1, 'y': 1, 'z': 64.8, 'height': 7, 'width': 0.8, 'length': 0.8}, - 'build1_colunm_###3': {'build': 'build1', 'x': -14.1, 'y': 1, 'z': 59.9, 'height': 7, 'width': 0.8, 'length': 0.8}, - 'build1_colunm_###4': {'build': 'build1', 'x': -14.1, 'y': 1, 'z': 55, 'height': 7, 'width': 0.8, 'length': 0.8}, - 'build1_colunm_###5': {'build': 'build1', 'x': -14.1, 'y': 1, 'z': 50.1, 'height': 7, 'width': 0.8, 'length': 0.8}, - 'build1_beam': {'build': 'build1', 'x': -11.6, 'y': 5, 'z': 74.6, 'height': 0.5, 'width': 0.5, 'length': 4.2}, - 'build1_beam_###1': {'build': 'build1', 'x': -14.1, 'y': 5, 'z': 72.15, 'height': 0.5, 'width': 4.1, 'length': 0.5}, - 'build1_beam_###2': {'build': 'build1', 'x': -14.1, 'y': 5, 'z': 67.25, 'height': 0.5, 'width': 4.1, 'length': 0.5}, - 'build1_beam_###3': {'build': 'build1', 'x': -14.1, 'y': 5, 'z': 62.35, 'height': 0.5, 'width': 4.1, 'length': 0.5}, - 'build1_beam_###4': {'build': 'build1', 'x': -14.1, 'y': 5, 'z': 57.45, 'height': 0.5, 'width': 4.1, 'length': 0.5}, - 'build1_beam_###5': {'build': 'build1', 'x': -14.1, 'y': 5, 'z': 52.55, 'height': 0.5, 'width': 4.1, 'length': 0.5}, - 'build1_beam_###6': {'build': 'build1', 'x': -14.1, 'y': 5, 'z': 47.35, 'height': 0.5, 'width': 4.7, 'length': 0.5}, - 'build1_beam_###7': {'build': 'build1', 'x': -11.6, 'y': 7, 'z': 74.6, 'height': 2, 'width': 0.5, 'length': 4.2}, - 'build1_beam_###8': {'build': 'build1', 'x': -14.1, 'y': 7, 'z': 72.15, 'height': 2, 'width': 4.1, 'length': 0.5}, - 'build1_beam_###9': {'build': 'build1', 'x': -14.1, 'y': 7, 'z': 67.25, 'height': 2, 'width': 4.1, 'length': 0.5}, - 'build1_beam_###10': {'build': 'build1', 'x': -11.6, 'y': 5, 'z': 69.7, 'height': 0.5, 'width': 0.5, 'length': 4.2}, - 'build1_beam_###11': {'build': 'build1', 'x': -11.6, 'y': 5, 'z': 64.8, 'height': 0.5, 'width': 0.5, 'length': 4.2}, - 'build1_beam_###12': {'build': 'build1', 'x': -11.6, 'y': 5, 'z': 59.9, 'height': 0.5, 'width': 0.5, 'length': 4.2}, - 'build1_beam_###13': {'build': 'build1', 'x': -11.6, 'y': 5, 'z': 55, 'height': 0.5, 'width': 0.5, 'length': 4.2}, - 'build1_beam_###14': {'build': 'build1', 'x': -11.6, 'y': 5, 'z': 50.1, 'height': 0.5, 'width': 0.5, 'length': 4.2}, - 'build1_stairgate': {'build': 'build1', 'x': -14.9, 'y': 0, 'z': 55, 'height': 0.2, 'width': 9.8, 'length': 0.8}, - 'build1_stairgate_###1': {'build': 'build1', 'x': -14.8, 'y': 0.2, 'z': 55, 'height': 0.2, 'width': 9.8, 'length': 0.6}, - 'build1_stairgate_###2': {'build': 'build1', 'x': -14.7, 'y': 0.4, 'z': 55, 'height': 0.2, 'width': 9.8, 'length': 0.4}, - 'build1_stairgate_###3': {'build': 'build1', 'x': -14.6, 'y': 0.6, 'z': 55, 'height': 0.2, 'width': 9.8, 'length': 0.2}, - 'build1_facade': {'build': 'build1', 'x': -9.25, 'y': 1, 'z': 47, 'height': 7, 'width': 4, 'length': 0.5}, - 'build1_facade_###1': {'build': 'build1', 'x': -14.1, 'y': 1, 'z': 72.15, 'height': 0.7, 'width': 4.1, 'length': 0.5}, - 'build1_facade_###2': {'build': 'build1', 'x': -14.1, 'y': 1, 'z': 67.25, 'height': 0.7, 'width': 4.1, 'length': 0.5}, - 'build1_facade_###3': {'build': 'build1', 'x': -14.1, 'y': 1, 'z': 62.35, 'height': 0.7, 'width': 4.1, 'length': 0.5}, - 'build1_facade_###4': {'build': 'build1', 'x': -14.1, 'y': 1, 'z': 47.35, 'height': 0.7, 'width': 4.7, 'length': 0.5}, - 'build1_gate': {'build': 'build1', 'x': -9.25, 'y': 1, 'z': 54.5, 'height': 4, 'width': 11, 'length': 0.5, 'opacity': 0.2}, + 'build1_elevator': { + 'build': 'build1', + 'x': -4, + 'y': -2, + 'z': 42.5, + 'height': 29, + 'width': 5, + 'length': 3 + }, + 'build1_colunm': { + 'build': 'build1', + 'x': -14.1, + 'y': 1, + 'z': 74.6, + 'height': 10, + 'width': 0.8, + 'length': 0.8 + }, + 'build1_colunm_###1': { + 'build': 'build1', + 'x': -14.1, + 'y': 1, + 'z': 69.7, + 'height': 10, + 'width': 0.8, + 'length': 0.8 + }, + 'build1_colunm_###2': { + 'build': 'build1', + 'x': -14.1, + 'y': 1, + 'z': 64.8, + 'height': 7, + 'width': 0.8, + 'length': 0.8 + }, + 'build1_colunm_###3': { + 'build': 'build1', + 'x': -14.1, + 'y': 1, + 'z': 59.9, + 'height': 7, + 'width': 0.8, + 'length': 0.8 + }, + 'build1_colunm_###4': { + 'build': 'build1', + 'x': -14.1, + 'y': 1, + 'z': 55, + 'height': 7, + 'width': 0.8, + 'length': 0.8 + }, + 'build1_colunm_###5': { + 'build': 'build1', + 'x': -14.1, + 'y': 1, + 'z': 50.1, + 'height': 7, + 'width': 0.8, + 'length': 0.8 + }, + 'build1_beam': { + 'build': 'build1', + 'x': -11.6, + 'y': 5, + 'z': 74.6, + 'height': 0.5, + 'width': 0.5, + 'length': 4.2 + }, + 'build1_beam_###1': { + 'build': 'build1', + 'x': -14.1, + 'y': 5, + 'z': 72.15, + 'height': 0.5, + 'width': 4.1, + 'length': 0.5 + }, + 'build1_beam_###2': { + 'build': 'build1', + 'x': -14.1, + 'y': 5, + 'z': 67.25, + 'height': 0.5, + 'width': 4.1, + 'length': 0.5 + }, + 'build1_beam_###3': { + 'build': 'build1', + 'x': -14.1, + 'y': 5, + 'z': 62.35, + 'height': 0.5, + 'width': 4.1, + 'length': 0.5 + }, + 'build1_beam_###4': { + 'build': 'build1', + 'x': -14.1, + 'y': 5, + 'z': 57.45, + 'height': 0.5, + 'width': 4.1, + 'length': 0.5 + }, + 'build1_beam_###5': { + 'build': 'build1', + 'x': -14.1, + 'y': 5, + 'z': 52.55, + 'height': 0.5, + 'width': 4.1, + 'length': 0.5 + }, + 'build1_beam_###6': { + 'build': 'build1', + 'x': -14.1, + 'y': 5, + 'z': 47.35, + 'height': 0.5, + 'width': 4.7, + 'length': 0.5 + }, + 'build1_beam_###7': { + 'build': 'build1', + 'x': -11.6, + 'y': 7, + 'z': 74.6, + 'height': 2, + 'width': 0.5, + 'length': 4.2 + }, + 'build1_beam_###8': { + 'build': 'build1', + 'x': -14.1, + 'y': 7, + 'z': 72.15, + 'height': 2, + 'width': 4.1, + 'length': 0.5 + }, + 'build1_beam_###9': { + 'build': 'build1', + 'x': -14.1, + 'y': 7, + 'z': 67.25, + 'height': 2, + 'width': 4.1, + 'length': 0.5 + }, + 'build1_beam_###10': { + 'build': 'build1', + 'x': -11.6, + 'y': 5, + 'z': 69.7, + 'height': 0.5, + 'width': 0.5, + 'length': 4.2 + }, + 'build1_beam_###11': { + 'build': 'build1', + 'x': -11.6, + 'y': 5, + 'z': 64.8, + 'height': 0.5, + 'width': 0.5, + 'length': 4.2 + }, + 'build1_beam_###12': { + 'build': 'build1', + 'x': -11.6, + 'y': 5, + 'z': 59.9, + 'height': 0.5, + 'width': 0.5, + 'length': 4.2 + }, + 'build1_beam_###13': { + 'build': 'build1', + 'x': -11.6, + 'y': 5, + 'z': 55, + 'height': 0.5, + 'width': 0.5, + 'length': 4.2 + }, + 'build1_beam_###14': { + 'build': 'build1', + 'x': -11.6, + 'y': 5, + 'z': 50.1, + 'height': 0.5, + 'width': 0.5, + 'length': 4.2 + }, + 'build1_stairgate': { + 'build': 'build1', + 'x': -14.9, + 'y': 0, + 'z': 55, + 'height': 0.2, + 'width': 9.8, + 'length': 0.8 + }, + 'build1_stairgate_###1': { + 'build': 'build1', + 'x': -14.8, + 'y': 0.2, + 'z': 55, + 'height': 0.2, + 'width': 9.8, + 'length': 0.6 + }, + 'build1_stairgate_###2': { + 'build': 'build1', + 'x': -14.7, + 'y': 0.4, + 'z': 55, + 'height': 0.2, + 'width': 9.8, + 'length': 0.4 + }, + 'build1_stairgate_###3': { + 'build': 'build1', + 'x': -14.6, + 'y': 0.6, + 'z': 55, + 'height': 0.2, + 'width': 9.8, + 'length': 0.2 + }, + 'build1_facade': { + 'build': 'build1', + 'x': -9.25, + 'y': 1, + 'z': 47, + 'height': 7, + 'width': 4, + 'length': 0.5 + }, + 'build1_facade_###1': { + 'build': 'build1', + 'x': -14.1, + 'y': 1, + 'z': 72.15, + 'height': 0.7, + 'width': 4.1, + 'length': 0.5 + }, + 'build1_facade_###2': { + 'build': 'build1', + 'x': -14.1, + 'y': 1, + 'z': 67.25, + 'height': 0.7, + 'width': 4.1, + 'length': 0.5 + }, + 'build1_facade_###3': { + 'build': 'build1', + 'x': -14.1, + 'y': 1, + 'z': 62.35, + 'height': 0.7, + 'width': 4.1, + 'length': 0.5 + }, + 'build1_facade_###4': { + 'build': 'build1', + 'x': -14.1, + 'y': 1, + 'z': 47.35, + 'height': 0.7, + 'width': 4.7, + 'length': 0.5 + }, + 'build1_gate': { + 'build': 'build1', + 'x': -9.25, + 'y': 1, + 'z': 54.5, + 'height': 4, + 'width': 11, + 'length': 0.5, + 'opacity': 0.2 + }, // build1_b1 'build1_b1_room1': { 'build': 'build1', @@ -674,7 +1078,14 @@ const Map> mapData = { 'length': 13, 'floor': -1, }, - 'build1_b1_room1_###extend': {'x': 13, 'y': -2, 'z': 49, 'height': 3, 'width': 18, 'length': 5}, + 'build1_b1_room1_###extend': { + 'x': 13, + 'y': -2, + 'z': 49, + 'height': 3, + 'width': 18, + 'length': 5 + }, // build1_1f 'build1_1f_room': { 'build': 'build1', @@ -820,7 +1231,14 @@ const Map> mapData = { 'length': 5, 'floor': 3, }, - 'build1_3f_extend': {'x': -15.25, 'y': 8, 'z': 55, 'height': 1.5, 'width': 14, 'length': 1.5}, + 'build1_3f_extend': { + 'x': -15.25, + 'y': 8, + 'z': 55, + 'height': 1.5, + 'width': 14, + 'length': 1.5 + }, 'build1_3f_room3': { 'build': 'build1', 'x': -12, @@ -977,17 +1395,115 @@ const Map> mapData = { }, // build2 - 'build2_base1': {'build': 'build2', 'x': 28.5, 'y': 0, 'z': 51.5, 'height': 1, 'width': 13, 'length': 26}, - 'build2_1f_room1': {'floor': 1, 'build': 'build2', 'x': 25, 'y': 1, 'z': 51.5, 'height': 3, 'width': 13, 'length': 19}, - 'build2_2f_room1': {'floor': 2, 'build': 'build2', 'x': 25, 'y': 4, 'z': 51.5, 'height': 3, 'width': 13, 'length': 19}, - 'build2_3f_room1': {'floor': 3, 'build': 'build2', 'x': 25, 'y': 7, 'z': 51.5, 'height': 3, 'width': 13, 'length': 19}, - 'build2_4f_room1': {'floor': 4, 'build': 'build2', 'x': 25, 'y': 10, 'z': 51.5, 'height': 3, 'width': 13, 'length': 19}, - 'build2_5f_room1': {'floor': 5, 'build': 'build2', 'x': 25, 'y': 13, 'z': 51.5, 'height': 3, 'width': 13, 'length': 19}, - 'build2_1f_toilet1': {'floor': 1, 'build': 'build2', 'x': 38, 'y': 1, 'z': 51.5, 'height': 3, 'width': 13, 'length': 7}, - 'build2_2f_toilet1': {'floor': 2, 'build': 'build2', 'x': 38, 'y': 4, 'z': 51.5, 'height': 3, 'width': 13, 'length': 7}, - 'build2_3f_toilet1': {'floor': 3, 'build': 'build2', 'x': 38, 'y': 7, 'z': 51.5, 'height': 3, 'width': 13, 'length': 7}, - 'build2_4f_toilet1': {'floor': 4, 'build': 'build2', 'x': 38, 'y': 10, 'z': 51.5, 'height': 3, 'width': 13, 'length': 7}, - 'build2_5f_toilet1': {'floor': 5, 'build': 'build2', 'x': 38, 'y': 13, 'z': 51.5, 'height': 3, 'width': 13, 'length': 7}, + 'build2_base1': { + 'build': 'build2', + 'x': 28.5, + 'y': 0, + 'z': 51.5, + 'height': 1, + 'width': 13, + 'length': 26 + }, + 'build2_1f_room1': { + 'floor': 1, + 'build': 'build2', + 'x': 25, + 'y': 1, + 'z': 51.5, + 'height': 3, + 'width': 13, + 'length': 19 + }, + 'build2_2f_room1': { + 'floor': 2, + 'build': 'build2', + 'x': 25, + 'y': 4, + 'z': 51.5, + 'height': 3, + 'width': 13, + 'length': 19 + }, + 'build2_3f_room1': { + 'floor': 3, + 'build': 'build2', + 'x': 25, + 'y': 7, + 'z': 51.5, + 'height': 3, + 'width': 13, + 'length': 19 + }, + 'build2_4f_room1': { + 'floor': 4, + 'build': 'build2', + 'x': 25, + 'y': 10, + 'z': 51.5, + 'height': 3, + 'width': 13, + 'length': 19 + }, + 'build2_5f_room1': { + 'floor': 5, + 'build': 'build2', + 'x': 25, + 'y': 13, + 'z': 51.5, + 'height': 3, + 'width': 13, + 'length': 19 + }, + 'build2_1f_toilet1': { + 'floor': 1, + 'build': 'build2', + 'x': 38, + 'y': 1, + 'z': 51.5, + 'height': 3, + 'width': 13, + 'length': 7 + }, + 'build2_2f_toilet1': { + 'floor': 2, + 'build': 'build2', + 'x': 38, + 'y': 4, + 'z': 51.5, + 'height': 3, + 'width': 13, + 'length': 7 + }, + 'build2_3f_toilet1': { + 'floor': 3, + 'build': 'build2', + 'x': 38, + 'y': 7, + 'z': 51.5, + 'height': 3, + 'width': 13, + 'length': 7 + }, + 'build2_4f_toilet1': { + 'floor': 4, + 'build': 'build2', + 'x': 38, + 'y': 10, + 'z': 51.5, + 'height': 3, + 'width': 13, + 'length': 7 + }, + 'build2_5f_toilet1': { + 'floor': 5, + 'build': 'build2', + 'x': 38, + 'y': 13, + 'z': 51.5, + 'height': 3, + 'width': 13, + 'length': 7 + }, // build3 'build3_stair1': { @@ -1008,210 +1524,1277 @@ const Map> mapData = { 'width': 16, 'length': 4, }, - 'build3_stair3': {'build': 'build3', 'x': 48.5, 'y': -2, 'z': -22, 'height': 21, 'width': 4, 'length': 14}, - // build3_b1 - 'build3_b1_aisle1': {'floor': -1, 'build': 'build3', 'x': 44.5, 'y': -2, 'z': 24, 'height': 3, 'width': 16, 'length': 6}, - 'build3_b1_room1': {'floor': -1, 'build': 'build3', 'x': 49.5, 'y': -2, 'z': 13.75, 'height': 3, 'width': 4.5, 'length': 16}, - 'build3_b1_room2': {'floor': -1, 'build': 'build3', 'x': 49.5, 'y': -2, 'z': 9.25, 'height': 3, 'width': 4.5, 'length': 16}, - 'build3_b1_room3': {'floor': -1, 'build': 'build3', 'x': 49.5, 'y': -2, 'z': 2.5, 'height': 3, 'width': 9, 'length': 16}, - 'build3_b1_room4': {'floor': -1, 'build': 'build3', 'x': 49.5, 'y': -2, 'z': -11, 'height': 3, 'width': 18, 'length': 16}, - 'build3_b1_room5': {'floor': -1, 'build': 'build3', 'x': 54.5, 'y': -2, 'z': 24, 'height': 3, 'width': 16, 'length': 6}, - 'build3_base1': {'build': 'build3', 'x': 40, 'y': 0, 'z': 66.5, 'height': 1, 'width': 17, 'length': 11, 'searchable': false}, - 'build3_base2': {'build': 'build3', 'x': 47.5, 'y': 0, 'z': 40.5, 'height': 1, 'width': 17, 'length': 12}, - 'build3_base3': { + 'build3_stair3': { 'build': 'build3', - 'x': 45, - 'y': 0, + 'x': 48.5, + 'y': -2, + 'z': -22, + 'height': 21, + 'width': 4, + 'length': 14 + }, + // build3_b1 + 'build3_b1_aisle1': { + 'floor': -1, + 'build': 'build3', + 'x': 44.5, + 'y': -2, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 6 + }, + 'build3_b1_room1': { + 'floor': -1, + 'build': 'build3', + 'x': 49.5, + 'y': -2, + 'z': 13.75, + 'height': 3, + 'width': 4.5, + 'length': 16 + }, + 'build3_b1_room2': { + 'floor': -1, + 'build': 'build3', + 'x': 49.5, + 'y': -2, + 'z': 9.25, + 'height': 3, + 'width': 4.5, + 'length': 16 + }, + 'build3_b1_room3': { + 'floor': -1, + 'build': 'build3', + 'x': 49.5, + 'y': -2, + 'z': 2.5, + 'height': 3, + 'width': 9, + 'length': 16 + }, + 'build3_b1_room4': { + 'floor': -1, + 'build': 'build3', + 'x': 49.5, + 'y': -2, + 'z': -11, + 'height': 3, + 'width': 18, + 'length': 16 + }, + 'build3_b1_room5': { + 'floor': -1, + 'build': 'build3', + 'x': 54.5, + 'y': -2, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 6 + }, + 'build3_base1': { + 'build': 'build3', + 'x': 40, + 'y': 0, + 'z': 66.5, + 'height': 1, + 'width': 17, + 'length': 11, + 'searchable': false + }, + 'build3_base2': { + 'build': 'build3', + 'x': 47.5, + 'y': 0, + 'z': 40.5, + 'height': 1, + 'width': 17, + 'length': 12 + }, + 'build3_base3': { + 'build': 'build3', + 'x': 45, + 'y': 0, 'z': 53.5, 'height': 1, 'width': 9, 'length': 7, }, // build3_1f - 'build3_1f_room1': {'floor': 1, 'build': 'build3', 'x': 40, 'y': 1, 'z': 66.5, 'height': 3, 'width': 17, 'length': 11}, - 'build3_1f_room2': {'floor': 1, 'build': 'build3', 'x': 47.5, 'y': 1, 'z': 40.5, 'height': 3, 'width': 17, 'length': 12}, - 'build3_1f_toilet1': {'floor': 1, 'build': 'build3', 'x': 54.5, 'y': 1, 'z': 24, 'height': 3, 'width': 16, 'length': 6}, - 'build3_1f_aisle1': {'floor': 1, 'build': 'build3', 'x': 44.5, 'y': 1, 'z': 24, 'height': 3, 'width': 16, 'length': 6}, - 'build3_1f_room3': {'floor': 1, 'build': 'build3', 'x': 49.5, 'y': 1, 'z': 11.5, 'height': 3, 'width': 9, 'length': 16}, - 'build3_1f_room4': {'floor': 1, 'build': 'build3', 'x': 49.5, 'y': 1, 'z': 2.5, 'height': 3, 'width': 9, 'length': 16}, - 'build3_1f_room5': {'floor': 1, 'build': 'build3', 'x': 49.5, 'y': 1, 'z': -6.5, 'height': 3, 'width': 9, 'length': 16}, - 'build3_1f_room6': {'floor': 1, 'build': 'build3', 'x': 49.5, 'y': 1, 'z': -15.5, 'height': 3, 'width': 9, 'length': 16}, - 'build3_1f_toilet2': {'floor': 1, 'build': 'build3', 'x': 48.5, 'y': 1, 'z': -30, 'height': 3, 'width': 12, 'length': 14}, + 'build3_1f_room1': { + 'floor': 1, + 'build': 'build3', + 'x': 40, + 'y': 1, + 'z': 66.5, + 'height': 3, + 'width': 17, + 'length': 11 + }, + 'build3_1f_room2': { + 'floor': 1, + 'build': 'build3', + 'x': 47.5, + 'y': 1, + 'z': 40.5, + 'height': 3, + 'width': 17, + 'length': 12 + }, + 'build3_1f_toilet1': { + 'floor': 1, + 'build': 'build3', + 'x': 54.5, + 'y': 1, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 6 + }, + 'build3_1f_aisle1': { + 'floor': 1, + 'build': 'build3', + 'x': 44.5, + 'y': 1, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 6 + }, + 'build3_1f_room3': { + 'floor': 1, + 'build': 'build3', + 'x': 49.5, + 'y': 1, + 'z': 11.5, + 'height': 3, + 'width': 9, + 'length': 16 + }, + 'build3_1f_room4': { + 'floor': 1, + 'build': 'build3', + 'x': 49.5, + 'y': 1, + 'z': 2.5, + 'height': 3, + 'width': 9, + 'length': 16 + }, + 'build3_1f_room5': { + 'floor': 1, + 'build': 'build3', + 'x': 49.5, + 'y': 1, + 'z': -6.5, + 'height': 3, + 'width': 9, + 'length': 16 + }, + 'build3_1f_room6': { + 'floor': 1, + 'build': 'build3', + 'x': 49.5, + 'y': 1, + 'z': -15.5, + 'height': 3, + 'width': 9, + 'length': 16 + }, + 'build3_1f_toilet2': { + 'floor': 1, + 'build': 'build3', + 'x': 48.5, + 'y': 1, + 'z': -30, + 'height': 3, + 'width': 12, + 'length': 14 + }, // build3_2f - 'build3_2f_room1': {'floor': 2, 'build': 'build3', 'x': 40, 'y': 4, 'z': 66.5, 'height': 3, 'width': 17, 'length': 11}, - 'build3_2f_room2': {'floor': 2, 'build': 'build3', 'x': 47.5, 'y': 4, 'z': 40.5, 'height': 3, 'width': 17, 'length': 12}, - 'build3_2f_toilet1': {'floor': 2, 'build': 'build3', 'x': 54.5, 'y': 4, 'z': 24, 'height': 3, 'width': 16, 'length': 6}, - 'build3_2f_aisle1': {'floor': 2, 'build': 'build3', 'x': 44.5, 'y': 4, 'z': 24, 'height': 3, 'width': 16, 'length': 6}, - 'build3_2f_room3': {'floor': 2, 'build': 'build3', 'x': 49.5, 'y': 4, 'z': 11.5, 'height': 3, 'width': 9, 'length': 16}, - 'build3_2f_room4': {'floor': 2, 'build': 'build3', 'x': 49.5, 'y': 4, 'z': 2.5, 'height': 3, 'width': 9, 'length': 16}, - 'build3_2f_room5': {'floor': 2, 'build': 'build3', 'x': 49.5, 'y': 4, 'z': -6.5, 'height': 3, 'width': 9, 'length': 16}, - 'build3_2f_room6': {'floor': 2, 'build': 'build3', 'x': 49.5, 'y': 4, 'z': -15.5, 'height': 3, 'width': 9, 'length': 16}, - 'build3_2f_toilet2': {'floor': 2, 'build': 'build3', 'x': 48.5, 'y': 4, 'z': -30, 'height': 3, 'width': 12, 'length': 14}, + 'build3_2f_room1': { + 'floor': 2, + 'build': 'build3', + 'x': 40, + 'y': 4, + 'z': 66.5, + 'height': 3, + 'width': 17, + 'length': 11 + }, + 'build3_2f_room2': { + 'floor': 2, + 'build': 'build3', + 'x': 47.5, + 'y': 4, + 'z': 40.5, + 'height': 3, + 'width': 17, + 'length': 12 + }, + 'build3_2f_toilet1': { + 'floor': 2, + 'build': 'build3', + 'x': 54.5, + 'y': 4, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 6 + }, + 'build3_2f_aisle1': { + 'floor': 2, + 'build': 'build3', + 'x': 44.5, + 'y': 4, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 6 + }, + 'build3_2f_room3': { + 'floor': 2, + 'build': 'build3', + 'x': 49.5, + 'y': 4, + 'z': 11.5, + 'height': 3, + 'width': 9, + 'length': 16 + }, + 'build3_2f_room4': { + 'floor': 2, + 'build': 'build3', + 'x': 49.5, + 'y': 4, + 'z': 2.5, + 'height': 3, + 'width': 9, + 'length': 16 + }, + 'build3_2f_room5': { + 'floor': 2, + 'build': 'build3', + 'x': 49.5, + 'y': 4, + 'z': -6.5, + 'height': 3, + 'width': 9, + 'length': 16 + }, + 'build3_2f_room6': { + 'floor': 2, + 'build': 'build3', + 'x': 49.5, + 'y': 4, + 'z': -15.5, + 'height': 3, + 'width': 9, + 'length': 16 + }, + 'build3_2f_toilet2': { + 'floor': 2, + 'build': 'build3', + 'x': 48.5, + 'y': 4, + 'z': -30, + 'height': 3, + 'width': 12, + 'length': 14 + }, // build3_3f - 'build3_3f_room1': {'floor': 3, 'build': 'build3', 'x': 40, 'y': 7, 'z': 66.5, 'height': 3, 'width': 17, 'length': 11}, - 'build3_3f_room2': {'floor': 3, 'build': 'build3', 'x': 47.5, 'y': 7, 'z': 40.5, 'height': 3, 'width': 17, 'length': 12}, - 'build3_3f_toilet1': {'floor': 3, 'build': 'build3', 'x': 54.5, 'y': 7, 'z': 24, 'height': 3, 'width': 16, 'length': 6}, - 'build3_3f_aisle1': {'floor': 3, 'build': 'build3', 'x': 44.5, 'y': 7, 'z': 24, 'height': 3, 'width': 16, 'length': 6}, - 'build3_3f_room3': {'floor': 3, 'build': 'build3', 'x': 49.5, 'y': 7, 'z': 11.5, 'height': 3, 'width': 9, 'length': 16}, - 'build3_3f_room4': {'floor': 3, 'build': 'build3', 'x': 49.5, 'y': 7, 'z': 2.5, 'height': 3, 'width': 9, 'length': 16}, - 'build3_3f_room5': {'floor': 3, 'build': 'build3', 'x': 49.5, 'y': 7, 'z': -6.5, 'height': 3, 'width': 9, 'length': 16}, - 'build3_3f_room6': {'floor': 3, 'build': 'build3', 'x': 49.5, 'y': 7, 'z': -15.5, 'height': 3, 'width': 9, 'length': 16}, - 'build3_3f_toilet2': {'floor': 3, 'build': 'build3', 'x': 48.5, 'y': 7, 'z': -30, 'height': 3, 'width': 12, 'length': 14}, + 'build3_3f_room1': { + 'floor': 3, + 'build': 'build3', + 'x': 40, + 'y': 7, + 'z': 66.5, + 'height': 3, + 'width': 17, + 'length': 11 + }, + 'build3_3f_room2': { + 'floor': 3, + 'build': 'build3', + 'x': 47.5, + 'y': 7, + 'z': 40.5, + 'height': 3, + 'width': 17, + 'length': 12 + }, + 'build3_3f_toilet1': { + 'floor': 3, + 'build': 'build3', + 'x': 54.5, + 'y': 7, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 6 + }, + 'build3_3f_aisle1': { + 'floor': 3, + 'build': 'build3', + 'x': 44.5, + 'y': 7, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 6 + }, + 'build3_3f_room3': { + 'floor': 3, + 'build': 'build3', + 'x': 49.5, + 'y': 7, + 'z': 11.5, + 'height': 3, + 'width': 9, + 'length': 16 + }, + 'build3_3f_room4': { + 'floor': 3, + 'build': 'build3', + 'x': 49.5, + 'y': 7, + 'z': 2.5, + 'height': 3, + 'width': 9, + 'length': 16 + }, + 'build3_3f_room5': { + 'floor': 3, + 'build': 'build3', + 'x': 49.5, + 'y': 7, + 'z': -6.5, + 'height': 3, + 'width': 9, + 'length': 16 + }, + 'build3_3f_room6': { + 'floor': 3, + 'build': 'build3', + 'x': 49.5, + 'y': 7, + 'z': -15.5, + 'height': 3, + 'width': 9, + 'length': 16 + }, + 'build3_3f_toilet2': { + 'floor': 3, + 'build': 'build3', + 'x': 48.5, + 'y': 7, + 'z': -30, + 'height': 3, + 'width': 12, + 'length': 14 + }, // build3_4f - 'build3_4f_room1': {'floor': 4, 'build': 'build3', 'x': 40, 'y': 10, 'z': 66.5, 'height': 3, 'width': 17, 'length': 11}, - 'build3_4f_room2': {'floor': 4, 'build': 'build3', 'x': 47.5, 'y': 10, 'z': 40.5, 'height': 3, 'width': 17, 'length': 12}, - 'build3_4f_toilet1': {'floor': 4, 'build': 'build3', 'x': 54.5, 'y': 10, 'z': 24, 'height': 3, 'width': 16, 'length': 6}, - 'build3_4f_aisle1': {'floor': 4, 'build': 'build3', 'x': 44.5, 'y': 10, 'z': 24, 'height': 3, 'width': 16, 'length': 6}, - 'build3_4f_room3': { + 'build3_4f_room1': { 'floor': 4, 'build': 'build3', - 'x': 49.5, + 'x': 40, 'y': 10, - 'z': 7, - // 'z': 11.5, + 'z': 66.5, + 'height': 3, + 'width': 17, + 'length': 11 + }, + 'build3_4f_room2': { + 'floor': 4, + 'build': 'build3', + 'x': 47.5, + 'y': 10, + 'z': 40.5, + 'height': 3, + 'width': 17, + 'length': 12 + }, + 'build3_4f_toilet1': { + 'floor': 4, + 'build': 'build3', + 'x': 54.5, + 'y': 10, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 6 + }, + 'build3_4f_aisle1': { + 'floor': 4, + 'build': 'build3', + 'x': 44.5, + 'y': 10, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 6 + }, + 'build3_4f_room3': { + 'floor': 4, + 'build': 'build3', + 'x': 49.5, + 'y': 10, + 'z': 7, + // 'z': 11.5, + 'height': 3, + 'width': 18, + // 'width': 9, + 'length': 16 + }, + // 'build3_4f_room4': { + // 'floor': 4, + // 'build': 'build3', + // 'x': 49.5, + // 'y': 10, + // 'z': 2.5, + // 'height': 3, + // 'width': 9, + // 'length': 16 + // }, + 'build3_4f_room5': { + 'floor': 4, + 'build': 'build3', + 'x': 49.5, + 'y': 10, + 'z': -6.5, + 'height': 3, + 'width': 9, + 'length': 16 + }, + 'build3_4f_room6': { + 'floor': 4, + 'build': 'build3', + 'x': 49.5, + 'y': 10, + 'z': -15.5, + 'height': 3, + 'width': 9, + 'length': 16 + }, + 'build3_4f_toilet2': { + 'floor': 4, + 'build': 'build3', + 'x': 48.5, + 'y': 10, + 'z': -30, + 'height': 3, + 'width': 12, + 'length': 14 + }, + // build3_5f + 'build3_5f_room1': { + 'floor': 5, + 'build': 'build3', + 'x': 40, + 'y': 13, + 'z': 66.5, + 'height': 3, + 'width': 17, + 'length': 11 + }, + 'build3_5f_room2': { + 'floor': 5, + 'build': 'build3', + 'x': 47.5, + 'y': 13, + 'z': 40.5, + 'height': 3, + 'width': 17, + 'length': 12 + }, + 'build3_5f_toilet1': { + 'floor': 5, + 'build': 'build3', + 'x': 54.5, + 'y': 13, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 6 + }, + 'build3_5f_aisle1': { + 'floor': 5, + 'build': 'build3', + 'x': 44.5, + 'y': 13, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 6 + }, + 'build3_5f_room3': { + 'floor': 5, + 'build': 'build3', + 'x': 49.5, + 'y': 13, + 'z': 11.5, + 'height': 3, + 'width': 9, + 'length': 16 + }, + 'build3_5f_room4': { + 'floor': 5, + 'build': 'build3', + 'x': 49.5, + 'y': 13, + 'z': -0.5, + // 'z': 2.5, + 'height': 3, + 'width': 15, + // 'width': 9, + 'length': 16 + }, + // 'build3_5f_room5': { + // 'floor': 5, + // 'build': 'build3', + // 'x': 49.5, + // 'y': 13, + // 'z': -6.5, + // 'height': 3, + // 'width': 9, + // 'length': 16 + // }, + 'build3_5f_room6': { + 'floor': 5, + 'build': 'build3', + 'x': 49.5, + 'y': 13, + 'z': -14, + // 'z': -15.5, + 'height': 3, + 'width': 12, + // 'width': 9, + 'length': 16 + }, + 'build3_5f_toilet2': { + 'floor': 5, + 'build': 'build3', + 'x': 48.5, + 'y': 13, + 'z': -30, + 'height': 3, + 'width': 12, + 'length': 14 + }, + + // build4 + 'build4_stair1': { + 'build': 'build4', + 'x': -22, + 'y': -2, + 'z': -19.5, + 'height': 18, + 'width': 10, + 'length': 10 + }, + // build4_b1 + 'build4_b1_room1': { + 'floor': -1, + 'build': 'build4', + 'x': 10, + 'y': -2, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 63 + }, + 'build4_b1_room1_###1': { + 'floor': -1, + 'build': 'build4', + 'x': 48.5, + 'y': -2, + 'z': -30, + 'height': 3, + 'width': 12, + 'length': 14 + }, + // build4_1f + 'build4_1f_room1': { + 'floor': 1, + 'build': 'build4', + 'x': 37, + 'y': 1, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_1f_room2': { + 'floor': 1, + 'build': 'build4', + 'x': 28, + 'y': 1, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_1f_aisle1': { + 'floor': 1, + 'build': 'build4', + 'x': 21.25, + 'y': 1, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 4.5 + }, + 'build4_1f_room3': { + 'floor': 1, + 'build': 'build4', + 'x': 14.5, + 'y': 1, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_1f_room4': { + 'floor': 1, + 'build': 'build4', + 'x': 5.5, + 'y': 1, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_1f_room5': { + 'floor': 1, + 'build': 'build4', + 'x': -3.5, + 'y': 1, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_1f_room6': { + 'floor': 1, + 'build': 'build4', + 'x': -12.5, + 'y': 1, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_1f_aisle2': { + 'floor': 1, + 'build': 'build4', + 'x': -19.25, + 'y': 1, + 'z': -30.25, + 'height': 3, + 'width': 11.5, + 'length': 4.5 + }, + // build4_2f + 'build4_2f_room1': { + 'floor': 2, + 'build': 'build4', + 'x': 37, + 'y': 4, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_2f_room2': { + 'floor': 2, + 'build': 'build4', + 'x': 28, + 'y': 4, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_2f_aisle1': { + 'floor': 2, + 'build': 'build4', + 'x': 21.25, + 'y': 4, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 4.5 + }, + 'build4_2f_room3': { + 'floor': 2, + 'build': 'build4', + 'x': 14.5, + 'y': 4, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_2f_room4': { + 'floor': 2, + 'build': 'build4', + 'x': 5.5, + 'y': 4, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_2f_room5': { + 'floor': 2, + 'build': 'build4', + 'x': -3.5, + 'y': 4, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_2f_room6': { + 'floor': 2, + 'build': 'build4', + 'x': -12.5, + 'y': 4, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_2f_aisle2': { + 'floor': 2, + 'build': 'build4', + 'x': -19.25, + 'y': 4, + 'z': -30.25, + 'height': 3, + 'width': 11.5, + 'length': 4.5 + }, + // build4_3f + 'build4_3f_room1': { + 'floor': 3, + 'build': 'build4', + 'x': 37, + 'y': 7, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_3f_room2': { + 'floor': 3, + 'build': 'build4', + 'x': 28, + 'y': 7, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_3f_aisle1': { + 'floor': 3, + 'build': 'build4', + 'x': 21.25, + 'y': 7, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 4.5 + }, + 'build4_3f_room3': { + 'floor': 3, + 'build': 'build4', + 'x': 14.5, + 'y': 7, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_3f_room4': { + 'floor': 3, + 'build': 'build4', + 'x': 5.5, + 'y': 7, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_3f_room5': { + 'floor': 3, + 'build': 'build4', + 'x': -3.5, + 'y': 7, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_3f_room6': { + 'floor': 3, + 'build': 'build4', + 'x': -12.5, + 'y': 7, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_3f_aisle2': { + 'floor': 3, + 'build': 'build4', + 'x': -19.25, + 'y': 7, + 'z': -30.25, + 'height': 3, + 'width': 11.5, + 'length': 4.5 + }, + // build4_4f + 'build4_4f_room1': { + 'floor': 4, + 'build': 'build4', + 'x': 37, + 'y': 10, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_4f_room2': { + 'floor': 4, + 'build': 'build4', + 'x': 28, + 'y': 10, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_4f_aisle1': { + 'floor': 4, + 'build': 'build4', + 'x': 21.25, + 'y': 10, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 4.5 + }, + 'build4_4f_room3': { + 'floor': 4, + 'build': 'build4', + 'x': 14.5, + 'y': 10, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_4f_room4': { + 'floor': 4, + 'build': 'build4', + 'x': 5.5, + 'y': 10, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_4f_room5': { + 'floor': 4, + 'build': 'build4', + 'x': -3.5, + 'y': 10, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_4f_room6': { + 'floor': 4, + 'build': 'build4', + 'x': -12.5, + 'y': 10, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_4f_aisle2': { + 'floor': 4, + 'build': 'build4', + 'x': -19.25, + 'y': 10, + 'z': -30.25, + 'height': 3, + 'width': 11.5, + 'length': 4.5 + }, + // build4_5f + 'build4_5f_room1': { + 'floor': 5, + 'build': 'build4', + 'x': 37, + 'y': 13, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_5f_room2': { + 'floor': 5, + 'build': 'build4', + 'x': 28, + 'y': 13, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_5f_aisle1': { + 'floor': 5, + 'build': 'build4', + 'x': 21.25, + 'y': 13, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 4.5 + }, + 'build4_5f_room3': { + 'floor': 5, + 'build': 'build4', + 'x': 14.5, + 'y': 13, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_5f_room4': { + 'floor': 5, + 'build': 'build4', + 'x': 5.5, + 'y': 13, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_5f_room5': { + 'floor': 5, + 'build': 'build4', + 'x': -3.5, + 'y': 13, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_5f_room6': { + 'floor': 5, + 'build': 'build4', + 'x': -12.5, + 'y': 13, + 'z': -28, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build4_5f_aisle2': { + 'floor': 5, + 'build': 'build4', + 'x': -19.25, + 'y': 13, + 'z': -30.25, + 'height': 3, + 'width': 11.5, + 'length': 4.5 + }, + + // build5 + 'build5_stair1': { + 'build': 'build5', + 'x': -22, + 'y': -2, + 'z': 15.5, + 'height': 18, + 'width': 10, + 'length': 10 + }, + // build5_b1 + 'build5_b1_room1': { + 'floor': -1, + 'build': 'build5', + 'x': 37, + 'y': -2, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_b1_room2': { + 'floor': -1, + 'build': 'build5', + 'x': 5.5, + 'y': -2, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 54 + }, + // build5_1f + 'build5_1f_room1': { + 'floor': 1, + 'build': 'build5', + 'x': 37, + 'y': 1, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_1f_room2': { + 'floor': 1, + 'build': 'build5', + 'x': 28, + 'y': 1, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_1f_aisle1': { + 'floor': 1, + 'build': 'build5', + 'x': 21.25, + 'y': 1, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 4.5 + }, + 'build5_1f_room3': { + 'floor': 1, + 'build': 'build5', + 'x': 14.5, + 'y': 1, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_1f_room4': { + 'floor': 1, + 'build': 'build5', + 'x': 5.5, + 'y': 1, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_1f_room5': { + 'floor': 1, + 'build': 'build5', + 'x': -3.5, + 'y': 1, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_1f_room6': { + 'floor': 1, + 'build': 'build5', + 'x': -12.5, + 'y': 1, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_1f_aisle2': { + 'floor': 1, + 'build': 'build5', + 'x': -19.25, + 'y': 1, + 'z': 26.25, + 'height': 3, + 'width': 11.5, + 'length': 4.5 + }, + // build5_2f + 'build5_2f_room1': { + 'floor': 2, + 'build': 'build5', + 'x': 37, + 'y': 4, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_2f_room2': { + 'floor': 2, + 'build': 'build5', + 'x': 28, + 'y': 4, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_2f_aisle1': { + 'floor': 2, + 'build': 'build5', + 'x': 21.25, + 'y': 4, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 4.5 + }, + 'build5_2f_room3': { + 'floor': 2, + 'build': 'build5', + 'x': 14.5, + 'y': 4, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_2f_room4': { + 'floor': 2, + 'build': 'build5', + 'x': 5.5, + 'y': 4, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_2f_room5': { + 'floor': 2, + 'build': 'build5', + 'x': -3.5, + 'y': 4, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_2f_room6': { + 'floor': 2, + 'build': 'build5', + 'x': -12.5, + 'y': 4, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_2f_aisle2': { + 'floor': 2, + 'build': 'build5', + 'x': -19.25, + 'y': 4, + 'z': 26.25, + 'height': 3, + 'width': 11.5, + 'length': 4.5 + }, + // build5_3f + 'build5_3f_room1': { + 'floor': 3, + 'build': 'build5', + 'x': 37, + 'y': 7, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_3f_room2': { + 'floor': 3, + 'build': 'build5', + 'x': 28, + 'y': 7, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_3f_aisle1': { + 'floor': 3, + 'build': 'build5', + 'x': 21.25, + 'y': 7, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 4.5 + }, + 'build5_3f_room3': { + 'floor': 3, + 'build': 'build5', + 'x': 14.5, + 'y': 7, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_3f_room4': { + 'floor': 3, + 'build': 'build5', + 'x': 5.5, + 'y': 7, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_3f_room5': { + 'floor': 3, + 'build': 'build5', + 'x': -3.5, + 'y': 7, + 'z': 24, 'height': 3, - 'width': 18, - // 'width': 9, - 'length': 16 + 'width': 16, + 'length': 9 }, - // 'build3_4f_room4': { - // 'floor': 4, - // 'build': 'build3', - // 'x': 49.5, - // 'y': 10, - // 'z': 2.5, - // 'height': 3, - // 'width': 9, - // 'length': 16 - // }, - 'build3_4f_room5': {'floor': 4, 'build': 'build3', 'x': 49.5, 'y': 10, 'z': -6.5, 'height': 3, 'width': 9, 'length': 16}, - 'build3_4f_room6': {'floor': 4, 'build': 'build3', 'x': 49.5, 'y': 10, 'z': -15.5, 'height': 3, 'width': 9, 'length': 16}, - 'build3_4f_toilet2': {'floor': 4, 'build': 'build3', 'x': 48.5, 'y': 10, 'z': -30, 'height': 3, 'width': 12, 'length': 14}, - // build3_5f - 'build3_5f_room1': {'floor': 5, 'build': 'build3', 'x': 40, 'y': 13, 'z': 66.5, 'height': 3, 'width': 17, 'length': 11}, - 'build3_5f_room2': {'floor': 5, 'build': 'build3', 'x': 47.5, 'y': 13, 'z': 40.5, 'height': 3, 'width': 17, 'length': 12}, - 'build3_5f_toilet1': {'floor': 5, 'build': 'build3', 'x': 54.5, 'y': 13, 'z': 24, 'height': 3, 'width': 16, 'length': 6}, - 'build3_5f_aisle1': {'floor': 5, 'build': 'build3', 'x': 44.5, 'y': 13, 'z': 24, 'height': 3, 'width': 16, 'length': 6}, - 'build3_5f_room3': {'floor': 5, 'build': 'build3', 'x': 49.5, 'y': 13, 'z': 11.5, 'height': 3, 'width': 9, 'length': 16}, - 'build3_5f_room4': { - 'floor': 5, - 'build': 'build3', - 'x': 49.5, - 'y': 13, - 'z': -0.5, - // 'z': 2.5, + 'build5_3f_room6': { + 'floor': 3, + 'build': 'build5', + 'x': -12.5, + 'y': 7, + 'z': 24, 'height': 3, - 'width': 15, - // 'width': 9, - 'length': 16 + 'width': 16, + 'length': 9 }, - // 'build3_5f_room5': { - // 'floor': 5, - // 'build': 'build3', - // 'x': 49.5, - // 'y': 13, - // 'z': -6.5, - // 'height': 3, - // 'width': 9, - // 'length': 16 - // }, - 'build3_5f_room6': { - 'floor': 5, - 'build': 'build3', - 'x': 49.5, - 'y': 13, - 'z': -14, - // 'z': -15.5, + 'build5_3f_aisle2': { + 'floor': 3, + 'build': 'build5', + 'x': -19.25, + 'y': 7, + 'z': 26.25, 'height': 3, - 'width': 12, - // 'width': 9, - 'length': 16 + 'width': 11.5, + 'length': 4.5 }, - 'build3_5f_toilet2': {'floor': 5, 'build': 'build3', 'x': 48.5, 'y': 13, 'z': -30, 'height': 3, 'width': 12, 'length': 14}, - - // build4 - 'build4_stair1': {'build': 'build4', 'x': -22, 'y': -2, 'z': -19.5, 'height': 18, 'width': 10, 'length': 10}, - // build4_b1 - 'build4_b1_room1': {'floor': -1, 'build': 'build4', 'x': 10, 'y': -2, 'z': -28, 'height': 3, 'width': 16, 'length': 63}, - 'build4_b1_room1_###1': {'floor': -1, 'build': 'build4', 'x': 48.5, 'y': -2, 'z': -30, 'height': 3, 'width': 12, 'length': 14}, - // build4_1f - 'build4_1f_room1': {'floor': 1, 'build': 'build4', 'x': 37, 'y': 1, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_1f_room2': {'floor': 1, 'build': 'build4', 'x': 28, 'y': 1, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_1f_aisle1': {'floor': 1, 'build': 'build4', 'x': 21.25, 'y': 1, 'z': -28, 'height': 3, 'width': 16, 'length': 4.5}, - 'build4_1f_room3': {'floor': 1, 'build': 'build4', 'x': 14.5, 'y': 1, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_1f_room4': {'floor': 1, 'build': 'build4', 'x': 5.5, 'y': 1, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_1f_room5': {'floor': 1, 'build': 'build4', 'x': -3.5, 'y': 1, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_1f_room6': {'floor': 1, 'build': 'build4', 'x': -12.5, 'y': 1, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_1f_aisle2': {'floor': 1, 'build': 'build4', 'x': -19.25, 'y': 1, 'z': -30.25, 'height': 3, 'width': 11.5, 'length': 4.5}, - // build4_2f - 'build4_2f_room1': {'floor': 2, 'build': 'build4', 'x': 37, 'y': 4, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_2f_room2': {'floor': 2, 'build': 'build4', 'x': 28, 'y': 4, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_2f_aisle1': {'floor': 2, 'build': 'build4', 'x': 21.25, 'y': 4, 'z': -28, 'height': 3, 'width': 16, 'length': 4.5}, - 'build4_2f_room3': {'floor': 2, 'build': 'build4', 'x': 14.5, 'y': 4, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_2f_room4': {'floor': 2, 'build': 'build4', 'x': 5.5, 'y': 4, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_2f_room5': {'floor': 2, 'build': 'build4', 'x': -3.5, 'y': 4, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_2f_room6': {'floor': 2, 'build': 'build4', 'x': -12.5, 'y': 4, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_2f_aisle2': {'floor': 2, 'build': 'build4', 'x': -19.25, 'y': 4, 'z': -30.25, 'height': 3, 'width': 11.5, 'length': 4.5}, - // build4_3f - 'build4_3f_room1': {'floor': 3, 'build': 'build4', 'x': 37, 'y': 7, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_3f_room2': {'floor': 3, 'build': 'build4', 'x': 28, 'y': 7, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_3f_aisle1': {'floor': 3, 'build': 'build4', 'x': 21.25, 'y': 7, 'z': -28, 'height': 3, 'width': 16, 'length': 4.5}, - 'build4_3f_room3': {'floor': 3, 'build': 'build4', 'x': 14.5, 'y': 7, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_3f_room4': {'floor': 3, 'build': 'build4', 'x': 5.5, 'y': 7, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_3f_room5': {'floor': 3, 'build': 'build4', 'x': -3.5, 'y': 7, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_3f_room6': {'floor': 3, 'build': 'build4', 'x': -12.5, 'y': 7, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_3f_aisle2': {'floor': 3, 'build': 'build4', 'x': -19.25, 'y': 7, 'z': -30.25, 'height': 3, 'width': 11.5, 'length': 4.5}, - // build4_4f - 'build4_4f_room1': {'floor': 4, 'build': 'build4', 'x': 37, 'y': 10, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_4f_room2': {'floor': 4, 'build': 'build4', 'x': 28, 'y': 10, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_4f_aisle1': {'floor': 4, 'build': 'build4', 'x': 21.25, 'y': 10, 'z': -28, 'height': 3, 'width': 16, 'length': 4.5}, - 'build4_4f_room3': {'floor': 4, 'build': 'build4', 'x': 14.5, 'y': 10, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_4f_room4': {'floor': 4, 'build': 'build4', 'x': 5.5, 'y': 10, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_4f_room5': {'floor': 4, 'build': 'build4', 'x': -3.5, 'y': 10, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_4f_room6': {'floor': 4, 'build': 'build4', 'x': -12.5, 'y': 10, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_4f_aisle2': {'floor': 4, 'build': 'build4', 'x': -19.25, 'y': 10, 'z': -30.25, 'height': 3, 'width': 11.5, 'length': 4.5}, - // build4_5f - 'build4_5f_room1': {'floor': 5, 'build': 'build4', 'x': 37, 'y': 13, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_5f_room2': {'floor': 5, 'build': 'build4', 'x': 28, 'y': 13, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_5f_aisle1': {'floor': 5, 'build': 'build4', 'x': 21.25, 'y': 13, 'z': -28, 'height': 3, 'width': 16, 'length': 4.5}, - 'build4_5f_room3': {'floor': 5, 'build': 'build4', 'x': 14.5, 'y': 13, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_5f_room4': {'floor': 5, 'build': 'build4', 'x': 5.5, 'y': 13, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_5f_room5': {'floor': 5, 'build': 'build4', 'x': -3.5, 'y': 13, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_5f_room6': {'floor': 5, 'build': 'build4', 'x': -12.5, 'y': 13, 'z': -28, 'height': 3, 'width': 16, 'length': 9}, - 'build4_5f_aisle2': {'floor': 5, 'build': 'build4', 'x': -19.25, 'y': 13, 'z': -30.25, 'height': 3, 'width': 11.5, 'length': 4.5}, - - // build5 - 'build5_stair1': {'build': 'build5', 'x': -22, 'y': -2, 'z': 15.5, 'height': 18, 'width': 10, 'length': 10}, - // build5_b1 - 'build5_b1_room1': {'floor': -1, 'build': 'build5', 'x': 37, 'y': -2, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_b1_room2': {'floor': -1, 'build': 'build5', 'x': 5.5, 'y': -2, 'z': 24, 'height': 3, 'width': 16, 'length': 54}, - // build5_1f - 'build5_1f_room1': {'floor': 1, 'build': 'build5', 'x': 37, 'y': 1, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_1f_room2': {'floor': 1, 'build': 'build5', 'x': 28, 'y': 1, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_1f_aisle1': {'floor': 1, 'build': 'build5', 'x': 21.25, 'y': 1, 'z': 24, 'height': 3, 'width': 16, 'length': 4.5}, - 'build5_1f_room3': {'floor': 1, 'build': 'build5', 'x': 14.5, 'y': 1, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_1f_room4': {'floor': 1, 'build': 'build5', 'x': 5.5, 'y': 1, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_1f_room5': {'floor': 1, 'build': 'build5', 'x': -3.5, 'y': 1, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_1f_room6': {'floor': 1, 'build': 'build5', 'x': -12.5, 'y': 1, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_1f_aisle2': {'floor': 1, 'build': 'build5', 'x': -19.25, 'y': 1, 'z': 26.25, 'height': 3, 'width': 11.5, 'length': 4.5}, - // build5_2f - 'build5_2f_room1': {'floor': 2, 'build': 'build5', 'x': 37, 'y': 4, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_2f_room2': {'floor': 2, 'build': 'build5', 'x': 28, 'y': 4, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_2f_aisle1': {'floor': 2, 'build': 'build5', 'x': 21.25, 'y': 4, 'z': 24, 'height': 3, 'width': 16, 'length': 4.5}, - 'build5_2f_room3': {'floor': 2, 'build': 'build5', 'x': 14.5, 'y': 4, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_2f_room4': {'floor': 2, 'build': 'build5', 'x': 5.5, 'y': 4, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_2f_room5': {'floor': 2, 'build': 'build5', 'x': -3.5, 'y': 4, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_2f_room6': {'floor': 2, 'build': 'build5', 'x': -12.5, 'y': 4, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_2f_aisle2': {'floor': 2, 'build': 'build5', 'x': -19.25, 'y': 4, 'z': 26.25, 'height': 3, 'width': 11.5, 'length': 4.5}, - // build5_3f - 'build5_3f_room1': {'floor': 3, 'build': 'build5', 'x': 37, 'y': 7, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_3f_room2': {'floor': 3, 'build': 'build5', 'x': 28, 'y': 7, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_3f_aisle1': {'floor': 3, 'build': 'build5', 'x': 21.25, 'y': 7, 'z': 24, 'height': 3, 'width': 16, 'length': 4.5}, - 'build5_3f_room3': {'floor': 3, 'build': 'build5', 'x': 14.5, 'y': 7, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_3f_room4': {'floor': 3, 'build': 'build5', 'x': 5.5, 'y': 7, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_3f_room5': {'floor': 3, 'build': 'build5', 'x': -3.5, 'y': 7, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_3f_room6': {'floor': 3, 'build': 'build5', 'x': -12.5, 'y': 7, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_3f_aisle2': {'floor': 3, 'build': 'build5', 'x': -19.25, 'y': 7, 'z': 26.25, 'height': 3, 'width': 11.5, 'length': 4.5}, // build5_4f 'build5_4f_room1': { 'floor': 4, @@ -1235,7 +2818,16 @@ const Map> mapData = { // 'width': 16, // 'length': 9 // }, - 'build5_4f_aisle1': {'floor': 4, 'build': 'build5', 'x': 21.25, 'y': 10, 'z': 24, 'height': 3, 'width': 16, 'length': 4.5}, + 'build5_4f_aisle1': { + 'floor': 4, + 'build': 'build5', + 'x': 21.25, + 'y': 10, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 4.5 + }, 'build5_4f_room3': { 'floor': 4, 'build': 'build5', @@ -1278,11 +2870,46 @@ const Map> mapData = { // 'width': 16, // 'length': 9 // }, - 'build5_4f_aisle2': {'floor': 4, 'build': 'build5', 'x': -19.25, 'y': 10, 'z': 26.25, 'height': 3, 'width': 11.5, 'length': 4.5}, + 'build5_4f_aisle2': { + 'floor': 4, + 'build': 'build5', + 'x': -19.25, + 'y': 10, + 'z': 26.25, + 'height': 3, + 'width': 11.5, + 'length': 4.5 + }, // build5_5f - 'build5_5f_room1': {'floor': 5, 'build': 'build5', 'x': 37, 'y': 13, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_5f_room1_###1': {'floor': 6, 'build': 'build5', 'x': 37, 'y': 16, 'z': 25.5, 'height': 5, 'width': 13, 'length': 9}, - 'build5_5f_room1_###2': {'floor': 6, 'build': 'build5', 'x': 37, 'y': 21, 'z': 24, 'radius': 3, 'shape': 'ball'}, + 'build5_5f_room1': { + 'floor': 5, + 'build': 'build5', + 'x': 37, + 'y': 13, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_5f_room1_###1': { + 'floor': 6, + 'build': 'build5', + 'x': 37, + 'y': 16, + 'z': 25.5, + 'height': 5, + 'width': 13, + 'length': 9 + }, + 'build5_5f_room1_###2': { + 'floor': 6, + 'build': 'build5', + 'x': 37, + 'y': 21, + 'z': 24, + 'radius': 3, + 'shape': 'ball' + }, 'build5_5f_room2': { 'floor': 5, 'build': 'build5', @@ -1311,65 +2938,379 @@ const Map> mapData = { 'y': 13, 'z': 24, 'height': 3, - 'width': 16, - 'length': 18 - // 'length': 9 + 'width': 16, + 'length': 18 + // 'length': 9 + }, + // 'build5_5f_room4': { + // 'floor': 5, + // 'build': 'build5', + // 'x': 5.5, + // 'y': 13, + // 'z': 24, + // 'height': 3, + // 'width': 16, + // 'length': 9 + // }, + 'build5_5f_room5': { + 'floor': 5, + 'build': 'build5', + 'x': -3.5, + 'y': 13, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_5f_room6': { + 'floor': 5, + 'build': 'build5', + 'x': -12.5, + 'y': 13, + 'z': 24, + 'height': 3, + 'width': 16, + 'length': 9 + }, + 'build5_5f_aisle2': { + 'floor': 5, + 'build': 'build5', + 'x': -19.25, + 'y': 13, + 'z': 26.25, + 'height': 3, + 'width': 11.5, + 'length': 4.5 + }, + + // build6 + 'build6_base1': { + 'build': 'build6', + 'x': -60, + 'y': 0, + 'z': 0, + 'height': 1, + 'width': 35, + 'length': 25 + }, + 'build6_elevator1': { + 'build': 'build6', + 'x': -56, + 'y': 1, + 'z': -8, + 'height': 18, + 'width': 3, + 'length': 3 + }, + 'build6_stair1': { + 'build': 'build6', + 'x': -51, + 'y': 1, + 'z': -8, + 'height': 18, + 'width': 3, + 'length': 7 + }, + 'build6_stair2': { + 'build': 'build6', + 'x': -73.75, + 'y': 0, + 'z': 0, + 'height': 17, + 'width': 16, + 'length': 2.5 + }, + // build6_1f + 'build6_1f_toilet1': { + 'floor': 1, + 'build': 'build6', + 'x': -52.5, + 'y': 1, + 'z': -13.5, + 'height': 3, + 'width': 8, + 'length': 10 + }, + 'build6_1f_room1': { + 'floor': 1, + 'build': 'build6', + 'x': -60, + 'y': 1, + 'z': 11.5, + 'height': 6, + 'width': 12, + 'length': 25 + }, + 'build6_1f_room2': { + 'floor': 1, + 'build': 'build6', + 'x': -57.5, + 'y': 1, + 'z': -0.5, + 'height': 3, + 'width': 12, + 'length': 10 + }, + 'build6_1f_room3': { + 'floor': 1, + 'build': 'build6', + 'x': -67.5, + 'y': 1, + 'z': -0.5, + 'height': 3, + 'width': 12, + 'length': 10 + }, + 'build6_1f_room4': { + 'floor': 1, + 'build': 'build6', + 'x': -67.5, + 'y': 1, + 'z': -12, + 'height': 3, + 'width': 11, + 'length': 10 + }, + 'build6_1f_room5': { + 'floor': 1, + 'build': 'build6', + 'x': -60, + 'y': 1, + 'z': -12, + 'height': 3, + 'width': 11, + 'length': 5 + }, + // build6_2f + 'build6_2f_toilet1': { + 'floor': 1, + 'build': 'build6', + 'x': -52.5, + 'y': 4, + 'z': -13.5, + 'height': 3, + 'width': 8, + 'length': 10 + }, + 'build6_2f_room2': { + 'floor': 1, + 'build': 'build6', + 'x': -62.5, + 'y': 4, + 'z': -0.5, + 'height': 3, + 'width': 12, + 'length': 20 + }, + 'build6_2f_room2_###1': { + 'floor': 1, + 'build': 'build6', + 'x': -65, + 'y': 4, + 'z': -12, + 'height': 3, + 'width': 11, + 'length': 15 + }, + // build6_3f + 'build6_3f_toilet1': { + 'floor': 1, + 'build': 'build6', + 'x': -52.5, + 'y': 7, + 'z': -13.5, + 'height': 3, + 'width': 8, + 'length': 10 + }, + 'build6_3f_room1_###1': { + 'floor': 3, + 'build': 'build6', + 'x': -60, + 'y': 7, + 'z': 11.5, + 'height': 3, + 'width': 12, + 'length': 25 + }, + 'build6_3f_room1': { + 'floor': 3, + 'build': 'build6', + 'x': -62.5, + 'y': 7, + 'z': -0.5, + 'height': 3, + 'width': 12, + 'length': 20 + }, + 'build6_3f_room1_###2': { + 'floor': 3, + 'build': 'build6', + 'x': -65, + 'y': 7, + 'z': -12, + 'height': 3, + 'width': 11, + 'length': 15 + }, + // build6_4f + 'build6_4f_toilet1': { + 'floor': 1, + 'build': 'build6', + 'x': -52.5, + 'y': 10, + 'z': -13.5, + 'height': 3, + 'width': 8, + 'length': 10 + }, + 'build6_4f_room3': { + 'floor': 4, + 'build': 'build6', + 'x': -52.5, + 'y': 10, + 'z': 12.5, + 'height': 3, + 'width': 10, + 'length': 10 + }, + 'build6_4f_room4': { + 'floor': 4, + 'build': 'build6', + 'x': -65, + 'y': 10, + 'z': 12.5, + 'height': 3, + 'width': 10, + 'length': 15 + }, + 'build6_4f_room5': { + 'floor': 4, + 'build': 'build6', + 'x': -50, + 'y': 10, + 'z': 6.5, + 'height': 3, + 'width': 2, + 'length': 5 + }, + 'build6_3f_room1_###3': { + 'floor': 4, + 'build': 'build6', + 'x': -62.5, + 'y': 10, + 'z': 0.5, + 'height': 3, + 'width': 14, + 'length': 20 + }, + 'build6_3f_room1_###4': { + 'floor': 4, + 'build': 'build6', + 'x': -65, + 'y': 10, + 'z': -12, + 'height': 3, + 'width': 11, + 'length': 15 + }, + // build6_5f + 'build6_5f_toilet1': { + 'floor': 1, + 'build': 'build6', + 'x': -52.5, + 'y': 13, + 'z': -13.5, + 'height': 3, + 'width': 8, + 'length': 10 + }, + 'build6_5f_room1_###1': { + 'floor': 5, + 'build': 'build6', + 'x': -60, + 'y': 13, + 'z': 11.5, + 'height': 3, + 'width': 12, + 'length': 25 + }, + 'build6_5f_room1': { + 'floor': 5, + 'build': 'build6', + 'x': -62.5, + 'y': 13, + 'z': -0.5, + 'height': 3, + 'width': 12, + 'length': 20 + }, + 'build6_5f_room1_###2': { + 'floor': 5, + 'build': 'build6', + 'x': -65, + 'y': 13, + 'z': -12, + 'height': 3, + 'width': 11, + 'length': 15 }, - // 'build5_5f_room4': { - // 'floor': 5, - // 'build': 'build5', - // 'x': 5.5, - // 'y': 13, - // 'z': 24, - // 'height': 3, - // 'width': 16, - // 'length': 9 - // }, - 'build5_5f_room5': {'floor': 5, 'build': 'build5', 'x': -3.5, 'y': 13, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_5f_room6': {'floor': 5, 'build': 'build5', 'x': -12.5, 'y': 13, 'z': 24, 'height': 3, 'width': 16, 'length': 9}, - 'build5_5f_aisle2': {'floor': 5, 'build': 'build5', 'x': -19.25, 'y': 13, 'z': 26.25, 'height': 3, 'width': 11.5, 'length': 4.5}, - - // build6 - 'build6_base1': {'build': 'build6', 'x': -60, 'y': 0, 'z': 0, 'height': 1, 'width': 35, 'length': 25}, - 'build6_elevator1': {'build': 'build6', 'x': -56, 'y': 1, 'z': -8, 'height': 18, 'width': 3, 'length': 3}, - 'build6_stair1': {'build': 'build6', 'x': -51, 'y': 1, 'z': -8, 'height': 18, 'width': 3, 'length': 7}, - 'build6_stair2': {'build': 'build6', 'x': -73.75, 'y': 0, 'z': 0, 'height': 17, 'width': 16, 'length': 2.5}, - // build6_1f - 'build6_1f_toilet1': {'floor': 1, 'build': 'build6', 'x': -52.5, 'y': 1, 'z': -13.5, 'height': 3, 'width': 8, 'length': 10}, - 'build6_1f_room1': {'floor': 1, 'build': 'build6', 'x': -60, 'y': 1, 'z': 11.5, 'height': 6, 'width': 12, 'length': 25}, - 'build6_1f_room2': {'floor': 1, 'build': 'build6', 'x': -57.5, 'y': 1, 'z': -0.5, 'height': 3, 'width': 12, 'length': 10}, - 'build6_1f_room3': {'floor': 1, 'build': 'build6', 'x': -67.5, 'y': 1, 'z': -0.5, 'height': 3, 'width': 12, 'length': 10}, - 'build6_1f_room4': {'floor': 1, 'build': 'build6', 'x': -67.5, 'y': 1, 'z': -12, 'height': 3, 'width': 11, 'length': 10}, - 'build6_1f_room5': {'floor': 1, 'build': 'build6', 'x': -60, 'y': 1, 'z': -12, 'height': 3, 'width': 11, 'length': 5}, - // build6_2f - 'build6_2f_toilet1': {'floor': 1, 'build': 'build6', 'x': -52.5, 'y': 4, 'z': -13.5, 'height': 3, 'width': 8, 'length': 10}, - 'build6_2f_room2': {'floor': 1, 'build': 'build6', 'x': -62.5, 'y': 4, 'z': -0.5, 'height': 3, 'width': 12, 'length': 20}, - 'build6_2f_room2_###1': {'floor': 1, 'build': 'build6', 'x': -65, 'y': 4, 'z': -12, 'height': 3, 'width': 11, 'length': 15}, - // build6_3f - 'build6_3f_toilet1': {'floor': 1, 'build': 'build6', 'x': -52.5, 'y': 7, 'z': -13.5, 'height': 3, 'width': 8, 'length': 10}, - 'build6_3f_room1_###1': {'floor': 3, 'build': 'build6', 'x': -60, 'y': 7, 'z': 11.5, 'height': 3, 'width': 12, 'length': 25}, - 'build6_3f_room1': {'floor': 3, 'build': 'build6', 'x': -62.5, 'y': 7, 'z': -0.5, 'height': 3, 'width': 12, 'length': 20}, - 'build6_3f_room1_###2': {'floor': 3, 'build': 'build6', 'x': -65, 'y': 7, 'z': -12, 'height': 3, 'width': 11, 'length': 15}, - // build6_4f - 'build6_4f_toilet1': {'floor': 1, 'build': 'build6', 'x': -52.5, 'y': 10, 'z': -13.5, 'height': 3, 'width': 8, 'length': 10}, - 'build6_4f_room3': {'floor': 4, 'build': 'build6', 'x': -52.5, 'y': 10, 'z': 12.5, 'height': 3, 'width': 10, 'length': 10}, - 'build6_4f_room4': {'floor': 4, 'build': 'build6', 'x': -65, 'y': 10, 'z': 12.5, 'height': 3, 'width': 10, 'length': 15}, - 'build6_4f_room5': {'floor': 4, 'build': 'build6', 'x': -50, 'y': 10, 'z': 6.5, 'height': 3, 'width': 2, 'length': 5}, - 'build6_3f_room1_###3': {'floor': 4, 'build': 'build6', 'x': -62.5, 'y': 10, 'z': 0.5, 'height': 3, 'width': 14, 'length': 20}, - 'build6_3f_room1_###4': {'floor': 4, 'build': 'build6', 'x': -65, 'y': 10, 'z': -12, 'height': 3, 'width': 11, 'length': 15}, - // build6_5f - 'build6_5f_toilet1': {'floor': 1, 'build': 'build6', 'x': -52.5, 'y': 13, 'z': -13.5, 'height': 3, 'width': 8, 'length': 10}, - 'build6_5f_room1_###1': {'floor': 5, 'build': 'build6', 'x': -60, 'y': 13, 'z': 11.5, 'height': 3, 'width': 12, 'length': 25}, - 'build6_5f_room1': {'floor': 5, 'build': 'build6', 'x': -62.5, 'y': 13, 'z': -0.5, 'height': 3, 'width': 12, 'length': 20}, - 'build6_5f_room1_###2': {'floor': 5, 'build': 'build6', 'x': -65, 'y': 13, 'z': -12, 'height': 3, 'width': 11, 'length': 15}, // build7 - 'build7_build_###base1': {'build': 'build7', 'x': -75, 'y': 0, 'z': 60, 'height': 1, 'width': 50, 'length': 35}, - 'build7_build_###base2': {'build': 'build7', 'x': -55, 'y': 0, 'z': 60, 'height': 1, 'width': 37, 'length': 5}, - 'build7_toilet1': {'build': 'build7', 'x': -82.5, 'y': 1, 'z': 38, 'height': 3, 'width': 5, 'length': 5}, - 'build7_toilet2': {'build': 'build7', 'x': -67.5, 'y': 1, 'z': 38, 'height': 3, 'width': 5, 'length': 5}, - 'build7_build': {'build': 'build7', 'x': -75, 'y': 1, 'z': 60, 'height': 10, 'width': 50, 'length': 35}, - 'build7_build_###build_extend1': {'build': 'build7', 'x': -55, 'y': 10, 'z': 60, 'height': 1, 'width': 28, 'length': 5}, + 'build7_build_###base1': { + 'build': 'build7', + 'x': -75, + 'y': 0, + 'z': 60, + 'height': 1, + 'width': 50, + 'length': 35 + }, + 'build7_build_###base2': { + 'build': 'build7', + 'x': -55, + 'y': 0, + 'z': 60, + 'height': 1, + 'width': 37, + 'length': 5 + }, + 'build7_toilet1': { + 'build': 'build7', + 'x': -82.5, + 'y': 1, + 'z': 38, + 'height': 3, + 'width': 5, + 'length': 5 + }, + 'build7_toilet2': { + 'build': 'build7', + 'x': -67.5, + 'y': 1, + 'z': 38, + 'height': 3, + 'width': 5, + 'length': 5 + }, + 'build7_build': { + 'build': 'build7', + 'x': -75, + 'y': 1, + 'z': 60, + 'height': 10, + 'width': 50, + 'length': 35 + }, + 'build7_build_###build_extend1': { + 'build': 'build7', + 'x': -55, + 'y': 10, + 'z': 60, + 'height': 1, + 'width': 28, + 'length': 5 + }, 'build7_build_###colunm_1': { 'build': 'build7', 'x': -53.5, @@ -1379,49 +3320,315 @@ const Map> mapData = { 'width': 1, 'length': 1 }, - 'build7_build_###colunm_2': {'build': 'build7', 'x': -53.5, 'y': 1, 'z': 67, 'height': 10, 'width': 1, 'length': 1}, - 'build7_build_###colunm_3': {'build': 'build7', 'x': -53.5, 'y': 1, 'z': 62, 'height': 10, 'width': 1, 'length': 1}, - 'build7_build_###colunm_4': {'build': 'build7', 'x': -53.5, 'y': 1, 'z': 58, 'height': 10, 'width': 1, 'length': 1}, - 'build7_build_###colunm_5': {'build': 'build7', 'x': -53.5, 'y': 1, 'z': 53, 'height': 10, 'width': 1, 'length': 1}, - 'build7_build_###colunm_6': {'build': 'build7', 'x': -53.5, 'y': 1, 'z': 48, 'height': 10, 'width': 1, 'length': 1}, + 'build7_build_###colunm_2': { + 'build': 'build7', + 'x': -53.5, + 'y': 1, + 'z': 67, + 'height': 10, + 'width': 1, + 'length': 1 + }, + 'build7_build_###colunm_3': { + 'build': 'build7', + 'x': -53.5, + 'y': 1, + 'z': 62, + 'height': 10, + 'width': 1, + 'length': 1 + }, + 'build7_build_###colunm_4': { + 'build': 'build7', + 'x': -53.5, + 'y': 1, + 'z': 58, + 'height': 10, + 'width': 1, + 'length': 1 + }, + 'build7_build_###colunm_5': { + 'build': 'build7', + 'x': -53.5, + 'y': 1, + 'z': 53, + 'height': 10, + 'width': 1, + 'length': 1 + }, + 'build7_build_###colunm_6': { + 'build': 'build7', + 'x': -53.5, + 'y': 1, + 'z': 48, + 'height': 10, + 'width': 1, + 'length': 1 + }, // build8 - 'build8_base1': {'build': 'build8', 'x': 70, 'y': 0, 'z': -85, 'height': 1, 'width': 35, 'length': 23}, - 'build8_base2': {'build': 'build8', 'x': 88, 'y': 0, 'z': -72.5, 'height': 1, 'width': 25, 'length': 13}, - 'build8_base3': {'build': 'build8', 'x': 70, 'y': 0, 'z': -63.75, 'height': 1, 'width': 7.5, 'length': 23}, - 'build8_room1': {'build': 'build8', 'x': 70, 'y': 1, 'z': -85, 'height': 6, 'width': 35, 'length': 23}, - 'build8_room2': {'build': 'build8', 'x': 88, 'y': 1, 'z': -72.5, 'height': 4, 'width': 25, 'length': 13}, - 'build8_room3': {'build': 'build8', 'x': 70, 'y': 0, 'z': -105, 'height': 3, 'width': 5, 'length': 23}, + 'build8_base1': { + 'build': 'build8', + 'x': 70, + 'y': 0, + 'z': -85, + 'height': 1, + 'width': 35, + 'length': 23 + }, + 'build8_base2': { + 'build': 'build8', + 'x': 88, + 'y': 0, + 'z': -72.5, + 'height': 1, + 'width': 25, + 'length': 13 + }, + 'build8_base3': { + 'build': 'build8', + 'x': 70, + 'y': 0, + 'z': -63.75, + 'height': 1, + 'width': 7.5, + 'length': 23 + }, + 'build8_room1': { + 'build': 'build8', + 'x': 70, + 'y': 1, + 'z': -85, + 'height': 6, + 'width': 35, + 'length': 23 + }, + 'build8_room2': { + 'build': 'build8', + 'x': 88, + 'y': 1, + 'z': -72.5, + 'height': 4, + 'width': 25, + 'length': 13 + }, + 'build8_room3': { + 'build': 'build8', + 'x': 70, + 'y': 0, + 'z': -105, + 'height': 3, + 'width': 5, + 'length': 23 + }, // build9 - 'build9_stair1': {'build': 'build9', 'x': 80, 'y': 0, 'z': -45, 'height': 21, 'width': 6, 'length': 6}, + 'build9_stair1': { + 'build': 'build9', + 'x': 80, + 'y': 0, + 'z': -45, + 'height': 21, + 'width': 6, + 'length': 6 + }, // build9_1f - 'build9_1f': {'floor': 1, 'build': 'build9', 'x': 77, 'y': 0, 'z': -42, 'height': 3, 'width': 0, 'length': 0}, - 'build9_1f_###1': {'floor': 1, 'build': 'build9', 'x': 70.5, 'y': 0, 'z': -47.5, 'height': 3, 'width': 11, 'length': 13}, - 'build9_1f_###2': {'floor': 1, 'build': 'build9', 'x': 82.5, 'y': 0, 'z': -35.5, 'height': 3, 'width': 13, 'length': 11}, + 'build9_1f': { + 'floor': 1, + 'build': 'build9', + 'x': 77, + 'y': 0, + 'z': -42, + 'height': 3, + 'width': 0, + 'length': 0 + }, + 'build9_1f_###1': { + 'floor': 1, + 'build': 'build9', + 'x': 70.5, + 'y': 0, + 'z': -47.5, + 'height': 3, + 'width': 11, + 'length': 13 + }, + 'build9_1f_###2': { + 'floor': 1, + 'build': 'build9', + 'x': 82.5, + 'y': 0, + 'z': -35.5, + 'height': 3, + 'width': 13, + 'length': 11 + }, // build9_2f - 'build9_2f': {'floor': 2, 'build': 'build9', 'x': 77, 'y': 3, 'z': -42, 'height': 3, 'width': 0, 'length': 0}, - 'build9_2f_###1': {'floor': 2, 'build': 'build9', 'x': 70.5, 'y': 3, 'z': -47.5, 'height': 3, 'width': 11, 'length': 13}, - 'build9_2f_###2': {'floor': 2, 'build': 'build9', 'x': 82.5, 'y': 3, 'z': -35.5, 'height': 3, 'width': 13, 'length': 11}, + 'build9_2f': { + 'floor': 2, + 'build': 'build9', + 'x': 77, + 'y': 3, + 'z': -42, + 'height': 3, + 'width': 0, + 'length': 0 + }, + 'build9_2f_###1': { + 'floor': 2, + 'build': 'build9', + 'x': 70.5, + 'y': 3, + 'z': -47.5, + 'height': 3, + 'width': 11, + 'length': 13 + }, + 'build9_2f_###2': { + 'floor': 2, + 'build': 'build9', + 'x': 82.5, + 'y': 3, + 'z': -35.5, + 'height': 3, + 'width': 13, + 'length': 11 + }, // build9_3f - 'build9_3f': {'floor': 3, 'build': 'build9', 'x': 77, 'y': 6, 'z': -42, 'height': 3, 'width': 0, 'length': 0}, - 'build9_3f_###1': {'floor': 3, 'build': 'build9', 'x': 70.5, 'y': 6, 'z': -47.5, 'height': 3, 'width': 11, 'length': 13}, - 'build9_3f_###2': {'floor': 3, 'build': 'build9', 'x': 82.5, 'y': 6, 'z': -35.5, 'height': 3, 'width': 13, 'length': 11}, + 'build9_3f': { + 'floor': 3, + 'build': 'build9', + 'x': 77, + 'y': 6, + 'z': -42, + 'height': 3, + 'width': 0, + 'length': 0 + }, + 'build9_3f_###1': { + 'floor': 3, + 'build': 'build9', + 'x': 70.5, + 'y': 6, + 'z': -47.5, + 'height': 3, + 'width': 11, + 'length': 13 + }, + 'build9_3f_###2': { + 'floor': 3, + 'build': 'build9', + 'x': 82.5, + 'y': 6, + 'z': -35.5, + 'height': 3, + 'width': 13, + 'length': 11 + }, // build9_4f - 'build9_4f': {'floor': 4, 'build': 'build9', 'x': 77, 'y': 9, 'z': -42, 'height': 3, 'width': 0, 'length': 0}, - 'build9_4f_###1': {'floor': 4, 'build': 'build9', 'x': 70.5, 'y': 9, 'z': -47.5, 'height': 3, 'width': 11, 'length': 13}, - 'build9_4f_###2': {'floor': 4, 'build': 'build9', 'x': 82.5, 'y': 9, 'z': -35.5, 'height': 3, 'width': 13, 'length': 11}, + 'build9_4f': { + 'floor': 4, + 'build': 'build9', + 'x': 77, + 'y': 9, + 'z': -42, + 'height': 3, + 'width': 0, + 'length': 0 + }, + 'build9_4f_###1': { + 'floor': 4, + 'build': 'build9', + 'x': 70.5, + 'y': 9, + 'z': -47.5, + 'height': 3, + 'width': 11, + 'length': 13 + }, + 'build9_4f_###2': { + 'floor': 4, + 'build': 'build9', + 'x': 82.5, + 'y': 9, + 'z': -35.5, + 'height': 3, + 'width': 13, + 'length': 11 + }, // build9_5f - 'build9_5f': {'floor': 5, 'build': 'build9', 'x': 77, 'y': 12, 'z': -42, 'height': 3, 'width': 0, 'length': 0}, - 'build9_5f_###1': {'floor': 5, 'build': 'build9', 'x': 70.5, 'y': 12, 'z': -47.5, 'height': 3, 'width': 11, 'length': 13}, - 'build9_5f_###2': {'floor': 5, 'build': 'build9', 'x': 82.5, 'y': 12, 'z': -35.5, 'height': 3, 'width': 13, 'length': 11}, + 'build9_5f': { + 'floor': 5, + 'build': 'build9', + 'x': 77, + 'y': 12, + 'z': -42, + 'height': 3, + 'width': 0, + 'length': 0 + }, + 'build9_5f_###1': { + 'floor': 5, + 'build': 'build9', + 'x': 70.5, + 'y': 12, + 'z': -47.5, + 'height': 3, + 'width': 11, + 'length': 13 + }, + 'build9_5f_###2': { + 'floor': 5, + 'build': 'build9', + 'x': 82.5, + 'y': 12, + 'z': -35.5, + 'height': 3, + 'width': 13, + 'length': 11 + }, // facility - 'facility_courtyard1': {'x': 10, 'y': 0, 'z': -2, 'height': 0, 'width': 0, 'length': 0}, - 'facility_courtyard2': {'x': 20, 'y': 0, 'z': 38, 'height': 0, 'width': 0, 'length': 0}, - 'facility_gate': {'x': -30, 'y': 7, 'z': 100, 'height': 3, 'width': 8, 'length': 20}, - 'facility_gate_###1': {'x': -37, 'y': 0, 'z': 100, 'height': 7, 'width': 6, 'length': 4}, - 'facility_gate_###2': {'x': -23, 'y': 0, 'z': 100, 'height': 7, 'width': 6, 'length': 4}, + 'facility_courtyard1': { + 'x': 10, + 'y': 0, + 'z': -2, + 'height': 0, + 'width': 0, + 'length': 0 + }, + 'facility_courtyard2': { + 'x': 20, + 'y': 0, + 'z': 38, + 'height': 0, + 'width': 0, + 'length': 0 + }, + 'facility_gate': { + 'x': -30, + 'y': 7, + 'z': 100, + 'height': 3, + 'width': 8, + 'length': 20 + }, + 'facility_gate_###1': { + 'x': -37, + 'y': 0, + 'z': 100, + 'height': 7, + 'width': 6, + 'length': 4 + }, + 'facility_gate_###2': { + 'x': -23, + 'y': 0, + 'z': 100, + 'height': 7, + 'width': 6, + 'length': 4 + }, 'facility_gate_slidedoor': { 'x': -20, //-30close -20open 'y': 0, @@ -1518,9 +3725,30 @@ const Map> mapData = { 'width': 0.3, 'length': 0.5, }, - 'facility_court1': {'x': 40, 'y': 0, 'z': -60, 'height': 0.1, 'width': 35, 'length': 30}, - 'facility_court2': {'x': 0, 'y': 0, 'z': -62.5, 'height': 0.1, 'width': 30, 'length': 50}, - 'facility_court3': {'x': -50, 'y': 0, 'z': -50, 'height': 0.1, 'width': 35, 'length': 30}, + 'facility_court1': { + 'x': 40, + 'y': 0, + 'z': -60, + 'height': 0.1, + 'width': 35, + 'length': 30 + }, + 'facility_court2': { + 'x': 0, + 'y': 0, + 'z': -62.5, + 'height': 0.1, + 'width': 30, + 'length': 50 + }, + 'facility_court3': { + 'x': -50, + 'y': 0, + 'z': -50, + 'height': 0.1, + 'width': 35, + 'length': 30 + }, 'facility_court4': { 'x': -60, 'y': 0, @@ -1539,8 +3767,22 @@ const Map> mapData = { 'length': 0.3, 'rotate': {'x': 0, 'y': -0.5, 'z': 0} }, - 'facility_recyclihgYard1': {'x': -80, 'y': 0, 'z': 0, 'height': 0.1, 'width': 35, 'length': 10}, - 'facility_guardHouse': {'x': -44, 'y': 0, 'z': 100, 'height': 4, 'width': 5, 'length': 10}, + 'facility_recyclihgYard1': { + 'x': -80, + 'y': 0, + 'z': 0, + 'height': 0.1, + 'width': 35, + 'length': 10 + }, + 'facility_guardHouse': { + 'x': -44, + 'y': 0, + 'z': 100, + 'height': 4, + 'width': 5, + 'length': 10 + }, 'facility_parkingLot1': { 'x': -75, 'y': 0, @@ -1550,10 +3792,38 @@ const Map> mapData = { 'length': 36, 'rotate': {'x': 0, 'y': 0.05, 'z': 0} }, - 'facility_parkingLot1_###1': {'x': -78, 'y': 0, 'z': 87, 'height': 2, 'width': 2, 'length': 30}, - 'facility_toilet1': {'x': -80, 'y': 0, 'z': 25.5, 'height': 3, 'width': 9, 'length': 11}, - 'facility_electronic1': {'x': 28, 'y': 0, 'z': 98.5, 'height': 2, 'width': 3, 'length': 7}, - 'facility_electronic1_###1': {'x': 23, 'y': 0, 'z': 99, 'height': 3, 'width': 2, 'length': 3}, + 'facility_parkingLot1_###1': { + 'x': -78, + 'y': 0, + 'z': 87, + 'height': 2, + 'width': 2, + 'length': 30 + }, + 'facility_toilet1': { + 'x': -80, + 'y': 0, + 'z': 25.5, + 'height': 3, + 'width': 9, + 'length': 11 + }, + 'facility_electronic1': { + 'x': 28, + 'y': 0, + 'z': 98.5, + 'height': 2, + 'width': 3, + 'length': 7 + }, + 'facility_electronic1_###1': { + 'x': 23, + 'y': 0, + 'z': 99, + 'height': 3, + 'width': 2, + 'length': 3 + }, 'facility_garbages1': { 'x': 37, 'y': 0, @@ -1572,11 +3842,46 @@ const Map> mapData = { 'length': 8, 'rotate': {'x': 0, 'y': -0.6, 'z': 0} }, - 'facility_platform1': {'x': 0, 'y': 0, 'z': -135, 'height': 8, 'width': 6, 'length': 14}, - 'facility_ground1': {'x': 0, 'y': 0, 'z': -105, 'height': 0.1, 'width': 50, 'length': 100}, - 'facility_ground1_###1': {'x': 55, 'y': 0, 'z': -125, 'height': 0.1, 'width': 10, 'length': 15}, - 'facility_parkingLot2': {'x': 23, 'y': 0, 'z': 75, 'height': 0.1, 'width': 30, 'length': 20}, - 'facility_parkingLot3': {'x': 75, 'y': 0, 'z': -20, 'height': 0.1, 'width': 15, 'length': 20}, + 'facility_platform1': { + 'x': 0, + 'y': 0, + 'z': -135, + 'height': 8, + 'width': 6, + 'length': 14 + }, + 'facility_ground1': { + 'x': 0, + 'y': 0, + 'z': -105, + 'height': 0.1, + 'width': 50, + 'length': 100 + }, + 'facility_ground1_###1': { + 'x': 55, + 'y': 0, + 'z': -125, + 'height': 0.1, + 'width': 10, + 'length': 15 + }, + 'facility_parkingLot2': { + 'x': 23, + 'y': 0, + 'z': 75, + 'height': 0.1, + 'width': 30, + 'length': 20 + }, + 'facility_parkingLot3': { + 'x': 75, + 'y': 0, + 'z': -20, + 'height': 0.1, + 'width': 15, + 'length': 20 + }, 'wall': {'x': -13.5, 'y': 0, 'z': 102, 'height': 4, 'width': 1, 'length': 15}, 'wall_###1': { 'x': 7.75, @@ -1623,7 +3928,14 @@ const Map> mapData = { 'length': 0.3, 'rotate': {'x': 0, 'y': -0.45, 'z': 0} }, - 'wall_###6': {'x': -85.15, 'y': 0, 'z': 0, 'height': 2, 'width': 35, 'length': 0.3}, + 'wall_###6': { + 'x': -85.15, + 'y': 0, + 'z': 0, + 'height': 2, + 'width': 35, + 'length': 0.3 + }, 'wall_###7': { 'x': 55, 'y': 0, @@ -1678,7 +3990,14 @@ const Map> mapData = { 'length': 30, 'rotate': {'x': 0, 'y': -0.52, 'z': 0} }, - 'wall_###13': {'x': 63.5, 'y': 0, 'z': -129.85, 'height': 2, 'width': 19, 'length': 0.3}, + 'wall_###13': { + 'x': 63.5, + 'y': 0, + 'z': -129.85, + 'height': 2, + 'width': 19, + 'length': 0.3 + }, 'hill': { 'x': 0, 'y': -15, @@ -1738,7 +4057,8 @@ class ZHSH3DMapPage extends StatefulWidget { State createState() => _ZHSH3DMapPageState(); } -class _ZHSH3DMapPageState extends State with TickerProviderStateMixin { +class _ZHSH3DMapPageState extends State + with TickerProviderStateMixin { Map dNameToName = {}; Map nameToDName = {}; @@ -1780,7 +4100,8 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM dynamic sourceTexture; - final GlobalKey _globalKey = GlobalKey(); + final GlobalKey _globalKey = + GlobalKey(); AnimationController? _hideFabAnimation; bool _handleScrollNotification(ScrollNotification notification) { if (notification.depth == 0) { @@ -1788,12 +4109,14 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM final UserScrollNotification userScroll = notification; switch (userScroll.direction) { case ScrollDirection.forward: - if (userScroll.metrics.maxScrollExtent != userScroll.metrics.minScrollExtent) { + if (userScroll.metrics.maxScrollExtent != + userScroll.metrics.minScrollExtent) { _hideFabAnimation?.forward(); } break; case ScrollDirection.reverse: - if (userScroll.metrics.maxScrollExtent != userScroll.metrics.minScrollExtent) { + if (userScroll.metrics.maxScrollExtent != + userScroll.metrics.minScrollExtent) { _hideFabAnimation?.reverse(); } break; @@ -1810,7 +4133,8 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM bool _devMode = false; bool _fullScreen = false; - double _gateSlideDoor = settingData['general']['position']['gateSlideDoor'] ?? 0; + double _gateSlideDoor = + settingData['general']['position']['gateSlideDoor'] ?? 0; int _fps = 0; @@ -1827,16 +4151,22 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM @override void initState() { _embededMode = widget.embededMode; - _hideFabAnimation = AnimationController(vsync: this, duration: kThemeAnimationDuration); + _hideFabAnimation = + AnimationController(vsync: this, duration: kThemeAnimationDuration); _hideFabAnimation?.forward(); - _windowSizeTimer = Timer.periodic(const Duration(milliseconds: 100), (timer) { + _windowSizeTimer = + Timer.periodic(const Duration(milliseconds: 100), (timer) { if (screenSize != MediaQuery.of(context).size) { if (MediaQuery.of(context).size.width > deskopModeWidth) { width = MediaQuery.of(context).size.width / 3 * 2; - height = MediaQuery.of(context).size.height - (_fullScreen || _embededMode ? 0 : AppBar().preferredSize.height); + height = MediaQuery.of(context).size.height - + (_fullScreen || _embededMode ? 0 : AppBar().preferredSize.height); } else { width = MediaQuery.of(context).size.width; - height = (MediaQuery.of(context).size.height - AppBar().preferredSize.height) * 2 / 3; + height = (MediaQuery.of(context).size.height - + AppBar().preferredSize.height) * + 2 / + 3; } camera.aspect = width / height; camera.updateProjectionMatrix(); @@ -1850,15 +4180,25 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM Future initPlatformState() async { if (MediaQuery.of(context).size.width > deskopModeWidth) { width = MediaQuery.of(context).size.width / 3 * 2; - height = MediaQuery.of(context).size.height - (_fullScreen || _embededMode ? 0 : AppBar().preferredSize.height); + height = MediaQuery.of(context).size.height - + (_fullScreen || _embededMode ? 0 : AppBar().preferredSize.height); } else { width = MediaQuery.of(context).size.width; - height = (MediaQuery.of(context).size.height - AppBar().preferredSize.height) * 2 / 3; + height = + (MediaQuery.of(context).size.height - AppBar().preferredSize.height) * + 2 / + 3; } three3dRender = FlutterGlPlugin(); - Map options = {'antialias': true, 'alpha': false, 'width': width.toInt(), 'height': height.toInt(), 'dpr': dpr}; + Map options = { + 'antialias': true, + 'alpha': false, + 'width': width.toInt(), + 'height': height.toInt(), + 'dpr': dpr + }; await three3dRender.initialize(options: options); @@ -1914,7 +4254,10 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM padding: const EdgeInsets.all(20), constraints: BoxConstraints( maxWidth: 700, - minHeight: MediaQuery.of(context).size.height - AppBar().preferredSize.height - MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.bottom, + minHeight: MediaQuery.of(context).size.height - + AppBar().preferredSize.height - + MediaQuery.of(context).padding.top - + MediaQuery.of(context).padding.bottom, ), child: const Column( mainAxisAlignment: MainAxisAlignment.center, @@ -1927,7 +4270,9 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM ), Offstage( offstage: _initialized == false, - child: MediaQuery.of(context).size.width > deskopModeWidth ? _buildDesktop(context) : _buildMobile(context), + child: MediaQuery.of(context).size.width > deskopModeWidth + ? _buildDesktop(context) + : _buildMobile(context), ), ], ), @@ -2086,20 +4431,18 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM children: [ Offstage( offstage: _searchSelected == true || _searchResult.isEmpty, - child: const Column( - children: [ - SizedBox( - height: 10, - ), - ListTile( - leading: IconButton( - icon: Icon(Icons.search), - onPressed: null, - ), - title: Text('搜尋結果'), + child: const Column(children: [ + SizedBox( + height: 10, + ), + ListTile( + leading: IconButton( + icon: Icon(Icons.search), + onPressed: null, ), - ] - ), + title: Text('搜尋結果'), + ), + ]), ), Offstage( offstage: _notFound == true || _searchSelected == true, @@ -2115,9 +4458,12 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM for (String i in _searchResult) ListTile( title: Text(i), - subtitle: settingData['object']['set'][dNameToName[i]]['description'] != null + subtitle: settingData['object']['set'] + [dNameToName[i]]['description'] != + null ? Text( - settingData['object']['set'][dNameToName[i]]['description'], + settingData['object']['set'] + [dNameToName[i]]['description'], maxLines: 1, overflow: TextOverflow.ellipsis, ) @@ -2127,7 +4473,8 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM print('You just selected Display Name: $i'); } var id = search(i); - if (settingData['controls']['searchFocus'] == true) { + if (settingData['controls']['searchFocus'] == + true) { focus(id); } setState(() { @@ -2172,42 +4519,69 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM ), ), Offstage( - offstage: _selectedLocation == '' || mapData[_selectedLocation]!['build'] == null || settingData['buildings']!['name'][mapData[_selectedLocation]!['build']] == null, + offstage: _selectedLocation == '' || + mapData[_selectedLocation]!['build'] == null || + settingData['buildings']!['name'] + [mapData[_selectedLocation]!['build']] == + null, child: ListTile( title: const Text('建築'), - subtitle: Text('${_selectedLocation == '' ? '' : settingData['buildings']!['name'][mapData[_selectedLocation]!['build']] ?? 'None'}'), + subtitle: Text( + '${_selectedLocation == '' ? '' : settingData['buildings']!['name'][mapData[_selectedLocation]!['build']] ?? 'None'}'), ), ), Offstage( - offstage: _selectedLocation == '' || mapData[_selectedLocation]!['floor'] == null, + offstage: _selectedLocation == '' || + mapData[_selectedLocation]!['floor'] == null, child: ListTile( title: const Text('樓層'), - subtitle: Text('${_selectedLocation == '' ? '' : mapData[_selectedLocation]!['floor'] ?? 'None'}'.replaceAll('-', 'B')), + subtitle: Text( + '${_selectedLocation == '' ? '' : mapData[_selectedLocation]!['floor'] ?? 'None'}' + .replaceAll('-', 'B')), ), ), Offstage( - offstage: _selectedLocation == '' || settingData['object']['set'][_selectedLocation]['description'] == null, + offstage: _selectedLocation == '' || + settingData['object']['set'][_selectedLocation] + ['description'] == + null, child: ListTile( title: const Text('詳細資訊'), - subtitle: Text('${_selectedLocation == '' ? '' : settingData['object']['set'][_selectedLocation]['description']}'), + subtitle: Text( + '${_selectedLocation == '' ? '' : settingData['object']['set'][_selectedLocation]['description']}'), ), ), Offstage( - offstage: _selectedLocation == '' || settingData['object']['set'][_selectedLocation]['link'] == null, + offstage: _selectedLocation == '' || + settingData['object']['set'][_selectedLocation] + ['link'] == + null, child: Container( padding: const EdgeInsets.all(10), child: Wrap( spacing: 10, runSpacing: 10, - children: _selectedLocation == '' || settingData['object']['set'][_selectedLocation]['link'] == null + children: _selectedLocation == '' || + settingData['object']['set'] + [_selectedLocation]['link'] == + null ? const [] : [ - for (var link in settingData['object']['set'][_selectedLocation]['link'].keys) + for (var link in settingData['object'] + ['set'][_selectedLocation]['link'] + .keys) ElevatedButton( - onPressed: settingData['object']['set'][_selectedLocation]['link'][link].isEmpty + onPressed: settingData['object']['set'] + [_selectedLocation] + ['link'][link] + .isEmpty ? null : () { - CustomLaunchUrl.launch(context, settingData['object']['set'][_selectedLocation]['link'][link]); + CustomLaunchUrl.launch( + context, + settingData['object']['set'] + [_selectedLocation] + ['link'][link]); }, child: Text(link), ), @@ -2233,7 +4607,10 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM : null, onPanCancel: _devModeTimer?.cancel, onPanDown: (DragDownDetails details) { - _devModeTimer = Timer(Duration(seconds: settingData['general']['devMode']['openDuration']), () { + _devModeTimer = Timer( + Duration( + seconds: settingData['general']['devMode']['openDuration']), + () { setState(() { _devMode = true; }); @@ -2314,11 +4691,13 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM ), ListTile( title: const Text('嵌入模式'), - subtitle: const Text('https://jhihyulin.live/zhsh3dmap?embededMode=true'), + subtitle: const Text( + 'https://jhihyulin.live/zhsh3dmap?embededMode=true'), trailing: IconButton( icon: const Icon(Icons.copy), onPressed: () { - html.window.navigator.clipboard?.writeText('https://jhihyulin.live/zhsh3dmap?embededMode=true'); + html.window.navigator.clipboard?.writeText( + 'https://jhihyulin.live/zhsh3dmap?embededMode=true'); }, ), ), @@ -2412,21 +4791,29 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM continue; } // name search - if (settingData['general']['search']['nameSearch'] && settingData['object']['set'][i]['nameSearch'] != false) { - if (settingData['object']['set'][i]['name']!.toLowerCase().contains(arg.toLowerCase())) { + if (settingData['general']['search']['nameSearch'] && + settingData['object']['set'][i]['nameSearch'] != false) { + if (settingData['object']['set'][i]['name']! + .toLowerCase() + .contains(arg.toLowerCase())) { result.add(settingData['object']['set'][i]['name']!); continue; } } // description search - if (settingData['general']['search']['descriptionSearch'] && settingData['object']['set'][i]['descriptionSearch'] != false) { - if (settingData['object']['set'][i]['description'] != null && settingData['object']['set'][i]['description']!.toLowerCase().contains(arg.toLowerCase())) { + if (settingData['general']['search']['descriptionSearch'] && + settingData['object']['set'][i]['descriptionSearch'] != false) { + if (settingData['object']['set'][i]['description'] != null && + settingData['object']['set'][i]['description']! + .toLowerCase() + .contains(arg.toLowerCase())) { result.add(settingData['object']['set'][i]['name']!); continue; } } // keyword search - if (settingData['general']['search']['keywordSearch'] && settingData['object']['set'][i]['keywordSearch'] != false) { + if (settingData['general']['search']['keywordSearch'] && + settingData['object']['set'][i]['keywordSearch'] != false) { if (settingData['object']['set'][i]['keyword'] != null) { for (var j in settingData['object']['set'][i]['keyword']!) { if (j.toLowerCase() == arg.toLowerCase()) { @@ -2486,26 +4873,37 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM initPage() { scene = three.Scene(); - scene.background = three.Color(settingData['background']['color'] == 'system' ? Theme.of(context).colorScheme.background.value : settingData['background']['color']); + scene.background = three.Color( + settingData['background']['color'] == 'system' + ? Theme.of(context).colorScheme.background.value + : settingData['background']['color']); scene.fog = three.FogExp2(0xcccccc, 0.002); camera = three.PerspectiveCamera(60, width / height, 1, 1000); - camera.position.set(settingData['camera']['x'], settingData['camera']['y'], settingData['camera']['z']); - camera.lookAt(Vector3(settingData['camera']['focusX'], settingData['camera']['focusY'], settingData['camera']['focusZ'])); + camera.position.set(settingData['camera']['x'], settingData['camera']['y'], + settingData['camera']['z']); + camera.lookAt(Vector3(settingData['camera']['focusX'], + settingData['camera']['focusY'], settingData['camera']['focusZ'])); // controls controls = three_jsm.OrbitControls(camera, _globalKey); controls.enabled = settingData['controls']['enabled']; - controls.enableDamping = true; // an animation loop is required when either damping or auto-rotation are enabled + controls.enableDamping = + true; // an animation loop is required when either damping or auto-rotation are enabled controls.autoRotate = settingData['controls']['autoRotate']; controls.autoRotateSpeed = settingData['controls']['autoRotateSpeed']; controls.dampingFactor = 0.05; controls.screenSpacePanning = false; controls.minDistance = 1; controls.maxDistance = 500; - controls.minPolarAngle = settingData['controls']['minPolarAngle'] * three.Math.pi / 180; // radians - controls.maxPolarAngle = settingData['controls']['maxPolarAngle'] * three.Math.pi / 180; // radians - controls.target.set(settingData['camera']['focusX'], settingData['camera']['focusY'], settingData['camera']['focusZ']); + controls.minPolarAngle = settingData['controls']['minPolarAngle'] * + three.Math.pi / + 180; // radians + controls.maxPolarAngle = settingData['controls']['maxPolarAngle'] * + three.Math.pi / + 180; // radians + controls.target.set(settingData['camera']['focusX'], + settingData['camera']['focusY'], settingData['camera']['focusZ']); // world var geometry = three.BoxGeometry(1, 1, 1); @@ -2523,7 +4921,10 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM // ground if (!_groundHelper) { - var mesh = three.Mesh(three.PlaneGeometry(settingData['ground']['width'], settingData['ground']['length']), three.MeshPhongMaterial({'color': settingData['ground']['color']})); + var mesh = three.Mesh( + three.PlaneGeometry( + settingData['ground']['width'], settingData['ground']['length']), + three.MeshPhongMaterial({'color': settingData['ground']['color']})); mesh.rotation.x = -three.Math.pi / 2; mesh.castShadow = false; mesh.receiveShadow = true; @@ -2544,7 +4945,10 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM geo.translate(0, 0.5, 0); } var material = three.MeshPhysicalMaterial({ - 'color': settingData['buildings']['randomColor'] == true ? (three.Math.random() * 0xffffff).toInt() : settingData['object']['set'][i]!['color'] ?? settingData['buildings']['color'], + 'color': settingData['buildings']['randomColor'] == true + ? (three.Math.random() * 0xffffff).toInt() + : settingData['object']['set'][i]!['color'] ?? + settingData['buildings']['color'], 'flatShading': false, 'roughness': 0.1, 'metalness': 0.1, @@ -2552,7 +4956,8 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM var mesh = three.Mesh(geo, material); if (mapData[i]!['shape'] == 'ball') { } else { - mesh.scale.set(mapData[i]!['length'], mapData[i]!['height'], mapData[i]!['width']); + mesh.scale.set( + mapData[i]!['length'], mapData[i]!['height'], mapData[i]!['width']); } if (mapData[i]!['opacity'] != null) { mesh.material.opacity = mapData[i]!['opacity']; @@ -2587,7 +4992,8 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM scene.add(ambientLight); } else if (i['type'] == 'directional') { var dirLight = three.DirectionalLight(i['color']); - dirLight.position.set(i['position']['x'], i['position']['y'], i['position']['z']); + dirLight.position + .set(i['position']['x'], i['position']['y'], i['position']['z']); dirLight.intensity = i['intensity']; if (i['shadow']['enabled']) { dirLight.castShadow = i['shadow']['enabled']; @@ -2636,9 +5042,13 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM var objectZ = mapData[buildingName]!['z']; var objectHeight = mapData[buildingName]!['height']; var tarCameraPosition = three.Vector3( - objectX >= 0 ? objectX + settingData['camera']['focusIncreaseX'] : objectX - settingData['camera']['focusIncreaseX'], + objectX >= 0 + ? objectX + settingData['camera']['focusIncreaseX'] + : objectX - settingData['camera']['focusIncreaseX'], objectY + (objectHeight / 2) + settingData['camera']['focusIncreaseY'], - objectZ >= 0 ? objectZ + settingData['camera']['focusIncreaseZ'] : objectZ - settingData['camera']['focusIncreaseZ'], + objectZ >= 0 + ? objectZ + settingData['camera']['focusIncreaseZ'] + : objectZ - settingData['camera']['focusIncreaseZ'], ); _navigatorTimer = Timer.periodic(const Duration(milliseconds: 50), (timer) { if (!mounted || disposed) { @@ -2648,12 +5058,14 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM var cameraPosition = camera.position; var distance = cameraPosition.distanceTo(tarCameraPosition); if (distance < 1) { - cameraPosition.set(tarCameraPosition.x, tarCameraPosition.y, tarCameraPosition.z); + cameraPosition.set( + tarCameraPosition.x, tarCameraPosition.y, tarCameraPosition.z); timer.cancel(); controls.autoRotate = settingData['controls']['autoRotate']; return; } else { - cameraPosition.lerp(tarCameraPosition, settingData['camera']['focusLerp']); + cameraPosition.lerp( + tarCameraPosition, settingData['camera']['focusLerp']); } controls.target.set(objectX, objectY + (objectHeight / 2), objectZ); }); @@ -2676,7 +5088,8 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM }); } else { i.material = three.MeshPhysicalMaterial({ - 'color': settingData['object']['set'][i.name]!['color'] ?? settingData['buildings']['color'], + 'color': settingData['object']['set'][i.name]!['color'] ?? + settingData['buildings']['color'], 'flatShading': true, 'opacity': settingData['buildings']['focusOpacity'], 'roughness': 0.1, @@ -2695,7 +5108,8 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM var x = settingData['camera']['focusX']; var y = settingData['camera']['focusY']; var z = settingData['camera']['focusZ']; - var tarCameraPosition = three.Vector3(settingData['camera']['x'], settingData['camera']['y'], settingData['camera']['z']); + var tarCameraPosition = three.Vector3(settingData['camera']['x'], + settingData['camera']['y'], settingData['camera']['z']); _navigatorTimer = Timer.periodic(const Duration(milliseconds: 50), (timer) { if (!mounted || disposed) { timer.cancel(); @@ -2704,12 +5118,14 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM var cameraPosition = camera.position; var distance = cameraPosition.distanceTo(tarCameraPosition); if (distance < 1) { - cameraPosition.set(tarCameraPosition.x, tarCameraPosition.y, tarCameraPosition.z); + cameraPosition.set( + tarCameraPosition.x, tarCameraPosition.y, tarCameraPosition.z); timer.cancel(); controls.autoRotate = settingData['controls']['autoRotate']; return; } else { - cameraPosition.lerp(tarCameraPosition, settingData['camera']['focusLerp']); + cameraPosition.lerp( + tarCameraPosition, settingData['camera']['focusLerp']); } controls.target.set(x, y, z); }); @@ -2730,7 +5146,10 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM } if (i is three.Mesh) { i.material = three.MeshPhysicalMaterial({ - 'color': settingData['buildings']['randomColor'] == true ? (three.Math.random() * 0xffffff).toInt() : settingData['object']['set'][i.name]!['color'] ?? settingData['buildings']['color'], + 'color': settingData['buildings']['randomColor'] == true + ? (three.Math.random() * 0xffffff).toInt() + : settingData['object']['set'][i.name]!['color'] ?? + settingData['buildings']['color'], 'flatShading': false, 'opacity': mapData[i.name]!['opacity'] ?? 1, 'roughness': 0.1, @@ -2753,8 +5172,10 @@ class _ZHSH3DMapPageState extends State with TickerProviderStateM } var li = ['1', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'c10']; for (var i in li) { - var mesh = scene.getObjectByName('facility_gate_slidedoor_###$i') as three.Mesh; - mesh.position.setX(mapData['facility_gate_slidedoor_###$i']!['x']! - value); + var mesh = + scene.getObjectByName('facility_gate_slidedoor_###$i') as three.Mesh; + mesh.position + .setX(mapData['facility_gate_slidedoor_###$i']!['x']! - value); if (kDebugMode) { print('setGateSlideDoor: $value, facility_gate_slidedoor_###$i'); } diff --git a/lib/provider/theme.dart b/lib/provider/theme.dart index 673d81c5..c1cc53b1 100644 --- a/lib/provider/theme.dart +++ b/lib/provider/theme.dart @@ -17,7 +17,8 @@ class ThemeProvider with ChangeNotifier { if (user != null) { _user = user; // receive Firestore realtime data - final docRef = FirebaseFirestore.instance.collection('user').doc(_user!.uid); + final docRef = + FirebaseFirestore.instance.collection('user').doc(_user!.uid); docRef.snapshots().listen((event) { if (kDebugMode) { print('Remote Firestore Data Changed'); @@ -47,7 +48,8 @@ class ThemeProvider with ChangeNotifier { final SharedPreferences prefs = await SharedPreferences.getInstance(); int? cookieThemeColor = prefs.getInt('themeColor'); int? cookieThemeMode = prefs.getInt('themeMode'); - _themeColor = Color(firebaseThemeColor ?? cookieThemeColor ?? dThemeColor.value); + _themeColor = + Color(firebaseThemeColor ?? cookieThemeColor ?? dThemeColor.value); _themeMode = firebaseThemeMode ?? cookieThemeMode ?? dThemeMode; notifyListeners(); } diff --git a/lib/setting.dart b/lib/setting.dart index 7a722ac8..332f0263 100644 --- a/lib/setting.dart +++ b/lib/setting.dart @@ -42,8 +42,14 @@ class _SettingPageState extends State { }; String colorString(Color color) { String colorHashCode(Color color) { - return color.toString().replaceAll('Color(0xff', '').replaceAll('MaterialColor(primary value: ', '').replaceAll('ColorSwatch(primary value: ', '').replaceAll(')', ''); + return color + .toString() + .replaceAll('Color(0xff', '') + .replaceAll('MaterialColor(primary value: ', '') + .replaceAll('ColorSwatch(primary value: ', '') + .replaceAll(')', ''); } + for (MapEntry entry in _colors.entries) { if (colorHashCode(entry.key) == colorHashCode(color)) { return entry.value; @@ -61,7 +67,8 @@ class _SettingPageState extends State { } return false; }); - Color themeColor = Provider.of(context, listen: true).themeColor; + Color themeColor = + Provider.of(context, listen: true).themeColor; final FirebaseAuth auth = FirebaseAuth.instance; final User? user = auth.currentUser; return SingleChildScrollView( @@ -70,7 +77,11 @@ class _SettingPageState extends State { child: Container( constraints: BoxConstraints( maxWidth: 700, - minHeight: MediaQuery.of(context).size.height - AppBar().preferredSize.height - (MediaQuery.of(context).size.width > 700 ? 0 : 80), //NavigationBar Height + minHeight: MediaQuery.of(context).size.height - + AppBar().preferredSize.height - + (MediaQuery.of(context).size.width > 700 + ? 0 + : 80), //NavigationBar Height ), padding: const EdgeInsets.all(10), child: Column( @@ -84,9 +95,17 @@ class _SettingPageState extends State { title: const Text('General'), children: [ ListTile( - leading: user != null ? const Icon(Icons.sync) : const Icon(Icons.sync_disabled), - title: user != null ? const Text('Logged in') : const Text('Logged out'), - subtitle: user != null ? const Text('Settings will sync to your account, and take effect on all devices immediately.') : const Text('Login to sync settings to your account.'), + leading: user != null + ? const Icon(Icons.sync) + : const Icon(Icons.sync_disabled), + title: user != null + ? const Text('Logged in') + : const Text('Logged out'), + subtitle: user != null + ? const Text( + 'Settings will sync to your account, and take effect on all devices immediately.') + : const Text( + 'Login to sync settings to your account.'), ), ListTile( leading: themeMode == 0 @@ -104,7 +123,9 @@ class _SettingPageState extends State { isSelected: themeModeIsSelected, onPressed: (int index) { setState(() { - for (int buttonIndex = 0; buttonIndex < themeModeIsSelected.length; buttonIndex++) { + for (int buttonIndex = 0; + buttonIndex < themeModeIsSelected.length; + buttonIndex++) { if (buttonIndex == index) { themeModeIsSelected[buttonIndex] = true; themeMode = buttonIndex; @@ -112,7 +133,8 @@ class _SettingPageState extends State { themeModeIsSelected[buttonIndex] = false; } } - Provider.of(context, listen: false).setThemeMode(themeMode); + Provider.of(context, listen: false) + .setThemeMode(themeMode); }); }, children: const [ @@ -159,8 +181,13 @@ class _SettingPageState extends State { TextButton( onPressed: () { setState(() { - themeColor = Provider.of(context, listen: false).defaultThemeColor; - Provider.of(context, listen: false).setThemeColor(themeColor); + themeColor = Provider.of( + context, + listen: false) + .defaultThemeColor; + Provider.of(context, + listen: false) + .setThemeColor(themeColor); Navigator.of(context).pop(); }); }, @@ -168,7 +195,9 @@ class _SettingPageState extends State { ), TextButton( onPressed: () { - Provider.of(context, listen: false).setThemeColor(themeColor); + Provider.of(context, + listen: false) + .setThemeColor(themeColor); Navigator.of(context).pop(); }, child: const Text('OK'), @@ -206,17 +235,20 @@ class _SettingPageState extends State { ), ), onTap: () { - CustomLaunchUrl.launch(context, 'https://flutter.dev'); + CustomLaunchUrl.launch( + context, 'https://flutter.dev'); }, ), InkWell( borderRadius: BorderRadius.circular(16), child: const CustomImage( - src: 'assets/images/BuiltWithFirebaseLightRemoveBackground.png', + src: + 'assets/images/BuiltWithFirebaseLightRemoveBackground.png', height: 60, ), onTap: () { - CustomLaunchUrl.launch(context, 'https://firebase.google.com'); + CustomLaunchUrl.launch( + context, 'https://firebase.google.com'); }, ), ], @@ -229,7 +261,8 @@ class _SettingPageState extends State { trailing: IconButton( icon: const Icon(Icons.open_in_new), onPressed: () { - CustomLaunchUrl.launch(context, 'https://github.com/jhihyulin/WEBSITE/blob/main/LICENSE'); + CustomLaunchUrl.launch(context, + 'https://github.com/jhihyulin/WEBSITE/blob/main/LICENSE'); }, ), ), @@ -240,7 +273,8 @@ class _SettingPageState extends State { trailing: IconButton( icon: const Icon(Icons.open_in_new), onPressed: () { - CustomLaunchUrl.launch(context, 'https://github.com/jhihyulin/WEBSITE'); + CustomLaunchUrl.launch( + context, 'https://github.com/jhihyulin/WEBSITE'); }, ), ), @@ -256,7 +290,8 @@ class _SettingPageState extends State { trailing: IconButton( icon: const Icon(Icons.open_in_new), onPressed: () { - CustomLaunchUrl.launch(context, 'mailto:JY@jhihyulin.live'); + CustomLaunchUrl.launch( + context, 'mailto:JY@jhihyulin.live'); }, ), ), @@ -265,9 +300,11 @@ class _SettingPageState extends State { title: const Text('Version'), subtitle: FutureBuilder( future: PackageInfo.fromPlatform(), - builder: (BuildContext context, AsyncSnapshot snapshot) { + builder: (BuildContext context, + AsyncSnapshot snapshot) { if (snapshot.hasData) { - return Text('${snapshot.data!.version}+${snapshot.data!.buildNumber}'); + return Text( + '${snapshot.data!.version}+${snapshot.data!.buildNumber}'); } else { return const Text('Loading...'); } @@ -298,7 +335,8 @@ class _SettingPageState extends State { 'ALL RIGHTS RESERVED © ${DateTime.now().year} JHIHYULIN.LIVE', textAlign: TextAlign.center, style: TextStyle( - fontSize: Theme.of(context).textTheme.bodySmall?.fontSize, + fontSize: + Theme.of(context).textTheme.bodySmall?.fontSize, ), ), ], diff --git a/lib/tool.dart b/lib/tool.dart index 44b635b8..12ea615d 100644 --- a/lib/tool.dart +++ b/lib/tool.dart @@ -84,7 +84,11 @@ class ToolPage extends StatelessWidget { child: Container( constraints: BoxConstraints( maxWidth: 700, - minHeight: MediaQuery.of(context).size.height - AppBar().preferredSize.height - (MediaQuery.of(context).size.width > 700 ? 0 : 80), //NavigationBar Height + minHeight: MediaQuery.of(context).size.height - + AppBar().preferredSize.height - + (MediaQuery.of(context).size.width > 700 + ? 0 + : 80), //NavigationBar Height ), padding: const EdgeInsets.all(10), child: Column( diff --git a/lib/widget/image.dart b/lib/widget/image.dart index 7891a87e..6a73e8fe 100644 --- a/lib/widget/image.dart +++ b/lib/widget/image.dart @@ -31,7 +31,8 @@ class _CustomImageState extends State { isAntiAlias: true, height: widget.height, width: widget.width, - frameBuilder: (BuildContext context, Widget child, int? frame, bool wasSynchronouslyLoaded) { + frameBuilder: (BuildContext context, Widget child, int? frame, + bool wasSynchronouslyLoaded) { if (wasSynchronouslyLoaded) { return child; } @@ -44,18 +45,24 @@ class _CustomImageState extends State { child: child, ); }, - loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) { + loadingBuilder: (BuildContext context, Widget child, + ImageChunkEvent? loadingProgress) { if (loadingProgress == null) { return child; } return Center( child: CircularProgressIndicator( - value: loadingProgress.expectedTotalBytes != null ? loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes! : null, + value: loadingProgress.expectedTotalBytes != null + ? loadingProgress.cumulativeBytesLoaded / + loadingProgress.expectedTotalBytes! + : null, ), ); }, - errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { - CustomScaffoldMessenger.showErrorMessageSnackBar(context, 'Error: Image Loading Failed.\nException: $exception'); + errorBuilder: + (BuildContext context, Object exception, StackTrace? stackTrace) { + CustomScaffoldMessenger.showErrorMessageSnackBar( + context, 'Error: Image Loading Failed.\nException: $exception'); debugPrint('Error: Image Loading Failed.\nException: $exception'); return Text('😢\n$exception'); }, diff --git a/lib/widget/launch_url.dart b/lib/widget/launch_url.dart index ffac3134..43c52f38 100644 --- a/lib/widget/launch_url.dart +++ b/lib/widget/launch_url.dart @@ -6,7 +6,8 @@ abstract class CustomLaunchUrl { static void launch(context, String url) async { if (!await launchUrl(Uri.parse(url))) { if (context.mounted) { - CustomScaffoldMessenger.showErrorMessageSnackBar(context, 'Error: Could not launch $url'); + CustomScaffoldMessenger.showErrorMessageSnackBar( + context, 'Error: Could not launch $url'); } throw Exception('Error: Could not launch $url'); } diff --git a/lib/widget/linear_progress_indicator.dart b/lib/widget/linear_progress_indicator.dart index 36ba54c7..51e8b736 100644 --- a/lib/widget/linear_progress_indicator.dart +++ b/lib/widget/linear_progress_indicator.dart @@ -21,10 +21,12 @@ class CustomLinearProgressIndicator extends StatefulWidget { final String? semanticsValue; @override - State createState() => _CustomLinearProgressIndicatorState(); + State createState() => + _CustomLinearProgressIndicatorState(); } -class _CustomLinearProgressIndicatorState extends State { +class _CustomLinearProgressIndicatorState + extends State { @override Widget build(BuildContext context) { return ClipRRect( diff --git a/lib/widget/scaffold_messenger.dart b/lib/widget/scaffold_messenger.dart index e744888b..e4402952 100644 --- a/lib/widget/scaffold_messenger.dart +++ b/lib/widget/scaffold_messenger.dart @@ -44,7 +44,8 @@ abstract class CustomScaffoldMessenger { onPressed: () async { PackageInfo packageInfo = await PackageInfo.fromPlatform(); if (context.mounted) { - CustomLaunchUrl.launch(context, 'mailto:admin@jhihyulin.live?subject=%5BWebsite%5D%20Error%20Report&body=%5BError%5D%3A%20$error%0D%0A%0D%0A%5BRoute%5D%3A%20${ModalRoute.of(context)?.settings.name}%0D%0A%0D%0A%5BTime%5D%3A%20${'${DateTime.now().toLocal()} ${DateTime.now().timeZoneName}'}%0D%0A%0D%0A%5BUserAgent%5D%3A%20${html.window.navigator.userAgent}%0D%0A%0D%0A%5BVersion%5D%3A%20${packageInfo.version}+${packageInfo.buildNumber}'); + CustomLaunchUrl.launch(context, + 'mailto:admin@jhihyulin.live?subject=%5BWebsite%5D%20Error%20Report&body=%5BError%5D%3A%20$error%0D%0A%0D%0A%5BRoute%5D%3A%20${ModalRoute.of(context)?.settings.name}%0D%0A%0D%0A%5BTime%5D%3A%20${'${DateTime.now().toLocal()} ${DateTime.now().timeZoneName}'}%0D%0A%0D%0A%5BUserAgent%5D%3A%20${html.window.navigator.userAgent}%0D%0A%0D%0A%5BVersion%5D%3A%20${packageInfo.version}+${packageInfo.buildNumber}'); } }, ), diff --git a/lib/widget/slide_transition.dart b/lib/widget/slide_transition.dart index 8b3b8261..be001344 100644 --- a/lib/widget/slide_transition.dart +++ b/lib/widget/slide_transition.dart @@ -58,4 +58,4 @@ class CustomSlideTransition extends AnimatedWidget { child: child, ); } -} \ No newline at end of file +} From d9c27a42639b1f745dff76c00eaef0cfe2d43675 Mon Sep 17 00:00:00 2001 From: jhih_yu Date: Wed, 16 Aug 2023 22:50:25 +0800 Subject: [PATCH 08/11] [Update] bye twitter --- lib/pages/about.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pages/about.dart b/lib/pages/about.dart index 070be035..7f4d576e 100644 --- a/lib/pages/about.dart +++ b/lib/pages/about.dart @@ -23,8 +23,8 @@ Map> socialMedia = { 'url': 'https://gitlab.com/jhihyulin', 'icon': FontAwesome.gitlab, }, - 'Twitter': { - 'url': 'https://twitter.com/jhih_yu_lin', + 'X': { + 'url': 'https://x.com/jhih_yu_lin', 'icon': FontAwesome.twitter, }, 'Facebook': { From f13a8496fe4e7ad5d54d8a51b4b361e4c7cc0756 Mon Sep 17 00:00:00 2001 From: jhih_yu Date: Wed, 16 Aug 2023 23:01:57 +0800 Subject: [PATCH 09/11] [Upgrade] package --- pubspec.lock | 152 +++++++++++++++++++++++++-------------------------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 348ec4e5..413d5579 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "5dce45a06d386358334eb1689108db6455d90ceb0d75848d5f4819283d4ee2b8" + sha256: "1a5e13736d59235ce0139621b4bbe29bc89839e202409081bc667eb3cd20674c" url: "https://pub.dev" source: hosted - version: "1.3.4" + version: "1.3.5" animated_text_kit: dependency: "direct main" description: @@ -101,26 +101,26 @@ packages: dependency: "direct main" description: name: cloud_firestore - sha256: f1a06ad4499ed9ab73703560d44893e6b9e66ce3923c9121f4ef3981c972057f + sha256: "6ffb0e84efbaab16245994bcf61ba10a98ee1e73bac075cae8036ba6427a7ac0" url: "https://pub.dev" source: hosted - version: "4.8.4" + version: "4.8.5" cloud_firestore_platform_interface: dependency: transitive description: name: cloud_firestore_platform_interface - sha256: "86bd1865abbeb09a7d09da3e70364a09f894937270651fc611a1c6d6a9f7b02c" + sha256: "1487af8fd74a9ca754995cae1cf6bb2440ac4a93a5f7c7bbe7cc434231cc03c9" url: "https://pub.dev" source: hosted - version: "5.15.3" + version: "5.15.4" cloud_firestore_web: dependency: transitive description: name: cloud_firestore_web - sha256: ac2eeb2a7ab1928c3aacc30eed750fa839d6f620e112a5459e321df217be2f47 + sha256: c3d37dad0b5637ab337acc4ab204e6d739e3be0e7972cdc85bdc4aac5145c92d url: "https://pub.dev" source: hosted - version: "3.6.3" + version: "3.6.4" collection: dependency: transitive description: @@ -181,10 +181,10 @@ packages: dependency: transitive description: name: dio - sha256: "3866d67f93523161b643187af65f5ac08bc991a5bcdaf41a2d587fe4ccb49993" + sha256: ce75a1b40947fea0a0e16ce73337122a86762e38b982e1ccb909daa3b9bc4197 url: "https://pub.dev" source: hosted - version: "5.3.0" + version: "5.3.2" email_validator: dependency: transitive description: @@ -213,10 +213,10 @@ packages: dependency: transitive description: name: ffi - sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.0" file: dependency: transitive description: @@ -261,58 +261,58 @@ packages: dependency: "direct main" description: name: firebase_app_check - sha256: "9ed115cea8828a6c5b3f9f8a451177f2024587f3c18490e48924c0547a5436b3" + sha256: "87d42da93654be3dfe2c1d426a2f45300b2234c180534380b2636267eaba7ca2" url: "https://pub.dev" source: hosted - version: "0.1.5+1" + version: "0.1.5+2" firebase_app_check_platform_interface: dependency: transitive description: name: firebase_app_check_platform_interface - sha256: "09bfbebef7905f303f77e57c01cb48b9136ff660f8d2115d86807cff3e3074b6" + sha256: "5a88fa4c6cee7263e66c52227505ffe7bea66a6c518c1a20bf4def3ff77b55f9" url: "https://pub.dev" source: hosted - version: "0.0.9+1" + version: "0.0.9+2" firebase_app_check_web: dependency: transitive description: name: firebase_app_check_web - sha256: ef71760ce624c18e5bca8ac0156c695da921bedaee83f1472b8f8c3670fea4fb + sha256: "09bbf8abe8baee17c67850fbae79c7d074ec50ff6194849b896ceba203f3ff8c" url: "https://pub.dev" source: hosted - version: "0.0.11+1" + version: "0.0.11+2" firebase_auth: dependency: "direct main" description: name: firebase_auth - sha256: "49fd35ce06f2530dd460e5dc123235731cb61dd7c76b0af4b6e190404880d04d" + sha256: ae8029eee0ed24a0ae4a9bcc94c5ef9c2e0c31066c5132c56575da929dd14a46 url: "https://pub.dev" source: hosted - version: "4.7.2" + version: "4.7.3" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface - sha256: "817f3ceb84ef5e9adaaf50cf7a19255f6ffcdd12c6f9e9aa4cf00fc7f2eb3cfb" + sha256: cb099fbd3d48f7983c8d7cea45947d98d36174fb7d611e4ff08f802491e8a945 url: "https://pub.dev" source: hosted - version: "6.16.1" + version: "6.16.2" firebase_auth_web: dependency: transitive description: name: firebase_auth_web - sha256: e9044778287f1ff8f9f4cee7e247b03ec87bb8977e0e65ad27dc337e196132e8 + sha256: d35abf4c6c77c9e7be5d7a637e6e07765b70426015800ba031257f382bff5f83 url: "https://pub.dev" source: hosted - version: "5.6.2" + version: "5.6.3" firebase_core: dependency: "direct main" description: name: firebase_core - sha256: "2e9324f719e90200dc7d3c4f5d2abc26052f9f2b995d3b6626c47a0dfe1c8192" + sha256: c78132175edda4bc532a71e01a32964e4b4fcf53de7853a422d96dac3725f389 url: "https://pub.dev" source: hosted - version: "2.15.0" + version: "2.15.1" firebase_core_platform_interface: dependency: transitive description: @@ -325,98 +325,98 @@ packages: dependency: transitive description: name: firebase_core_web - sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa" + sha256: "4cf4d2161530332ddc3c562f19823fb897ff37a9a774090d28df99f47370e973" url: "https://pub.dev" source: hosted - version: "2.6.0" + version: "2.7.0" firebase_database: dependency: "direct main" description: name: firebase_database - sha256: "08eff8d3321973f73f94633d807fb1f4589b4e2d2e0c33c7e656f42d2f9eba72" + sha256: "61d4f75599382194e5a5617e606f61ea5fe092315c61976fab9d3bd7b291e23c" url: "https://pub.dev" source: hosted - version: "10.2.4" + version: "10.2.5" firebase_database_platform_interface: dependency: transitive description: name: firebase_database_platform_interface - sha256: db95e96b27c6d8ee4e1daf9ee7ff0e7433c5c340f9cfb5d855e65cbdb7430b9c + sha256: "951738c448a01a9aca2b72b59bf9ebd769a59e49cbae8a5b376e9bdd0ccba3de" url: "https://pub.dev" source: hosted - version: "0.2.5+4" + version: "0.2.5+5" firebase_database_web: dependency: transitive description: name: firebase_database_web - sha256: "1ae57beac0a002d0a778bcde569c3fad2457b7ca3d9ef2936287e562d0af6962" + sha256: fcbd0fc83cabd529b88723d6721d10d7a88d10480fd93904513e60e32c5016d1 url: "https://pub.dev" source: hosted - version: "0.2.3+4" + version: "0.2.3+5" firebase_dynamic_links: dependency: transitive description: name: firebase_dynamic_links - sha256: "4872f4d7e94736041398bc3490c2ddd87ee159d6b051ba01ca2708e5260a7ebe" + sha256: c604cebcc4c2baf978a8c286ab618d8472aaa813497ab4002cb968cd73b03ed8 url: "https://pub.dev" source: hosted - version: "5.3.4" + version: "5.3.5" firebase_dynamic_links_platform_interface: dependency: transitive description: name: firebase_dynamic_links_platform_interface - sha256: "946fccfefb67e26bf63e392f1b3917d79ea031d3071488f0c5e8ab72de8219ab" + sha256: "2a6f77434fcb36c8409d29785fee45a262deffc9d36205a81cbe0093802e72bd" url: "https://pub.dev" source: hosted - version: "0.2.6+4" + version: "0.2.6+5" firebase_ui_auth: dependency: "direct main" description: name: firebase_ui_auth - sha256: e439571fcad7ed48450eed8d64c70b93765526b876327055469806a51101eff0 + sha256: c597e1482ba8f4d3db0f9b97d839754ad76dba514bd1ee94d31a0126d5a3e287 url: "https://pub.dev" source: hosted - version: "1.6.2" + version: "1.6.3" firebase_ui_localizations: dependency: transitive description: name: firebase_ui_localizations - sha256: b13be7432af3eed2ff6f2ed1c55a9afc32ffa7376fcada9e16be055fad6415ed + sha256: "830bd79f3e4ccfb4b8ee83e9928de6be97ce1bc80b1b4c16bce8565eb5b48a37" url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "1.5.1" firebase_ui_oauth: dependency: transitive description: name: firebase_ui_oauth - sha256: "2cbe5a8996134f1a57205a5ebfa5863c5d599c03a07aae70867de2ecdfbbde0e" + sha256: bfa054140628dff703c8204080336d6616e4f49bbf51e9cf7d73b7d5970d5f1a url: "https://pub.dev" source: hosted - version: "1.4.7" + version: "1.4.8" firebase_ui_oauth_facebook: dependency: "direct main" description: name: firebase_ui_oauth_facebook - sha256: "638acc35f039a9c581b336a28d66e257b964edbe6b6a913d5bb9a0530fb32f26" + sha256: "3b56e59cecb95e8e5dde55f899f8c542b62835b6307fb3fefa86d6fe62dd156b" url: "https://pub.dev" source: hosted - version: "1.2.7" + version: "1.2.8" firebase_ui_oauth_google: dependency: "direct main" description: name: firebase_ui_oauth_google - sha256: "0e255ced67023871040b3d349c966a281a54ce1a093128733ccbd0a6b00a95d1" + sha256: "47fa590840e6d4ad661f6ae8782c3f14a987b37f524e7c2ce83323cbdeb7ce6b" url: "https://pub.dev" source: hosted - version: "1.2.7" + version: "1.2.8" firebase_ui_oauth_twitter: dependency: "direct main" description: name: firebase_ui_oauth_twitter - sha256: "7ad65636f6c3806cafdc6b51c53f3060630b9155dcc95c7c258795b45ef3b494" + sha256: ad99c6b166719f0adcfe29877f83b2d6c1baca25a669840588f80db369fb2831 url: "https://pub.dev" source: hosted - version: "1.2.7" + version: "1.2.8" firebase_ui_shared: dependency: transitive description: @@ -519,10 +519,10 @@ packages: dependency: "direct main" description: name: flutter_markdown - sha256: "4b1bfbb802d76320a1a46d9ce984106135093efd9d969765d07c2125af107bdf" + sha256: "2b206d397dd7836ea60035b2d43825c8a303a76a5098e66f42d55a753e18d431" url: "https://pub.dev" source: hosted - version: "0.6.17" + version: "0.6.17+1" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -705,10 +705,10 @@ packages: dependency: "direct main" description: name: image_picker - sha256: "6296e98782726d37f59663f0727d0e978eee1ced1ffed45ccaba591786a7f7b3" + sha256: "841837258e0b42c80946c43443054fc726f5e8aa84a97f363eb9ef0d45b33c14" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.2" image_picker_android: dependency: transitive description: @@ -721,10 +721,10 @@ packages: dependency: transitive description: name: image_picker_for_web - sha256: "869fe8a64771b7afbc99fc433a5f7be2fea4d1cb3d7c11a48b6b579eb9c797f0" + sha256: "8b6c160cdbe572199103a091c783685b236110e4a0fd7a4947f32ff5b7da8765" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "3.0.0" image_picker_ios: dependency: transitive description: @@ -881,10 +881,10 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: ceb027f6bc6a60674a233b4a90a7658af1aebdea833da0b5b53c1e9821a78c7b + sha256: "6ff267fcd9d48cb61c8df74a82680e8b82e940231bb5f68356672fde0397334a" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.0" package_info_plus_platform_interface: dependency: transitive description: @@ -913,50 +913,50 @@ packages: dependency: transitive description: name: path_provider - sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2" + sha256: "909b84830485dbcd0308edf6f7368bc8fd76afa26a270420f34cabea2a6467a0" url: "https://pub.dev" source: hosted - version: "2.0.15" + version: "2.1.0" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86" + sha256: "5d44fc3314d969b84816b569070d7ace0f1dea04bd94a83f74c4829615d22ad8" url: "https://pub.dev" source: hosted - version: "2.0.27" + version: "2.1.0" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "916731ccbdce44d545414dd9961f26ba5fbaa74bcbb55237d8e65a623a8c7297" + sha256: "1b744d3d774e5a879bb76d6cd1ecee2ba2c6960c03b1020cd35212f6aa267ac5" url: "https://pub.dev" source: hosted - version: "2.2.4" + version: "2.3.0" path_provider_linux: dependency: transitive description: name: path_provider_linux - sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57 + sha256: ba2b77f0c52a33db09fc8caf85b12df691bf28d983e84cf87ff6d693cfa007b3 url: "https://pub.dev" source: hosted - version: "2.1.11" + version: "2.2.0" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" + sha256: bced5679c7df11190e1ddc35f3222c858f328fff85c3942e46e7f5589bf9eb84 url: "https://pub.dev" source: hosted - version: "2.0.6" + version: "2.1.0" path_provider_windows: dependency: transitive description: name: path_provider_windows - sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96" + sha256: ee0e0d164516b90ae1f970bdf29f726f1aa730d7cfc449ecc74c495378b705da url: "https://pub.dev" source: hosted - version: "2.1.7" + version: "2.2.0" petitparser: dependency: transitive description: @@ -1057,10 +1057,10 @@ packages: dependency: transitive description: name: shared_preferences_foundation - sha256: f39696b83e844923b642ce9dd4bd31736c17e697f6731a5adf445b1274cf3cd4 + sha256: d29753996d8eb8f7619a1f13df6ce65e34bc107bef6330739ed76f18b22310ef url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.3" shared_preferences_linux: dependency: transitive description: @@ -1214,10 +1214,10 @@ packages: dependency: transitive description: name: url_launcher_android - sha256: "78cb6dea3e93148615109e58e42c35d1ffbf5ef66c44add673d0ab75f12ff3af" + sha256: "3dd2388cc0c42912eee04434531a26a82512b9cb1827e0214430c9bcbddfe025" url: "https://pub.dev" source: hosted - version: "6.0.37" + version: "6.0.38" url_launcher_ios: dependency: transitive description: @@ -1310,10 +1310,10 @@ packages: dependency: transitive description: name: xdg_directories - sha256: e0b1147eec179d3911f1f19b59206448f78195ca1d20514134e10641b7d7fbff + sha256: f0c26453a2d47aa4c2570c6a033246a3fc62da2fe23c7ffdd0a7495086dc0247 url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.2" xml: dependency: transitive description: From 03ddff19f356b4741969f3a3babadcd22f79a1c8 Mon Sep 17 00:00:00 2001 From: jhih_yu Date: Wed, 16 Aug 2023 23:30:03 +0800 Subject: [PATCH 10/11] [Update] Bye bluebird --- assets/fonts/MyIcons.ttf | Bin 0 -> 1752 bytes assets/fonts/config.json | 24 ++++++++++++++++++++++++ assets/images/x-twitter.svg | 1 + lib/pages/about.dart | 7 ++++++- lib/widget/my_icons.dart | 25 +++++++++++++++++++++++++ pubspec.yaml | 3 +++ 6 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 assets/fonts/MyIcons.ttf create mode 100644 assets/fonts/config.json create mode 100644 assets/images/x-twitter.svg create mode 100644 lib/widget/my_icons.dart diff --git a/assets/fonts/MyIcons.ttf b/assets/fonts/MyIcons.ttf new file mode 100644 index 0000000000000000000000000000000000000000..21379dbd946837fa54b7e19cbb93f8c0cba14d91 GIT binary patch literal 1752 zcmd^9zi%8x6#i!SY{$OHK}3oo2-1X*$X3kV`7EI*iYzMzTb67<7so{)LhHM|+q3p| zSG(gMmx_WaxS#?-0SyI06etuFq@bXnM1qO}1r#Y4L6O2pDPYYvvy;d{$zPCnnwjr? z-@Er_-p(!rfHK~Ni`wF)%NOPQr>_Cx9NE=3E>-KZa%r3XF8#G;&r9x3eD@{&zc`Xk z*l*8Wy>}dNThx~W-)o&dynT}R7RM_AiIEHLW#XG0F9kidGx8G=#BEN8!no<-jP~8P zISu!`okWb|1a;* zLoV6J*qiOwT9_MPQ1s)9+rWnmv)#}qE>5j;^GO3!9IP)^ZOrRrb@UWho|1eCFPfN= z<_Fm4xr>>8v2zH$@2A}kn+EXC8Z*7pouU=p*Y}&xjyLRE-mo%`P?#ANC(Gg#=jX+Y zIOW{Gp8qV?^FM#Re_dS6zY;I}@Xd05wBhXKU*uEbM1ET&;%5GDKI!Q9@LBw3a{~(x z>j;d{D{4B#D;B%N51w*~_$|v1aWCr@50md%JchGS7MF1ppXr-X8fBeb+^|?+T+CYR z5HDNo5?`^nL>yQ=gkxgM;$iZ;7LQ>~d}47KXT-hvIO(U|PN3w({G_bc>N9e^FJn^O z$P1;nse(AoS?Ko0?7{=OL=`WGb8h&Rp^iu2DWzA2sZXC(! zO3gBhe&nZ~@>{x8w$-UC)t2ov?#Tt4QzmJ=;Wt$!P%1fJtsbm}dBjN2M~W^w2-rJ` z39^%1>-;{{`JIyNbf0rOTAtd8rlm7^elF^^zXj9Rwf^XuRR3lWN*B;+c9ibVm zhy2A4wG~!bGI0?yG^lr&DP)zD_u-)SsJCV+Wjuk-D>2QCwg3HNkui~p^GxLyT(KE;T!qypNCWQ?gT9+hCq1<140LitKq*`Fqm2`2HBv-`~fXBOKvkbmwKY K-PPBEG5-PDcn10a literal 0 HcmV?d00001 diff --git a/assets/fonts/config.json b/assets/fonts/config.json new file mode 100644 index 00000000..b485cebf --- /dev/null +++ b/assets/fonts/config.json @@ -0,0 +1,24 @@ +{ + "name": "MyIcons", + "css_prefix_text": "", + "css_use_suffix": false, + "hinting": true, + "units_per_em": 1000, + "ascent": 850, + "glyphs": [ + { + "uid": "363e7ed079367b1c714e443dd168b416", + "css": "x-twitter", + "code": 59392, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M760.2 93.8H898L596.9 437.9 951.2 906.3H673.8L456.4 622.3 208 906.3H69.9L392 538.1 52.3 93.8H336.7L533 353.3 760.2 93.8ZM711.7 823.8H788.1L295.1 171.9H213.1L711.7 823.8Z", + "width": 1000 + }, + "search": [ + "x-twitter" + ] + } + ] +} \ No newline at end of file diff --git a/assets/images/x-twitter.svg b/assets/images/x-twitter.svg new file mode 100644 index 00000000..f5feed78 --- /dev/null +++ b/assets/images/x-twitter.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/lib/pages/about.dart b/lib/pages/about.dart index 7f4d576e..fd376eb0 100644 --- a/lib/pages/about.dart +++ b/lib/pages/about.dart @@ -9,6 +9,7 @@ import '../widget/linear_progress_indicator.dart'; import '../widget/launch_url.dart'; import '../widget/card.dart'; import '../widget/image.dart'; +import '../widget/my_icons.dart'; Map> socialMedia = { 'GitHub': { @@ -25,7 +26,11 @@ Map> socialMedia = { }, 'X': { 'url': 'https://x.com/jhih_yu_lin', - 'icon': FontAwesome.twitter, + 'icon': MyIcons.x, + // FontAwesome released 6.4.2, but flutter_icons_plus is still 6.3.0 + // so I download from https://fontawesome.com/icons/x-twitter + // https://site-assets.fontawesome.com/releases/v6.4.2/svgs/brands/x-twitter.svg + // and generate .ttf file on fluttericon.com }, 'Facebook': { 'url': 'https://facebook.com/jhihyu0414', diff --git a/lib/widget/my_icons.dart b/lib/widget/my_icons.dart new file mode 100644 index 00000000..d418454d --- /dev/null +++ b/lib/widget/my_icons.dart @@ -0,0 +1,25 @@ +/// Flutter icons MyIcons +/// Copyright (C) 2023 by original authors @ fluttericon.com, fontello.com +/// This font was generated by FlutterIcon.com, which is derived from Fontello. +/// +/// To use this font, place it in your fonts/ directory and include the +/// following in your pubspec.yaml +/// +/// flutter: +/// fonts: +/// - family: MyIcons +/// fonts: +/// - asset: fonts/MyIcons.ttf +/// +/// +/// +import 'package:flutter/widgets.dart'; + +class MyIcons { + MyIcons._(); + + static const _kFontFam = 'MyIcons'; + static const String? _kFontPkg = null; + + static const IconData x = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); +} diff --git a/pubspec.yaml b/pubspec.yaml index 1a94954d..a3bbf2f5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -51,3 +51,6 @@ flutter: - family: SocialIcons fonts: - asset: packages/firebase_ui_auth/fonts/SocialIcons.ttf + - family: MyIcons + fonts: + - asset: assets/fonts/MyIcons.ttf From 800560e540e7dd81c2578c92b26c8d75d2b749f5 Mon Sep 17 00:00:00 2001 From: jhih_yu Date: Wed, 16 Aug 2023 23:30:56 +0800 Subject: [PATCH 11/11] [Update] about --- lib/pages/about.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/pages/about.dart b/lib/pages/about.dart index fd376eb0..e2969d29 100644 --- a/lib/pages/about.dart +++ b/lib/pages/about.dart @@ -132,12 +132,12 @@ Map experience = { }; Map> school = { - // 'National Dong Hwa University': { - // 'part': 'Department of Physics', - // 'url': 'https://www.ndhu.edu.tw', - // 'icon': 'assets/images/ndhu.png', - // 'start': '2023', - // }, + 'National Dong Hwa University': { + 'part': 'Department of Physics', + 'url': 'https://www.ndhu.edu.tw', + 'icon': 'assets/images/ndhu.png', + 'start': '2023', + }, 'Zhonghe Senior High School': { 'url': 'https://www.chshs.ntpc.edu.tw', 'icon': 'assets/images/chshs.png',