New API
This file contains 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
[Route("api/TrackingUsuarios/{id}")] | |
public HttpResponseMessage GetById(int id) | |
{ | |
var result = db.TrackingUsuarios.Where(x => x.UsuarioId == id).ToList(); | |
return Request.CreateResponse(HttpStatusCode.OK, result); | |
} | |
[Route("api/TrackingUsuarios/{date}")] | |
public HttpResponseMessage GetByPeriod(DateTime? date) | |
{ |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
@using Microsoft.AspNetCore.Identity | |
@using RBR.AdministraBlu.Web.Models | |
@inject SignInManager<ApplicationUser> SignInManager | |
@inject UserManager<ApplicationUser> UserManager | |
<!DOCTYPE html> | |
<html> | |
<head> |
This file contains 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
@model IEnumerable<RBR.AdministraBlu.Web.Models.PedidoBlu> | |
@{ | |
ViewData["Title"] = "Pedidos - BLU"; | |
} | |
<link rel="stylesheet" href="~/dist/js/datatables.net-bs/css/dataTables.bootstrap.min.css"> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min.js"></script> |
This file contains 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
// To parse this JSON data, do | |
// | |
// final modelo = modeloFromJson(jsonString); | |
import 'dart:convert'; | |
Modelo modeloFromJson(String str) => Modelo.fromJson(json.decode(str)); | |
String modeloToJson(Modelo data) => json.encode(data.toJson()); |
This file contains 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:dio/dio.dart'; | |
import 'package:rbr_pedido_armacoes_flutter/src/models/modelo_model.dart'; | |
import 'package:rbr_pedido_armacoes_flutter/src/providers/db_provider.dart'; | |
class ModeloApiProvider { | |
Future<List<Modelo>> getAll() async { | |
var url = "https://pedidoarmacoesdeletar.azurewebsites.net/api/modelos"; | |
Response response = await Dio().get(url); | |
return (response.data as List).map((modelo) { |
This file contains 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'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Material App', | |
home: Scaffold( |
This file contains 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 'dart:convert'; | |
List<Employee> employeeFromJson(String str) => | |
List<Employee>.from(json.decode(str).map((x) => Employee.fromJson(x))); | |
String employeeToJson(List<Employee> data) => | |
json.encode(List<dynamic>.from(data.map((x) => x.toJson()))); | |
class Employee { | |
int id; |
This file contains 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 'dart:io'; | |
import 'package:api_to_sqlite_flutter/src/models/employee_model.dart'; | |
import 'package:path/path.dart'; | |
import 'package:path_provider/path_provider.dart'; | |
import 'package:sqflite/sqflite.dart'; | |
class DBProvider { | |
static Database _database; | |
static final DBProvider db = DBProvider._(); |
OlderNewer