Skip to content

Instantly share code, notes, and snippets.

View riccardopirani's full-sized avatar

riccardop riccardopirani

View GitHub Profile
@riccardopirani
riccardopirani / log
Created August 7, 2022 13:57
Crash log
ViewPropTypes will be removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'.
at node_modules/react-native/index.js:470:4 in module.exports.get__ViewPropTypes
at node_modules/react-native-router-flux/src/Router.js:135:14 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:339:11 in loadModuleImplementation
at node_modules/react-native-router-flux/src/index.js:2:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:339:11 in loadModuleImplementation
at App.js:5:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:339:11 in loadModuleImplementation
at node_modules/expo/AppEntry.js:3:0 in <global>
{
"success": true,
"data": [
{
"_id": 439264,
"_type": "PreventiveMaint",
"_user": "admin",
"__user_description": "Administrator",
"_beginDate": "2022-05-04T12:39:29.58256Z",
"_tenant": 388180,
@riccardopirani
riccardopirani / file.dart
Created July 13, 2020 06:55
flutter pdf viewer
import 'package:advance_pdf_viewer/advance_pdf_viewer.dart';
//Funzione che si occupa di visualizzare la stampa
Future<void> stampa(String path) async {
final pdf = await rootBundle.load(path);
await Printing.layoutPdf(onLayout: (_) => pdf.buffer.asUint8List());
}
//Funzione che che permette di tornare alla pagina di generazione del rapporto
void apriGenerazioneRapportino(BuildContext context, Rapporto rc) {
@riccardopirani
riccardopirani / pdf.dart
Created July 7, 2020 06:07
Show multiple pdfs in flutter
import 'dart:async';
import 'package:advance_pdf_viewer/advance_pdf_viewer.dart';
import 'package:back_button_interceptor/back_button_interceptor.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:printing/printing.dart';
import 'package:myapp/Model/Rapporto.dart';
import 'package:myapp/Model/Supporto.dart';
import 'package:myapp/Model/Utente.dart';
@riccardopirani
riccardopirani / search.dart
Created June 8, 2020 09:43
SearchDelegate
class DataSouceSelezionaArticolo extends SearchDelegate<String>{
Rapporto rp;
DataSouceSelezionaArticolo(this.rp);
@override
List<Widget> buildActions(BuildContext context) {
return [IconButton(icon: Icon(Icons.clear), onPressed: () {
query="";
@riccardopirani
riccardopirani / RistoranteController.dart
Created March 24, 2020 08:25
Model-View-Controller Flutter
import 'package:MyApp/Model/Cantiere.dart';
import 'package:MyApp/Model/Ristorante.dart';
import 'package:MyApp/Model/Utente.dart';
import 'Api.dart';
import 'dart:convert';
//Classe che rapprresenta il controller del Ristorante
class RistoranteController {
//Costruttore
RistoranteController();
@riccardopirani
riccardopirani / Cantiere.dart
Last active March 3, 2020 11:02
Ui generation with Future Flutter error
import 'dart:async';
import 'package:MyApp/Controller/Cantiere.dart';
import 'package:MyApp/Model/Cliente.dart';
import 'Utente.dart';
//Classe che rappresenta il cantiere
class Cantiere {
//Variabili del cantiere
@riccardopirani
riccardopirani / filename
Last active March 2, 2020 13:31
output of apt-get update
> Hit:1 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial InRelease
Ign:2 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 InRelease
Hit:4 http://ppa.launchpad.net/landscape/17.03/ubuntu xenial InRelease
Hit:5 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release
Get:6 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Hit:7 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Hit:9 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
Get:10 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg [801 B]
Ign:11 http://pkg.jenkins.io/debian-stable binar
@riccardopirani
riccardopirani / Error
Last active February 28, 2020 09:02
error during running a code to generate a view flutter
Failed assertion: line 1651 pos 12: '!_debugDoingThisLayout': is not true. flutter: Another exception was thrown: NoSuchMethodError: The getter 'length' was called on null. flutter: Another exception was thrown: Each child must be laid out exactly once. flutter: Another exception was thrown: NoSuchMethodError: The getter 'length' was called on null. flutter: Another exception was thrown: Each child must be laid out exactly once. [VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: Cannot hit test a render box that has never been laid out. The hitTest() method was called on this RenderBox: RenderStack#8e720 NEEDS-LAYOUT NEEDS-PAINT: creator: Stack ← FutureBuilder ← _BodyBuilder ← MediaQuery ← LayoutId-[<_ScaffoldSlot.body>] ← CustomMultiChildLayout ← AnimatedBuilder ← DefaultTextStyle ← AnimatedDefaultTextStyle ← _InkFeatures-[GlobalKey#19263 ink renderer] ← NotificationListener ← PhysicalModel ← ⋯ parentData: offset=Offset(0.0, 0.0); id=_ScaffoldSlot.body constraints: MISSING size: MISSING alignment: Alignm
@riccardopirani
riccardopirani / Model.cs
Created February 25, 2020 14:39
Sql Timeouit
/*
System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecute