Skip to content

Instantly share code, notes, and snippets.

View enginebai's full-sized avatar
📈
Focusing, Learning, Improving, Evolving

Engine Bai enginebai

📈
Focusing, Learning, Improving, Evolving
View GitHub Profile
repositories {
jcenter()
}
plugins {
`kotlin-dsl`
}
Label.text(
labelText: 'Default simple text',
),
Label.text(
labelText: 'Larger Text',
textSize: 36,
),
Label.filled(
labelText: 'Filled Text',
backgroundColor: Colors.green,
@override
Widget build(BuildContext context) {
return Container(
height: _labelHeight,
decoration: BoxDecoration(
border: Border.all(
color: this.strokeColor ?? Colors.transparent,
width: strokeWidth),
borderRadius: BorderRadius.circular(_cornerSize),
color: this.backgroundColor ?? Colors.transparent),
import 'package:flutter/material.dart';
const _labelHeight = 24.0;
const _cornerSize = 4.0;
const _textSize = 14.0;
const _strokeWidth = 2.0;
class Label extends StatelessWidget {
Label.text(
{Key? key,
Label.text(
{Key? key,
required this.labelText,
this.textColor = Colors.black,
this.textSize = _textSize})
: assert(labelText.isNotEmpty),
this.backgroundColor = Colors.transparent,
this.strokeColor = Colors.transparent,
this.strokeWidth = 0.0,
super(key: key);
class Question extends StatelessWidget {
final String questionText;
Question(this.questionText); // 1. normal constructor
Question({this.questionText}); // 2. normal constuctor with named argument
Question.text(this.questionText); // 3. named constructor
Question.create({this.questionText}); // 4. named constructor with named argument
}
final String labelText;
final Color? textColor;
final double textSize;
final Color? backgroundColor;
final Color? strokeColor;
final double strokeWidth;
id caption mediaFile type location
57ad8bce0a Hi, this is … /…
interface EpoxyModelClickListener {
fun onPriceChanged(price: Double)
}
class HeaderEpoxyModel : Epoxy {
@EpoxyAttribute
var double price = 0.0
@EpoxyAttribute
var EpoxyModelClickListener clickListener? = null
@enginebai
enginebai / MyController.kt
Created December 14, 2020 23:39
MovieHunt blog part5. controller sample
class MyController : EpoxyController() {
override fun buildModels() {
HeaderImageModel_()
LoadingModel_()
MovieModel_()
MovieModel_()
FooterModel_()
}
}