This file contains hidden or 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 Employee{ | |
| String firstName; | |
| String lastName; | |
| String mobileNo; | |
| String emailId; | |
| Employee(this.firstName, this.lastName,this.mobileNo,this.emailId); | |
| } |
This file contains hidden or 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 _MyHomePageState extends State<MyHomePage> { | |
| String firstname; | |
| String lastname; | |
| String emailId; | |
| String mobileno; | |
| final scaffoldKey = new GlobalKey<ScaffoldState>(); | |
| final formKey = new GlobalKey<FormState>(); | |
| @override | |
| Widget build(BuildContext context) { |
This file contains hidden or 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
| 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"); | |
| } |
This file contains hidden or 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:sqflitedatabase/model/employee.dart'; | |
| import 'dart:async'; | |
| import 'package:sqflitedatabase/database/dbhelper.dart'; | |
| Future<List<Employee>> fetchEmployeesFromDatabase() async { | |
| var dbHelper = DBHelper(); | |
| Future<List<Employee>> employees = dbHelper.getEmployees(); | |
| return employees; | |
| } |
This file contains hidden or 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 UIKit | |
| protocol BasePresenter { | |
| // Protocol does not support generics, so we have added associated type, | |
| // Anything that conforms to BasePresenter | |
| associatedtype View | |
| func attachView(view : View) | |
This file contains hidden or 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
| protocol BaseView { | |
| func showError(message : String) | |
| } |
This file contains hidden or 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
| package com.sample.tryanko | |
| import android.support.v7.app.AppCompatActivity | |
| import android.os.Bundle | |
| import kotlinx.android.synthetic.main.activity_main.alert_dialogue | |
| import kotlinx.android.synthetic.main.activity_main.button | |
| import kotlinx.android.synthetic.main.activity_main.coordinatorLayout | |
| import kotlinx.android.synthetic.main.activity_main.dialogue | |
| import kotlinx.android.synthetic.main.activity_main.longToast | |
| import kotlinx.android.synthetic.main.activity_main.longsnackbar |
This file contains hidden or 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 LoginActivity : AppCompatActivity() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| LoginActivityUI().setContentView(this) | |
| } | |
| } | |
| class LoginActivityUI : AnkoComponent<LoginActivity> { |
This file contains hidden or 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 MainActivity : AppCompatActivity() { | |
| private var toolBar: Toolbar? = null | |
| private var container: ViewGroup? = null | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| coordinatorLayout { | |
| fitsSystemWindows = true | |
| appBarLayout { |
This file contains hidden or 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
| protocol LoginView { | |
| func navigateToHome() | |
| func showLoading() | |
| func hideLoading(); | |
| func showMessage(message: String) | |