This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:models/src/models/participant_descriptor_model.dart'; | |
import 'package:models/src/models/quiz_session_model.dart'; | |
import 'package:models/src/models/quiz_session_result_item_model.dart'; | |
import 'package:models/src/models/templates/context_variables.dart'; | |
typedef LazyValueGetter = Object? Function(); | |
class TemplatesProcessorService { | |
static const _variableExpression = r'(?<variable>\%\w*\%)'; | |
static final _variableExpressionRegex = RegExp(_variableExpression); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
/// | |
/// https://leetcode.com/problems/maximize-distance-to-closest-person/description/ | |
/// 849. Maximize Distance to Closest Person | |
/// | |
/// You are given an array representing a row of seats where seats[i] = 1 represents a person sitting in the ith seat, and seats[i] = 0 represents that the ith seat is empty (0-indexed). | |
/// There is at least one empty seat, and at least one person sitting. | |
/// Alex wants to sit in the seat such that the distance between him and the closest person to him is maximized. | |
/// Return that maximum distance to the closest person. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: company_office | |
description: TeleQuiz Online Company office implementation | |
publish_to: 'none' | |
version: 1.0.0+1 | |
environment: | |
sdk: '>=2.17.0 <3.0.0' | |
flutter: ">=3.7.0" | |
dependencies: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// see more details here | |
/// https://core.telegram.org/widgets/login#checking-authorization | |
import 'package:crypto/crypto.dart'; //. https://pub.dev/packages/crypto | |
static const String botToken = | |
'XXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; | |
bool checkTelegramRegistrationData({ | |
required final String id, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:collection/collection.dart'; | |
void main() async { | |
final notChunked = Iterable.generate(100); | |
final chunked = notChunked.slices(30); | |
chunked.forEach(print); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
final GlobalKey<NavigatorState> firstPageContextNavigationKey = GlobalKey(); | |
final GlobalKey<NavigatorState> homePageContextNavigationKey = GlobalKey(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:dio/dio.dart'; | |
import 'package:flutter/cupertino.dart'; | |
/// [LoggingInterceptor] is used to print logs during network requests. | |
/// It's better to add [LoggingInterceptor] to the tail of the interceptor queue, | |
/// otherwise the changes made in the interceptor behind A will not be printed out. | |
/// This is because the execution of interceptors is in the order of addition. | |
class LoggingInterceptor extends Interceptor { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'dart:isolate'; | |
import 'dart:math'; | |
import 'dart:typed_data'; | |
void main(List<dynamic> args) async { | |
ReceivePort receivePort = ReceivePort(); | |
stdout.writeln('Создадим новый Isolate и передадим аргумент в entry point'); | |
final isolate = await Isolate.spawn(someSoHeavyAndLongTask, receivePort.sendPort); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:synchronized/synchronized.dart'; | |
/// | |
/// without synchronized logout should be the same: | |
/// emitting 1 | |
/// listening the step 1 | |
/// listening the step 1 | |
/// emitting 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
void main() { | |
SyncService sync = SyncService(); | |
final subscription1 = sync.startUpload() | |
..onDone(() { | |
print('done'); | |
}); | |
final subscription2 = sync.startUpload() |
NewerOlder