diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index cbb7a21e..2ea4e692 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -4,7 +4,7 @@ In most cases you can leave this as-is, but you if you want to provide additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> - + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml index 0d33e07d..7b28b73d 100644 --- a/android/app/src/profile/AndroidManifest.xml +++ b/android/app/src/profile/AndroidManifest.xml @@ -4,4 +4,6 @@ to allow setting breakpoints, to provide hot reload, etc. --> + + diff --git a/ios/Podfile.lock b/ios/Podfile.lock index c88752e6..157c054c 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -17,6 +17,8 @@ PODS: - device_info_plus (0.0.1): - Flutter - Flutter (1.0.0) + - flutter_local_notifications (0.0.1): + - Flutter - flutter_sound (9.2.2): - Flutter - flutter_sound_core (= 9.2.2) @@ -54,6 +56,8 @@ PODS: - MTBBarcodeScanner - share (0.0.1): - Flutter + - shared_preferences_ios (0.0.1): + - Flutter - sms_autofill (0.0.1): - Flutter - sqflite (0.0.2): @@ -72,6 +76,7 @@ DEPENDENCIES: - audio_session (from `.symlinks/plugins/audio_session/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - Flutter (from `Flutter`) + - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) - flutter_sound (from `.symlinks/plugins/flutter_sound/ios`) - fluwx (from `.symlinks/plugins/fluwx/ios`) - image_picker (from `.symlinks/plugins/image_picker/ios`) @@ -84,6 +89,7 @@ DEPENDENCIES: - permission_handler (from `.symlinks/plugins/permission_handler/ios`) - qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`) - share (from `.symlinks/plugins/share/ios`) + - shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`) - sms_autofill (from `.symlinks/plugins/sms_autofill/ios`) - sqflite (from `.symlinks/plugins/sqflite/ios`) - tobias (from `.symlinks/plugins/tobias/ios`) @@ -114,6 +120,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/device_info_plus/ios" Flutter: :path: Flutter + flutter_local_notifications: + :path: ".symlinks/plugins/flutter_local_notifications/ios" flutter_sound: :path: ".symlinks/plugins/flutter_sound/ios" fluwx: @@ -138,6 +146,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/qr_code_scanner/ios" share: :path: ".symlinks/plugins/share/ios" + shared_preferences_ios: + :path: ".symlinks/plugins/shared_preferences_ios/ios" sms_autofill: :path: ".symlinks/plugins/sms_autofill/ios" sqflite: @@ -157,6 +167,7 @@ SPEC CHECKSUMS: audio_session: 4f3e461722055d21515cf3261b64c973c062f345 device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a + flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743 flutter_sound: b4eccdf53c922ad12146ac94fb2a18ceb5855c12 flutter_sound_core: 0e902ec587e9854b4f852f4bad2d625057d9958b fluwx: 02670633ce7509206f62b366e9734e7dda81e100 @@ -174,6 +185,7 @@ SPEC CHECKSUMS: permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e share: 0b2c3e82132f5888bccca3351c504d0003b3b410 + shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad sms_autofill: c461043483362c3f1709ee76eaae6eb570b31686 sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 tobias: 2aded9b83e3663b907360a800d8e3c13284f25c5 diff --git a/lib/pages/setting_page/about_page/about_page.dart b/lib/pages/setting_page/about_page/about_page.dart index 21bc6c16..25de5832 100644 --- a/lib/pages/setting_page/about_page/about_page.dart +++ b/lib/pages/setting_page/about_page/about_page.dart @@ -28,7 +28,7 @@ class AboutPage extends StatelessWidget { ), SizedBox(height: 100.w), Text( - '“小蜜蜂智慧小区”APP——幸福生活,简单到达', + '“小蜜蜂智慧生活”APP——幸福生活,简单到达', style: _style, ), ], diff --git a/lib/pages/setting_page/agreement_page/agreement_page.dart b/lib/pages/setting_page/agreement_page/agreement_page.dart index 6ca5bb40..4d658901 100644 --- a/lib/pages/setting_page/agreement_page/agreement_page.dart +++ b/lib/pages/setting_page/agreement_page/agreement_page.dart @@ -17,14 +17,14 @@ class _AgreementPageState extends State { padding: EdgeInsets.all(16.w), child: Text( ''' -欢迎您使用“小蜜蜂”APP软件及服务! 为使用“小蜜蜂”APP软件(以下简称“许可软件”)及服务,您应当阅读并遵守《用户协议及隐私政策》(以下简称“本协议”)。请您务必审慎阅读、充分理解各条款内容,特别是免除或者限制责任的条款,以及开通或使用某项服务的单独协议,并选择接受或不接受。限制、免责条款可能以加粗形式提示您注意。 一旦您下载安装使用许可软件,即表示您同意接受本协议所有条款和条件的约束。如您不同意本协议条款和条件,请勿使用许可软件,并请销毁所有许可软件副本。 请您注意,本协议不适用于您通过我们的产品/服务而接入的其他第三方产品/服务(“其他第三方”,包括您的交易相对方、任何第三方网站以及第三方服务提供者等),具体规定请参照该第三方用户协议及隐私政策或类似声明。 +欢迎您使用“小蜜蜂智慧生活”APP软件及服务! 为使用“小蜜蜂智慧生活”APP软件(以下简称“许可软件”)及服务,您应当阅读并遵守《用户协议及隐私政策》(以下简称“本协议”)。请您务必审慎阅读、充分理解各条款内容,特别是免除或者限制责任的条款,以及开通或使用某项服务的单独协议,并选择接受或不接受。限制、免责条款可能以加粗形式提示您注意。 一旦您下载安装使用许可软件,即表示您同意接受本协议所有条款和条件的约束。如您不同意本协议条款和条件,请勿使用许可软件,并请销毁所有许可软件副本。 请您注意,本协议不适用于您通过我们的产品/服务而接入的其他第三方产品/服务(“其他第三方”,包括您的交易相对方、任何第三方网站以及第三方服务提供者等),具体规定请参照该第三方用户协议及隐私政策或类似声明。 第一部分 用户协议 一、协议的范围 1.1协议适用主体范围 本协议是您与深圳市凯达来科技有限公司(以下称凯达来)之间关于您下载、安装、使用、登录许可软件,以及使用许可软件提供的服务所订立的协议。 二、关于本服务 2.1本服务内容 -本服务内容是指凯达来向用户提供的跨平台的生活助手(“小蜜蜂”APP软件),同时提供由物业提供的基础服务、增值物业服务,周边商圈优惠信息,在线支付,政府提供的公共资源等服务内容。 +本服务内容是指凯达来向用户提供的跨平台的生活助手(“小蜜蜂智慧生活”APP软件),同时提供由物业提供的基础服务、增值物业服务,周边商圈优惠信息,在线支付,政府提供的公共资源等服务内容。 2.2本服务形式 2.2.1 您使用本服务需要下载小蜜蜂软件,对于这些软件,凯达来给予您一项个人的、不可转让及非排他性的许可。 2.2.2 本服务中小蜜蜂软件提供包括但不限于iOS、android等多个应用版本,用户必须选择与所安装手机相匹配的软件版本。 diff --git a/lib/pages/setting_page/agreement_page/privacy_page.dart b/lib/pages/setting_page/agreement_page/privacy_page.dart index d125e5ef..5d343300 100644 --- a/lib/pages/setting_page/agreement_page/privacy_page.dart +++ b/lib/pages/setting_page/agreement_page/privacy_page.dart @@ -19,7 +19,7 @@ class _PrivacyPageState extends State { padding: EdgeInsets.all(16.sp), child: Text( ''' -【前言】欢迎使用“小蜜蜂”(包括小蜜蜂网站、App、小程序及其他移动应用程序,以下统称“小蜜蜂”)提供的产品和服务。深圳市凯达来科技有限公司(注册地址:深圳市龙岗区横岗街道沙荷路40-11号)及其关联公司作为小蜜蜂运营者(或简称“我们”)深知个人信息对使用我们的产品和服务(以下统称“小蜜蜂服务”)之用户(以下统称“用户”或“您”)的重要性,我们一向庄严承诺保护您的个人信息及隐私安全。您在使用小蜜蜂服务时,我们可能会收集和使用您的相关个人信息。我们希望通过《小蜜蜂隐私政策》(以下简称“本政策”)向您说明我们在收集和使用您相关个人信息时对应的处理规则,以及我们为您提供的访问、更正、删除和保护这些个人信息的方式,以便更好的保障您的权益。 +【前言】欢迎使用“小蜜蜂智慧生活”(包括小蜜蜂网站、App、小程序及其他移动应用程序,以下统称“小蜜蜂”)提供的产品和服务。深圳市凯达来科技有限公司(注册地址:深圳市龙岗区横岗街道沙荷路40-11号)及其关联公司作为小蜜蜂运营者(或简称“我们”)深知个人信息对使用我们的产品和服务(以下统称“小蜜蜂服务”)之用户(以下统称“用户”或“您”)的重要性,我们一向庄严承诺保护您的个人信息及隐私安全。您在使用小蜜蜂服务时,我们可能会收集和使用您的相关个人信息。我们希望通过《小蜜蜂隐私政策》(以下简称“本政策”)向您说明我们在收集和使用您相关个人信息时对应的处理规则,以及我们为您提供的访问、更正、删除和保护这些个人信息的方式,以便更好的保障您的权益。 本政策适用于小蜜蜂提供的所有产品和服务,如与《小蜜蜂用户服务协议》条款之约定存在冲突的,以本政策为准。 需要特别说明的是,本政策不适用于其他第三方向您提供的服务,第三方向您提供的服务适用其向您另行说明的隐私政策。   diff --git a/lib/pages/setting_page/settings_page.dart b/lib/pages/setting_page/settings_page.dart index 935bcd91..beb60a33 100644 --- a/lib/pages/setting_page/settings_page.dart +++ b/lib/pages/setting_page/settings_page.dart @@ -147,11 +147,11 @@ class _SettingsPageState extends State { // onTap: () => Get.to(() => AccountManagerPage()), // ), _buildTile( - title: '小蜜蜂用户协议', + title: '小蜜蜂智慧生活用户协议', onTap: () => Get.to(() => AgreementPage()), ), _buildTile( - title: '小蜜蜂隐私政策', + title: '小蜜蜂智慧生活隐私政策', onTap: () => Get.to(() => PrivacyPage()), ), ].sepWidget( diff --git a/lib/pages/splash/app_verify_dialog.dart b/lib/pages/splash/app_verify_dialog.dart index 0d642a19..08b2ffea 100644 --- a/lib/pages/splash/app_verify_dialog.dart +++ b/lib/pages/splash/app_verify_dialog.dart @@ -46,7 +46,7 @@ class AppVerifyDialog extends StatelessWidget { children: [ 52.hb, Text( - '欢迎使用小蜜蜂', + '欢迎使用小蜜蜂智慧生活', style: TextStyle( color: Colors.black.withOpacity(0.85), fontSize: 28.sp, @@ -55,7 +55,7 @@ class AppVerifyDialog extends StatelessWidget { 45.hb, Text( ''' -在您使用小蜜蜂前,请认真阅读并同意小蜜蜂使用条款和隐私政策,授权位置、设备信息、储存信息等权限,包括: +在您使用小蜜蜂智慧生活前,请认真阅读并同意小蜜蜂智慧生活使用条款和隐私政策,授权位置、设备信息、储存信息等权限,包括: 【地理位置权限】:根据您所处的地理位置提供个性化的内容信息; 【相册访问权限】:在报事报修、社区等功能中需要访问相册上传图片信息; 【其他权限】:使用过程中可能需要调用相机、麦克风、系统通知、及安装的应用列表等权限。 @@ -88,7 +88,7 @@ class AppVerifyDialog extends StatelessWidget { fontSize: 24.sp), ), TextSpan( - text: '《小蜜蜂隐私保护政策》', + text: '《小蜜蜂智慧生活隐私保护政策》', style: TextStyle( color: kPrimaryColor, fontSize: 24.sp), recognizer: TapGestureRecognizer() diff --git a/lib/pages/splash/splash_page.dart b/lib/pages/splash/splash_page.dart index 9aaa4602..28a7dbe8 100644 --- a/lib/pages/splash/splash_page.dart +++ b/lib/pages/splash/splash_page.dart @@ -250,7 +250,7 @@ class _SplashPageState extends State { fit: BoxFit.fill, ), Text( - '小蜜蜂', + '小蜜蜂智慧生活', style: TextStyle( color: Color(0xD9000000), fontSize: 32.sp, diff --git a/lib/pages/tab_navigator.dart b/lib/pages/tab_navigator.dart index 8ff67e5a..85d43270 100644 --- a/lib/pages/tab_navigator.dart +++ b/lib/pages/tab_navigator.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; @@ -41,10 +42,18 @@ class _TabNavigatorState extends State List _pages = []; EasyRefreshController _refreshController = EasyRefreshController(); + late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; @override void initState() { super.initState(); + flutterLocalNotificationsPlugin = new FlutterLocalNotificationsPlugin(); + var android = new AndroidInitializationSettings('@mipmap/ic_launcher'); + var iOS = new IOSInitializationSettings(); + var initSettings = new InitializationSettings(android: android,iOS: iOS); + flutterLocalNotificationsPlugin.initialize(initSettings); + //showNotification(); + final appProvider = Provider.of(Get.context!); Future.delayed(Duration(milliseconds: 0), () async { await appProvider.getMyAddress(); //设置默认地址 @@ -219,8 +228,32 @@ class _TabNavigatorState extends State ), ), ) - ) + ); + } + + Future onSelectNotification(String payload) async { + if (payload != null) { + debugPrint('notification payload: ' + payload); + } +//payload 可作为通知的一个标记,区分点击的通知。 + debugPrint('payload:$payload'); + if(payload == "complete") { + await showDialog(context: context, builder: (_) => AlertDialog( + title: Text('Notification'), + content: Text('$payload'), + ),); + } + } - ; + showNotification() async { + var android = new AndroidNotificationDetails( + 'channel id', 'channel NAME', + priority: Priority.high, + importance: Importance.max,); + var iOS = new IOSNotificationDetails(); + var platform = new NotificationDetails(android: android, iOS: iOS); + await flutterLocalNotificationsPlugin.show( + 0, 'New Video is out', 'Flutter Local Notification', platform, + payload: 'Nitish Kumar Singh is part time Youtuber'); } } diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 6d75cc5e..077b89ee 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -7,6 +7,7 @@ import Foundation import audio_session import device_info_plus_macos +import flutter_local_notifications import just_audio import package_info import package_info_plus_macos @@ -18,6 +19,7 @@ import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) + FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin")) FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin")) FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) diff --git a/pubspec.lock b/pubspec.lock index 1dbc6db8..7e04eb83 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -304,6 +304,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + dbus: + dependency: transitive + description: + name: dbus + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.3" decimal: dependency: transitive description: @@ -493,6 +500,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.1" + flutter_local_notifications: + dependency: "direct main" + description: + name: flutter_local_notifications + url: "https://pub.dartlang.org" + source: hosted + version: "9.5.3+1" + flutter_local_notifications_linux: + dependency: transitive + description: + name: flutter_local_notifications_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.2" + flutter_local_notifications_platform_interface: + dependency: transitive + description: + name: flutter_local_notifications_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.0" flutter_localizations: dependency: "direct main" description: flutter @@ -1322,6 +1350,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + timezone: + dependency: transitive + description: + name: timezone + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.0" timing: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index e9ffef59..50eca530 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -127,7 +127,10 @@ dependencies: like_button: ^2.0.4 #图片扩展 extended_image: ^6.1.0 + #本地缓存 sp_util: ^2.0.0 + #系统通知栏消息 + flutter_local_notifications: ^9.5.3+1 dev_dependencies: flutter_test: