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
buildName=$(sed -n -e "/FLUTTER_BUILD_NAME/ s/.*\= *//p" Flutter/Generated.xcconfig); | |
buildNumber=$(sed -n -e "/FLUTTER_BUILD_NUMBER/ s/.*\= *//p" Flutter/Generated.xcconfig); | |
echo "$buildName" | |
echo "$buildNumber" | |
oneSignalPlist="OneSignalNotificationServiceExtension/Info.plist" # any other plist | |
plutil -replace CFBundleShortVersionString -string "$buildName" "$oneSignalPlist" | |
plutil -replace CFBundleVersion -string "$buildNumber" "$oneSignalPlist" | |
runnerPlist="Runner/Info.plist" |
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
/// Помощник с логикой пагинации | |
class PaginationHelper<T> { | |
static const double _defaultPaginationOffset = 50; | |
/// Смещение от конца прокрутки после которого начинать пагинацию | |
double paginationOffset; | |
/// Контроллер прокрутки | |
ScrollController scrollController; |
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
/// Билдер [WidgetModel] для экрана Дэшборда [DashboardScreen] | |
DashboardWidgetModel createDashboardScreenWm(BuildContext context) { | |
final component = Injector.of<DashboardScreenComponent>(context).component; | |
final dependencies = WidgetModelDependencies( | |
errorHandler: StandardErrorHandler( | |
component.messageController, | |
component.dialogController, | |
component.sessionInteractor, | |
component.authInteractor, |
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
///Базовый класс для обработки ошибок, связанных с сервисным слоем | |
abstract class NetworkErrorHandler implements ErrorHandler { | |
@override | |
void handleError(Object error) { | |
Object e; | |
bool isSilent = false; | |
bool isOverlayed = false; | |
if (error is SilentException) { | |
e = error.originalError; |
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
android { | |
productFlavors { // or build types | |
dev { | |
project.ext.setProperty("googleAppId", "your google app id") // for task in google_service_xml_generator.gradle | |
} | |
prod { | |
project.ext.setProperty("googleAppId", "your google app id") // for task in google_service_xml_generator.gradle | |
} | |
} |
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
fun View.setRoundedCornersRes(@DimenRes resId: Int) { | |
setRoundedCorners(resources.getDimension(resId)) | |
} | |
fun View.setRoundedCorners(@Px radius: Int) { | |
setRoundedCorners(radius.toFloat()) | |
} | |
fun View.setRoundedCorners(@Px radius: Float) { | |
clipToOutline = true |
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 com.google.common.truth.Truth.assertThat | |
import kotlinx.coroutines.* | |
import kotlinx.coroutines.flow.Flow | |
import kotlinx.coroutines.flow.toList | |
import java.lang.Long.min | |
fun <T> synchronizedList(vararg elements: T): MutableList<T> = Collections.synchronizedList(mutableListOf(*elements)) | |
class FlowAssert<T>(flow: Flow<T>) { | |
companion object { |
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
class LifecycleProvider { | |
private var disposable: Disposable? = null | |
private var observable: BehaviorSubject<Any>? = null | |
internal fun unsubscribe(): Unit { | |
if (disposable?.isDisposed?.not() ?: false) { | |
observable?.onNext(Any()) | |
disposable?.dispose() | |
} | |
disposable = null |
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
data class Contact(val id: String = "", val name: String = "", val photoUri: String = "", var phoneNumber: String = "", val typeStringRes: Int = 0) |
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
class EncryptionManager(val alias: String, context: Context) { | |
companion object { | |
private const val KEY_STORE_PROVIDER = "AndroidKeyStore" | |
private const val CIPHER_PROVIDER = "AndroidOpenSSL" | |
private const val DISTINGUISHED = "CN=Company,O=Android Authority" | |
private const val TRANSFORMATION = "${KeyProperties.KEY_ALGORITHM_RSA}/${KeyProperties.BLOCK_MODE_ECB}/${KeyProperties.ENCRYPTION_PADDING_RSA_PKCS1}" | |
} | |
private val context: Context |