Skip to content

Instantly share code, notes, and snippets.

@rajajawahar
Last active May 8, 2018 09:45
Show Gist options
  • Save rajajawahar/6991153d9e9dae775024202834b1447d to your computer and use it in GitHub Desktop.
Save rajajawahar/6991153d9e9dae775024202834b1447d to your computer and use it in GitHub Desktop.
void _submit() {
if (this.formKey.currentState.validate()) {
formKey.currentState.save();
}
var employee = Employee(firstname,lastname,mobileno,emailId);
var dbHelper = DBHelper();
dbHelper.saveEmployee(employee);
_showSnackBar("Data saved successfully");
}
void _showSnackBar(String text) {
scaffoldKey.currentState
.showSnackBar(new SnackBar(content: new Text(text)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment