This file contains hidden or 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
package com.shvet.composelogin.di | |
import androidx.datastore.core.DataStore | |
import androidx.datastore.preferences.core.Preferences | |
import androidx.datastore.preferences.core.booleanPreferencesKey | |
import androidx.datastore.preferences.core.edit | |
import androidx.datastore.preferences.core.emptyPreferences | |
import androidx.datastore.preferences.core.stringPreferencesKey | |
import kotlinx.coroutines.flow.Flow | |
import kotlinx.coroutines.flow.catch |
This file contains hidden or 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
package com.shvet.composelogin.login.viewModel | |
import androidx.compose.runtime.getValue | |
import androidx.compose.runtime.mutableStateOf | |
import androidx.compose.runtime.setValue | |
import androidx.lifecycle.ViewModel | |
import androidx.lifecycle.viewModelScope | |
import com.shvet.composelogin.di.Session | |
import com.shvet.composelogin.login.model.LoginState | |
import com.shvet.composelogin.login.repository.LoginRepository |
This file contains hidden or 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
package com.shvet.composelogin.login | |
import androidx.compose.animation.AnimatedVisibility | |
import androidx.compose.foundation.layout.Arrangement | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.foundation.layout.fillMaxWidth | |
import androidx.compose.foundation.layout.padding | |
import androidx.compose.foundation.layout.wrapContentSize |
This file contains hidden or 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
@Module | |
@InstallIn(SingletonComponent::class) | |
class AppModule { | |
@Singleton | |
@Provides | |
fun provideDataStore(@ApplicationContext context: Context): DataStore<Preferences> { | |
return PreferenceDataStoreFactory.create( | |
corruptionHandler = ReplaceFileCorruptionHandler(produceNewData = { emptyPreferences() }), | |
produceFile = { context.preferencesDataStoreFile(Session.DATA) }) |
This file contains hidden or 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
apply plugin: 'maven-publish' | |
afterEvaluate { | |
publishing { | |
publications { | |
maven(MavenPublication) { | |
groupId project.ext.pomGroupID | |
artifactId project.name | |
version project.ext.pomVersion |
This file contains hidden or 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
//Flutter Modal Bottom Sheet | |
//Modified by Shvet for null safety & tested. Also added Round corners on top. | |
//Based on https://gist.github.com/GiorgioBertolotti/5fc8fcca67aeda3ed9bbc74c856d06f1 | |
import 'dart:async'; | |
import 'package:flutter/material.dart'; |