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'; | |
import 'package:flutter_renoon/common/mycolors.dart'; | |
import 'package:flutter_renoon/home/model/ProductsResponse.dart'; | |
import 'package:flutter_renoon/renoon_widgets/discount_label_widget.dart'; | |
import 'package:flutter_renoon/renoon_widgets/follow_widget.dart'; | |
import 'package:shimmer/shimmer.dart'; | |
class GridProduct extends StatelessWidget { | |
final Product product; | |
final itemPadding; |
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 SingleLiveEvent<T> : MutableLiveData<T>() { | |
private val mPending = AtomicBoolean(false) | |
@MainThread | |
override fun observe(owner: LifecycleOwner, observer: Observer<in T>) { | |
if (hasActiveObservers()) { | |
Log.w(TAG, "Multiple observers registered but only one will be notified of changes."); | |
} |
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 $CLASS_NAME$Adapter(private var list: MutableList<$DT$>) : | |
RecyclerView.Adapter<$CLASS_NAME$Adapter.$CLASS_NAME$ViewHolder>() { | |
override fun getItemCount() = list.size | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): $CLASS_NAME$ViewHolder { | |
return $CLASS_NAME$ViewHolder( | |
LayoutInflater.from(parent.context).inflate( | |
R.layout.$LAYOUT_NAME$, | |
parent, |
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
binding = DataBindingUtil.inflate(inflater, R.layout.$layout_file$, container, false) | |
val vm by lazy { | |
ViewModelProviders.of(this, $VIEWMODEL_CLASS$Factory(repo)) | |
.get($VIEWMODEL_CLASS$::class.java) | |
} | |
binding.$VIEWMODEL_VARIABLE_NAME_FROM_XML$ = vm | |
binding.lifecycleOwner = this |
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 $viewModelName$Factory(val repo: RepoModel) : ViewModelProvider.Factory { | |
override fun <T : ViewModel?> create(modelClass: Class<T>): T = $viewModelName$(repo) as T | |
} |
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 $CLASS_NAME$VM(private var repo: RepoModel) : ViewModel() { | |
} |
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
//material package to use material widgets | |
import 'package:flutter/material.dart'; | |
//Main method to run app | |
void main() => runApp(new MyApp()); | |
//MyApp class | |
class MyApp extends StatelessWidget { | |
@override |
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
Intent sendIntent = new Intent(); | |
sendIntent.setAction(Intent.ACTION_SEND); | |
sendIntent.putExtra(Intent.EXTRA_TEXT, | |
"Performance app: https://play.google.com/store/apps/details?id=com." | |
+ ".packageid"); | |
sendIntent.setType("text/plain"); | |
startActivity(sendIntent); |
NewerOlder