pull/1/head
张萌 3 years ago
commit 35341904aa

@ -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. -->
<application android:label="小蜜蜂" android:icon="@mipmap/ic_launcher" android:networkSecurityConfig="@xml/network_security_config">
<application android:label="小蜜蜂智慧生活" android:icon="@mipmap/ic_launcher" android:networkSecurityConfig="@xml/network_security_config">
<service android:name="com.amap.api.location.APSService"></service>
<meta-data android:name="com.amap.api.v2.apikey"
android:value="f6361c0537bf2d6ddb898b10618d3726"/>

@ -4,4 +4,6 @@
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
</manifest>

@ -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

@ -36,6 +36,7 @@ import 'package:aku_new_community/ui/profile/car/car_manage_page.dart';
import 'package:aku_new_community/ui/profile/car_parking/car_parking_page.dart';
import 'package:aku_new_community/ui/profile/house/house_owners_page.dart';
///
///Application Object
class AO {

@ -12,6 +12,7 @@ import 'package:flutter_sound_web/flutter_sound_web.dart';
import 'package:image_picker_for_web/image_picker_for_web.dart';
import 'package:just_audio_web/just_audio_web.dart';
import 'package:package_info_plus_web/package_info_plus_web.dart';
import 'package:shared_preferences_web/shared_preferences_web.dart';
import 'package:url_launcher_web/url_launcher_web.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
@ -24,6 +25,7 @@ void registerPlugins(Registrar registrar) {
ImagePickerPlugin.registerWith(registrar);
JustAudioPlugin.registerWith(registrar);
PackageInfoPlugin.registerWith(registrar);
SharedPreferencesPlugin.registerWith(registrar);
UrlLauncherPlugin.registerWith(registrar);
registrar.registerMessageHandler();
}

@ -1,4 +1,5 @@
import 'package:aku_new_community/provider/old_age_provider.dart';
import 'package:aku_new_community/utils/updater_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

@ -419,7 +419,7 @@ class _HomePageState extends State<HomePage>
)),
SliverToBoxAdapter(
child: 48.hb,
)
),
],
),
),

@ -28,7 +28,7 @@ class AboutPage extends StatelessWidget {
),
SizedBox(height: 100.w),
Text(
'“小蜜蜂智慧小区”APP——幸福生活简单到达',
'“小蜜蜂智慧生活”APP——幸福生活简单到达',
style: _style,
),
],

