sentry + schedule microfix
This commit is contained in:
@@ -11,8 +11,8 @@ import 'package:reverse_nn/configuration.dart';
|
||||
import 'package:reverse_nn/application/services/remote_config/parameters.dart';
|
||||
|
||||
class ReverseNNRuStoreRemoteConfig {
|
||||
void create() {
|
||||
FlutterRustoreRemoteconfig.create(
|
||||
Future<void> create() async {
|
||||
return await FlutterRustoreRemoteconfig.create(
|
||||
Configuration.ruStoreRemoteConfigAppID,
|
||||
PluginUpdateBehavior.defaultBehavior,
|
||||
15,
|
||||
|
||||
@@ -43,6 +43,9 @@ class ScheduleService {
|
||||
final dateEnd = datetime.copyWith(hour: 23, minute: 59, second: 59, microsecond: 999, millisecond: 999);
|
||||
final datetimeStartWithOffset = dateStart.copyWith().add(dayOffset);
|
||||
|
||||
final usedDatetimeStartWithOffset = datetime.isAfter(datetimeStartWithOffset)
|
||||
? datetimeStartWithOffset
|
||||
: datetimeStartWithOffset.copyWith().subtract(const Duration(days: 1));
|
||||
final DateTime usedScheduleDatetime = datetime.isAfter(datetimeStartWithOffset)
|
||||
? datetime
|
||||
: datetime.copyWith().subtract(const Duration(days: 1));
|
||||
@@ -65,8 +68,8 @@ class ScheduleService {
|
||||
int durationOffset = 0;
|
||||
for (var i = 0; i < schedule.length; i++) {
|
||||
final ScheduleItem scheduleItem = schedule[i];
|
||||
DateTime start = datetimeStartWithOffset.copyWith().add(Duration(minutes: durationOffset));
|
||||
DateTime end = datetimeStartWithOffset.copyWith().add(Duration(minutes: durationOffset + scheduleItem.duration));
|
||||
DateTime start = usedDatetimeStartWithOffset.copyWith().add(Duration(minutes: durationOffset));
|
||||
DateTime end = usedDatetimeStartWithOffset.copyWith().add(Duration(minutes: durationOffset + scheduleItem.duration));
|
||||
durationOffset += scheduleItem.duration;
|
||||
|
||||
if(!force) {
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
class Configuration {
|
||||
static const String ruStoreRemoteConfigAppID = '12cbda1f-4601-4f6d-924d-64a210005e96';
|
||||
|
||||
static const String sentryDsn = 'https://360e4280ce9e9d1caaa3e4c1720ac16e@sentry.nngasu.ru/4';
|
||||
static const double sentryTraceSampleRate = 0.25;
|
||||
}
|
||||
@@ -2,11 +2,19 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
import 'package:reverse_nn/application.dart';
|
||||
import 'package:reverse_nn/application/services/remote_config/service.dart';
|
||||
import 'package:reverse_nn/configuration.dart';
|
||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||
|
||||
void main() async {
|
||||
await GetStorage.init();
|
||||
ReverseNNRuStoreRemoteConfig().create();
|
||||
runApp(const ReversNNApplication());
|
||||
await ReverseNNRuStoreRemoteConfig().create();
|
||||
|
||||
await SentryFlutter.init((options) {
|
||||
options.dsn = Configuration.sentryDsn;
|
||||
options.tracesSampleRate = Configuration.sentryTraceSampleRate;
|
||||
},
|
||||
appRunner: () => runApp(const ReversNNApplication()),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:reverse_nn/application/controllers/schedule_controller.dart';
|
||||
@@ -12,7 +14,18 @@ class CurrentStatusComponent extends StatelessWidget {
|
||||
|
||||
return GetBuilder<ScheduleController>(
|
||||
builder: (controller) {
|
||||
if(controller.currentSchedule.value == null) { return Container(); }
|
||||
if(controller.currentSchedule.value == null) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(top: 10),
|
||||
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.secondaryContainer,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text('Что-то пошло не так...', style: Theme.of(context).textTheme.bodyLarge),
|
||||
);
|
||||
}
|
||||
|
||||
return ScheduleItemComponent(item: controller.currentSchedule.value!);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user