add dev tag

hmxc
小赖 4 years ago
parent 9e8129de0b
commit 43487f9ce0

@ -1,4 +1,5 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/utils/dev_util.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -23,6 +24,7 @@ void main() async {
await AmapCore.init(''); await AmapCore.init('');
await AmapLocation.instance.init(iosKey: ''); await AmapLocation.instance.init(iosKey: '');
JPush jpush = new JPush(); JPush jpush = new JPush();
DevUtil.setDev(true);
jpush.addEventHandler( jpush.addEventHandler(
// //
onReceiveNotification: (Map<String, dynamic> message) async { onReceiveNotification: (Map<String, dynamic> message) async {
@ -57,7 +59,6 @@ class MyApp extends StatelessWidget {
ChangeNotifierProvider(create: (context) => FixProvider()), ChangeNotifierProvider(create: (context) => FixProvider()),
ChangeNotifierProvider(create: (context) => GreenManageProvider()), ChangeNotifierProvider(create: (context) => GreenManageProvider()),
ChangeNotifierProvider(create: (context) => InspectionManageProvider()), ChangeNotifierProvider(create: (context) => InspectionManageProvider()),
ChangeNotifierProvider(create: (context) => GreenManageProvider()), ChangeNotifierProvider(create: (context) => GreenManageProvider()),
ChangeNotifierProvider(create: (context) => InspectionManageProvider()), ChangeNotifierProvider(create: (context) => InspectionManageProvider()),
ChangeNotifierProvider(create: (context) => AnouncementProvider()), ChangeNotifierProvider(create: (context) => AnouncementProvider()),

@ -1,6 +1,7 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/utils/dev_util.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Package imports: // Package imports:
@ -40,7 +41,7 @@ class _SplashPageState extends State<SplashPage> {
void initState() { void initState() {
super.initState(); super.initState();
Future.delayed(Duration(milliseconds: 300), () { Future.delayed(Duration(milliseconds: 300), () {
if (mounted) PowerLogger.init(context); if (mounted) PowerLogger.init(context, debug: DevUtil.isDev);
}); });
Future.delayed(Duration(milliseconds: 2000), () async { Future.delayed(Duration(milliseconds: 2000), () async {
await _originOp(); await _originOp();

@ -0,0 +1,7 @@
class DevUtil {
static bool get isDev => _isDev;
static setDev(bool state) => _isDev = state;
static bool _isDev = true;
}
Loading…
Cancel
Save