Skip to content

Instantly share code, notes, and snippets.

View mopilo's full-sized avatar
🏠
Working from home

Mopah Shewuri mopilo

🏠
Working from home
View GitHub Profile
void _business() async {
_locationBloc.add(GetState()); //get states here
List<StateModel> states = [];
List<LGAModel> lgas = [];
showGeneralDialog(
barrierDismissible: false,
barrierColor: Colors.grey,
transitionDuration: Duration(milliseconds: 200),
context: context,
@mopilo
mopilo / Validation
Last active December 14, 2018 10:06
react native form validation
const validate = (val, rules, connectedValue) => {
let isValid = true;
for (let rule in rules) {
switch (rule) {
case "isEmail":
isValid = isValid && emailValidator(val);
break;
case "minLength":
isValid = isValid && minLengthValidator(val, rules[rule]);
break;