Closed RoxDevvv closed 11 months ago
Hi @RoxDevvv,
In the example you've provided above, I can't see how you're using validation.
Check out the docs here to learn how to use the validate
helper 👍
This is working.
import 'package:flutter/material.dart';
import 'package:nylo_framework/nylo_framework.dart';
import '/app/controllers/dashboard_controller.dart';
class DashboardPage extends NyPage<DashboardController> {
static String path = '/dashboard';
@override
init() async {
// To update the state,
// use: refreshPage(setState: () { });
}
validateData() {
// Validate data before proceeding
validate(rules: {
"email": "email"
}, data: {
"email": "eeee" // bad data
}, onSuccess: () {
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Dashboard")
),
body: SafeArea(
child: Container(
child: InkWell(
onTap: () {
validateData();
},
child: Text("Test"),
),
),
),
);
}
}
validation not working when extends NyPage