diff --git a/android/app/google-services.json b/android/app/google-services.json index a160a91..5f40e04 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -35,7 +35,7 @@ "client_id": "254789615258-qbpjmknq1u9473imrnnh2chlbcs6i2b1.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "com.huynh.listarFlutter" + "bundle_id": "safer-app" } } ] diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 399e934..9bb7cc1 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1,2 +1,3 @@ #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig" +#include "Generated.xcconfig" \ No newline at end of file diff --git a/ios/Podfile b/ios/Podfile index 1e8c3c9..cd7bb19 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '9.0' +platform :ios, '12.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -27,6 +27,34 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe flutter_ios_podfile_setup +def flutter_install_ios_plugin_pods(ios_application_path = nil) + ios_application_path ||= File.dirname(defined_in_file.realpath) if self.respond_to?(:defined_in_file) + raise 'Could not find iOS application path' unless ios_application_path + + symlink_dir = File.expand_path('.symlinks', ios_application_path) + system('rm', '-rf', symlink_dir) # Avoid the complication of dependencies like FileUtils. + + symlink_plugins_dir = File.expand_path('plugins', symlink_dir) + system('mkdir', '-p', symlink_plugins_dir) + + plugins_file = File.join(ios_application_path, '..', '.flutter-plugins-dependencies') + plugin_pods = flutter_parse_plugins_file(plugins_file) + plugin_pods.each do |plugin_hash| + plugin_name = plugin_hash['name'] + plugin_path = plugin_hash['path'] + if (plugin_name && plugin_path) + symlink = File.join(symlink_plugins_dir, plugin_name) + File.symlink(plugin_path, symlink) + + if plugin_name == 'flutter_ffmpeg' + pod 'flutter_ffmpeg/full-lts', :path => File.join('.symlinks', 'plugins', plugin_name, 'ios') + else + pod plugin_name, :path => File.join('.symlinks', 'plugins', plugin_name, 'ios') + end + end + end +end + target 'Runner' do use_frameworks! use_modular_headers! diff --git a/ios/Podfile.lock b/ios/Podfile.lock index b5d1b7f..026b207 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -29,6 +29,6 @@ SPEC CHECKSUMS: shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef -PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c +PODFILE CHECKSUM: 502dac89f6d68f7e85233ab289bd04f9c79b8c93 COCOAPODS: 1.10.1 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index fa95b1f..e77ab1f 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -173,7 +173,7 @@ TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; - DevelopmentTeam = 3C2ZJ87Z72; + DevelopmentTeam = 88X4S7R58M; LastSwiftMigration = 0910; }; }; @@ -376,7 +376,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = 2; - DEVELOPMENT_TEAM = 3C2ZJ87Z72; + DEVELOPMENT_TEAM = 88X4S7R58M; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -390,7 +390,7 @@ "$(PROJECT_DIR)/Flutter", ); MARKETING_VERSION = 1.0.3; - PRODUCT_BUNDLE_IDENTIFIER = com.huynh.listarFlutter; + PRODUCT_BUNDLE_IDENTIFIER = "safer-app"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 4.0; @@ -513,7 +513,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = 2; - DEVELOPMENT_TEAM = 3C2ZJ87Z72; + DEVELOPMENT_TEAM = 88X4S7R58M; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -527,7 +527,7 @@ "$(PROJECT_DIR)/Flutter", ); MARKETING_VERSION = 1.0.3; - PRODUCT_BUNDLE_IDENTIFIER = com.huynh.listarFlutter; + PRODUCT_BUNDLE_IDENTIFIER = "safer-app"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -544,7 +544,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = 2; - DEVELOPMENT_TEAM = 3C2ZJ87Z72; + DEVELOPMENT_TEAM = 88X4S7R58M; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -558,7 +558,7 @@ "$(PROJECT_DIR)/Flutter", ); MARKETING_VERSION = 1.0.3; - PRODUCT_BUNDLE_IDENTIFIER = com.huynh.listarFlutter; + PRODUCT_BUNDLE_IDENTIFIER = "safer-app"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 4.0; diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 46d2d0d..c7e864c 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ PLIST_VERSION 1 BUNDLE_ID - com.huynh.listarFlutter + safer-app PROJECT_ID listarflutter STORAGE_BUCKET diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements index 903def2..0c67376 100644 --- a/ios/Runner/Runner.entitlements +++ b/ios/Runner/Runner.entitlements @@ -1,8 +1,5 @@ - - aps-environment - development - + diff --git a/lib/screens/safer_main_menu/personal_risk.dart b/lib/screens/safer_main_menu/personal_risk.dart index e433616..aba5e82 100644 --- a/lib/screens/safer_main_menu/personal_risk.dart +++ b/lib/screens/safer_main_menu/personal_risk.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:flutter_spinbox/material.dart'; +import 'package:http/http.dart' as http; +import 'package:listar_flutter/widgets/widget.dart'; class PersonalRisk extends StatefulWidget { final String title; @@ -13,6 +14,8 @@ class PersonalRisk extends StatefulWidget { } class _PersonalRiskState extends State { + bool _loading = false; + List _specialNeeds = []; List _priorFlooding = []; List _priorDamages = []; @@ -102,6 +105,29 @@ class _PersonalRiskState extends State { super.initState(); } + Future senddata() async { + setState(() { + _loading = true; + }); + final response = await http.post( + "https://stormassistance.research.uconn.edu/personal_risk.php", + body: { + "userId": "test", + "specialNeeds": _specialNeeds.join(", "), + "priorFlooding": _priorFlooding.join(", "), + "priorDamages": _priorDamages.join(", "), + "priorDangers": _priorDangers.join(", "), + "priorOutage": _priorOutage.join(", "), + "safePlaces": _safePlace.join(", "), + "resAvailable": _doYouHave.join(", "), + "riskScore": + "${_riskScore.values.reduce((sum, element) => sum + element)}", + }); + setState(() { + _loading = false; + }); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -113,27 +139,6 @@ class _PersonalRiskState extends State { ), body: ListView( children: [ - Card( - clipBehavior: Clip.antiAlias, - child: Column( - children: [ - Padding( - padding: const EdgeInsets.all(8), - ), - ListTile( - title: RichText( - text: TextSpan( - style: TextStyle( - color: Colors.black, fontSize: 20, fontFamily: 'Raleway'), - text: - 'Your Risk Score: ${_riskScore.values.reduce((sum, element) => sum + element)}', - ))), - Padding( - padding: const EdgeInsets.all(8), - ), - ], - ), - ), Card( clipBehavior: Clip.antiAlias, child: Column( @@ -569,6 +574,22 @@ class _PersonalRiskState extends State { ], ), ), + Padding( + padding: EdgeInsets.only( + left: 20, + right: 20, + top: 15, + bottom: 15, + ), + child: AppButton( + onPressed: () { + senddata(); + }, + loading: _loading, + disableTouchWhenLoading: true, + text: 'Submit', + ), + ) ], ), ); diff --git a/lib/screens/safer_main_menu/personal_safety.dart b/lib/screens/safer_main_menu/personal_safety.dart index f1a34d5..9ef16d4 100644 --- a/lib/screens/safer_main_menu/personal_safety.dart +++ b/lib/screens/safer_main_menu/personal_safety.dart @@ -36,52 +36,170 @@ class _PersonalSafetyState extends State { padding: const EdgeInsets.all(8), ), ListTile( + leading: CircleAvatar( + backgroundImage: AssetImage('assets/images/ct-map.png')), title: RichText( text: TextSpan( style: TextStyle( - color: Colors.black, - fontSize: 20, + color: Colors.black.withOpacity(1), + fontSize: 15, fontFamily: 'Raleway'), - text: 'Personal Safety in a Storm', - children: [ - TextSpan( - text: '\n\n- Stay home/indoors', - style: TextStyle(fontSize: 15)), - TextSpan( - text: - '\n\n- Stay away from:\n - Electrical equipment\n - Windows/skylights/doors', - style: TextStyle(fontSize: 15)), - TextSpan( - text: - '\n\n- Stay in lower home level:\n - Glassless space\n - Hallway/closet/bathroom', - style: TextStyle(fontSize: 15)), - TextSpan( - text: - '\n\n- Shut off electricty breaker\n - Hear thundering\n - See lightening\n - If flooding is likely', - style: TextStyle(fontSize: 15)), - TextSpan( - text: - '\n\n- Don\'t use:\n - Phones\n - Bath/shower', - style: TextStyle(fontSize: 15)), - TextSpan( - text: '\n\n- During power loss:', - style: TextStyle(fontSize: 15)), - TextSpan( - text: - '\n - Shut off all appliances:\n - AC, water heater, etc.\n - Computer, toaster, etc.', - style: TextStyle(fontSize: 15)), - TextSpan( - text: - '\n - No refrigerator use:\n - Turn to coldest setting\n - Keep doors shut', - style: TextStyle(fontSize: 15)), - TextSpan( - text: '\n\n- Don\'t go outside', - style: TextStyle(fontSize: 15)), - TextSpan( - text: - '\n - Eye of the storm passed:\n - New wind will strike\n - Lightening can strike\n - Flying debris can strike', - style: TextStyle(fontSize: 15)), - ], + text: 'Stay home/indoors', + )), + ), + Padding( + padding: const EdgeInsets.all(8), + ), + ], + ), + ), + Card( + clipBehavior: Clip.antiAlias, + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8), + ), + ListTile( + leading: CircleAvatar( + backgroundImage: AssetImage('assets/images/ct-map.png')), + title: RichText( + text: TextSpan( + style: TextStyle( + color: Colors.black.withOpacity(1), + fontSize: 14, + fontFamily: 'Raleway'), + text: + 'Stay away from:\n - Electrical equipment\n - Windows/skylights/doors', + )), + ), + Padding( + padding: const EdgeInsets.all(8), + ), + ], + ), + ), + Card( + clipBehavior: Clip.antiAlias, + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8), + ), + ListTile( + leading: CircleAvatar( + backgroundImage: AssetImage('assets/images/ct-map.png')), + title: RichText( + text: TextSpan( + style: TextStyle( + color: Colors.black.withOpacity(1), + fontSize: 14, + fontFamily: 'Raleway'), + text: + 'Stay in lower home level:\n - Glassless space\n - Hallway/closet/bathroom', + )), + ), + Padding( + padding: const EdgeInsets.all(8), + ), + ], + ), + ), + Card( + clipBehavior: Clip.antiAlias, + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8), + ), + ListTile( + leading: CircleAvatar( + backgroundImage: AssetImage('assets/images/ct-map.png')), + title: RichText( + text: TextSpan( + style: TextStyle( + color: Colors.black.withOpacity(1), + fontSize: 14, + fontFamily: 'Raleway'), + text: + 'Shut off electricty breaker\n - Hear thundering\n - See lightening\n - If flooding is likely', + )), + ), + Padding( + padding: const EdgeInsets.all(8), + ), + ], + ), + ), + Card( + clipBehavior: Clip.antiAlias, + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8), + ), + ListTile( + leading: CircleAvatar( + backgroundImage: AssetImage('assets/images/ct-map.png')), + title: RichText( + text: TextSpan( + style: TextStyle( + color: Colors.black.withOpacity(1), + fontSize: 14, + fontFamily: 'Raleway'), + text: 'Don\'t use:\n - Phones\n - Bath/shower', + )), + ), + Padding( + padding: const EdgeInsets.all(8), + ), + ], + ), + ), + Card( + clipBehavior: Clip.antiAlias, + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8), + ), + ListTile( + leading: CircleAvatar( + backgroundImage: AssetImage('assets/images/ct-map.png')), + title: RichText( + text: TextSpan( + style: TextStyle( + color: Colors.black.withOpacity(1), + fontSize: 14, + fontFamily: 'Raleway'), + text: + 'During power loss: \n - Shut off all appliances:\n - AC, water heater, etc.\n - Computer, toaster, etc. \n - No refrigerator use:\n - Turn to coldest setting\n - Keep doors shut', + )), + ), + Padding( + padding: const EdgeInsets.all(8), + ), + ], + ), + ), + Card( + clipBehavior: Clip.antiAlias, + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8), + ), + ListTile( + leading: CircleAvatar( + backgroundImage: AssetImage('assets/images/ct-map.png')), + title: RichText( + text: TextSpan( + style: TextStyle( + color: Colors.black.withOpacity(1), + fontSize: 14, + fontFamily: 'Raleway'), + text: + 'Don\'t go outside \n - Eye of the storm passed:\n - New wind will strike\n - Lightening can strike\n - Flying debris can strike', )), ), Padding(