@ -17,14 +17,14 @@ class _AgreementPageState extends State<AgreementPage> {
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 iOSandroid

@ -19,7 +19,7 @@ class _PrivacyPageState extends State<PrivacyPage> {
padding: EdgeInsets.all(16.sp),
child: Text(
'''
使App40-11使使使使访便
使App40-11使使使使访便
 

@ -147,11 +147,11 @@ class _SettingsPageState extends State<SettingsPage> {
// onTap: () => Get.to(() => AccountManagerPage()),
// ),
_buildTile(
title: '小蜜蜂用户协议',
title: '小蜜蜂智慧生活用户协议',
onTap: () => Get.to(() => AgreementPage()),
),
_buildTile(
title: '小蜜蜂隐私政策',
title: '小蜜蜂智慧生活隐私政策',
onTap: () => Get.to(() => PrivacyPage()),
),
].sepWidget(

@ -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()

@ -250,7 +250,7 @@ class _SplashPageState extends State<SplashPage> {
fit: BoxFit.fill,
),
Text(
'小蜜蜂',
'小蜜蜂智慧生活',
style: TextStyle(
color: Color(0xD9000000),
fontSize: 32.sp,

@ -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';
@ -14,6 +15,7 @@ import 'package:aku_new_community/ui/market/market_page.dart';
import 'package:aku_new_community/utils/websocket/web_socket_util.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/others/user_tool.dart';
import '../utils/updater_page.dart';
import 'home/home_page.dart';
import 'opening_code_page/opening_code_page.dart';
import 'personal/personal_page.dart';
@ -40,10 +42,18 @@ class _TabNavigatorState extends State<TabNavigator>
List<Widget> _pages = <Widget>[];
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<AppProvider>(Get.context!);
Future.delayed(Duration(milliseconds: 0), () async {
await appProvider.getMyAddress(); //
@ -181,41 +191,69 @@ class _TabNavigatorState extends State<TabNavigator>
4,
),
];
return BeeScaffold(
body: WillPopScope(
onWillPop: () async {
if (_lastPressed == null ||
DateTime.now().difference(_lastPressed!) > Duration(seconds: 1)) {
//1
_lastPressed = DateTime.now();
BotToast.showText(text: '再点击一次返回退出');
return false;
}
//app
WebSocketUtil().closeWebSocket();
return true;
},
child: TabBarView(
children: _pages,
controller: _tabController,
physics: NeverScrollableScrollPhysics(),
),
),
bottomNavi: ConstrainedBox(
constraints: BoxConstraints(maxWidth: 750.w, maxHeight: 146.w),
child: Container(
margin:
return UpdaterPage(
BeeScaffold(
body: WillPopScope(
onWillPop: () async {
if (_lastPressed == null ||
DateTime.now().difference(_lastPressed!) > Duration(seconds: 1)) {
//1
_lastPressed = DateTime.now();
BotToast.showText(text: '再点击一次返回退出');
return false;
}
//app
WebSocketUtil().closeWebSocket();
return true;
},
child: TabBarView(
children: _pages,
controller: _tabController,
physics: NeverScrollableScrollPhysics(),
),
),
bottomNavi: ConstrainedBox(
constraints: BoxConstraints(maxWidth: 750.w, maxHeight: 146.w),
child: Container(
margin:
EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
decoration: BoxDecoration(
image: DecorationImage(
image: Assets.home.imgTabdi, fit: BoxFit.fitWidth),
color: Colors.transparent),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: _bottomNav.cast<Widget>().toList(),
decoration: BoxDecoration(
image: DecorationImage(
image: Assets.home.imgTabdi, fit: BoxFit.fitWidth),
color: Colors.transparent),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: _bottomNav.cast<Widget>().toList(),
),
),
),
),
),
)
);
}
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');
}
}

@ -28,11 +28,13 @@ import 'package:aku_new_community/widget/bee_scaffold.dart';
class EventDetailPage extends StatefulWidget {
final int dynamicId;
final int? createId;
final VoidCallback? refresh;
EventDetailPage({
Key? key,
required this.dynamicId,
this.createId,
this.refresh,
}) : super(key: key);
@ -533,7 +535,7 @@ class _EventDetailPageState extends State<EventDetailPage> {
fontSize: 28.sp,
),
children: [
if (createId == model.createId)
if (model.createId ==widget.createId)
WidgetSpan(
child: Container(
width: 56.w,

@ -144,7 +144,7 @@ class _ChatCardState extends State<ChatCard> {
),
20.wb,
GestureDetector(
onTap: () => Get.to(EventDetailPage(dynamicId: widget.model.id)),
onTap: () => Get.to(EventDetailPage(dynamicId: widget.model.id,createId: widget.model.createId,)),
child: Material(
color: Colors.transparent,
child: Row(
@ -194,6 +194,7 @@ class _ChatCardState extends State<ChatCard> {
? () async {
await Get.to(() => EventDetailPage(
dynamicId: widget.model.id,
createId: widget.model.createId,
refresh: widget.refresh,
));
widget.refresh();

@ -0,0 +1,3 @@
class Constants {
static final String timeStart = "timeStart";
}

@ -0,0 +1,10 @@
import 'package:sp_util/sp_util.dart';
import 'constants.dart';
class DataUtil {
static saveCurrentTimeMillis(int timeStart) async {
await SpUtil.getInstance();
SpUtil.putInt(Constants.timeStart, timeStart);
}
}

@ -0,0 +1,174 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:package_info/package_info.dart';
import 'package:dio/dio.dart';
import 'package:sp_util/sp_util.dart';
import 'package:url_launcher/url_launcher.dart';
import 'constants.dart';
import 'data_util.dart';
class UpdaterPage extends StatefulWidget {
final Widget child;
const UpdaterPage(this.child);
@override
UpdatePagerState createState() => UpdatePagerState();
}
class UpdatePagerState extends State<UpdaterPage> {
var _serviceVersionCode,
_serviceVersionName,
_serviceVersionPlatform,
_serviceVersionApp;
@override
void initState() {
super.initState();
//APP
var timeEnd = DateTime.now().millisecondsSinceEpoch;
_getNewVersionAPP();
//"Later"
var timeStart = SpUtil.getInt(Constants.timeStart);
if (timeStart == 0) {
//APP"版本更新"
_getNewVersionAPP();
} else if (timeStart != 0 && timeEnd - timeStart! >= 24 * 60 * 60 * 1000) {
//
_getNewVersionAPP();
}
}
//
_getNewVersionAPP() async {
String url = "/appversions/latest"; //URLURL
try {
Response response = await Dio().get(url);
setState(() {
var data = response.data;
_serviceVersionCode = data["versionCode"].toString(); //
_serviceVersionName = data["versionName"].toString(); //
_serviceVersionPlatform = data["versionPlatform"].toString(); //
_serviceVersionApp = data["versionApp"].toString(); //URL
_checkVersionCode();
});
} catch (e) {
print(e);
}
_checkVersionCode();
}
//
_checkVersionCode() async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
String _currentVersionCode = packageInfo.version;
print('版本——————————————————————'+ '${_currentVersionCode}');
int serviceVersionCode = int.parse(_serviceVersionCode);
print(serviceVersionCode);
int currentVersionCode = int.parse(_currentVersionCode);
print(currentVersionCode);
if (serviceVersionCode > currentVersionCode) {
_showNewVersionAppDialog(); //
}
}
//"版本更新"
Future<void> _showNewVersionAppDialog() async {
print('弹出框');
if (_serviceVersionPlatform == "android") {
return showDialog<void>(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return AlertDialog(
title: Row(
children: <Widget>[
Image.asset("images/ic_launcher_icon.png",
height: 35.0, width: 35.0),
Padding(
padding: EdgeInsets.fromLTRB(30.0, 0.0, 10.0, 0.0),
child: Text('项目名称',
style: TextStyle(
color: Color(0xFF384F6F), fontSize: 20.0),),)
],
),
content: Text('提示的内容',
style: TextStyle(
color: Color(0xFF384F6F), fontSize: 18.0),),
actions: [
OutlinedButton(
child: new Text('稍后再说',
style: TextStyle(
color: Color(0xFF384F6F), fontSize: 20.0),),
onPressed: () {
Navigator.of(context).pop();
var timeStart = DateTime.now().millisecondsSinceEpoch;
DataUtil.saveCurrentTimeMillis(timeStart); //
},
),
OutlinedButton(
child: new Text('下载',
style: TextStyle(
color: Color(0xFF384F6F), fontSize: 20.0)),
onPressed: () {
//https://play.google.com/store/apps/details?id=
launch(_serviceVersionApp); //Google Play
Navigator.of(context).pop();
},
)
],
);
});
} else {
//iOS
return showDialog<void>(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return CupertinoAlertDialog(
title:Row(
children: <Widget>[
Image.asset("images/ic_launcher_icon.png",
height: 35.0, width: 35.0),
Padding(
padding: EdgeInsets.fromLTRB(30.0, 0.0, 10.0, 0.0),
child: Text('项目名称',
style: TextStyle(
color: Color(0xFF384F6F), fontSize: 20.0),),)
],
),
content: Text('提示的内容',
style: TextStyle(
color: Color(0xFF384F6F), fontSize: 18.0),),
actions: [
OutlinedButton(
child: new Text('稍后再说',
style: TextStyle(
color: Color(0xFF384F6F), fontSize: 20.0),),
onPressed: () {
Navigator.of(context).pop();
var timeStart = DateTime.now().millisecondsSinceEpoch;
DataUtil.saveCurrentTimeMillis(timeStart); //
},
),
OutlinedButton(
child: new Text('下载',
style: TextStyle(
color: Color(0xFF384F6F), fontSize: 20.0)),
onPressed: () {
//https://play.google.com/store/apps/details?id=
launch(_serviceVersionApp); //Google Play
Navigator.of(context).pop();
},
),
],
);
});
}
}
@override
Widget build(BuildContext context) => widget.child;
}

@ -7,20 +7,24 @@ 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
import path_provider_macos
import shared_preferences_macos
import sqflite
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"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
}

@ -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
@ -1128,6 +1156,62 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
shared_preferences:
dependency: transitive
description:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.15"
shared_preferences_android:
dependency: transitive
description:
name: shared_preferences_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.12"
shared_preferences_ios:
dependency: transitive
description:
name: shared_preferences_ios
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
shared_preferences_macos:
dependency: transitive
description:
name: shared_preferences_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
shelf:
dependency: transitive
description:
@ -1189,6 +1273,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.2"
sp_util:
dependency: "direct main"
description:
name: sp_util
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
sqflite:
dependency: transitive
description:
@ -1259,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:

@ -127,6 +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:

Loading…
Cancel
Save