| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878 |
- import 'dart:convert';
- import 'dart:io';
- import 'dart:typed_data';
- import 'package:flutter/material.dart';
- import 'package:fluttertoast/fluttertoast.dart';
- import 'package:google_fonts/google_fonts.dart';
- import 'package:path_provider/path_provider.dart';
- import '../../src/pages/pdf_viewer.dart';
- import '../models/info_calculadora.dart';
- import '../providers/archivos_provider.dart';
- class ResultadoPage extends StatefulWidget {
- final List<String> frecuencias;
- final Map<String, double> arrLwFinal;
- final double sumaLogaritmicaLwFinal;
- final Map<String, double> arrLwA;
- final double sumaLogaritmicaLwA;
- final double presionSonora;
- final Map<String, double> arrSumaLog;
- final double sumaLogaritmicaLwFinalVa;
- final Map<String, double> arrEspectroResultante;
- final double sumaLogaritmicaLwAVa;
- final double presionSonoraVa;
- final Atenuacion arrAtenuador;
- final Map<String, String> arrDatosEntrada;
- final Map<String, String> arrConversiones;
- const ResultadoPage({
- Key? key,
- required this.frecuencias,
- required this.arrLwFinal,
- required this.sumaLogaritmicaLwFinal,
- required this.arrLwA,
- required this.sumaLogaritmicaLwA,
- required this.presionSonora,
- required this.arrSumaLog,
- required this.sumaLogaritmicaLwFinalVa,
- required this.arrEspectroResultante,
- required this.sumaLogaritmicaLwAVa,
- required this.presionSonoraVa,
- required this.arrAtenuador,
- required this.arrDatosEntrada,
- required this.arrConversiones,
- }) : super(key: key);
- @override
- State<ResultadoPage> createState() => _ResultadoPageState();
- }
- class _ResultadoPageState extends State<ResultadoPage> {
- final _archivosProvider = ArchivosProvider();
- int _decimales = 2;
- bool _firstState = true;
- late Row _headerFrecuenciasF;
- late Row _valuesFrecuenciasF;
- late Row _headerFrecuenciasS;
- late Row _valuesFrecuenciasS;
- late Row _valuesFrecuenciasT;
- late Row _valuesFrecuenciasC;
- late Row _datosAtenuadorSelec;
- String _jsonInfo = '';
- void _initTable(List<String> frecuencias, Map<String, double> arrLwFinal, double sumaLogaritmicaLwFinal,
- Map<String, double> arrLwA, double sumaLogaritmicaLwA, Map<String, double> arrSumaLog,
- double sumaLogaritmicaLwAtenuado, Map<String, double> arrEspectroResultante, double sumaLogaritmicaLwAVa,
- Atenuacion arrAtenuador){
- setState(() {
- _firstState = false;
- List<Widget> headerFrecuenciasF = [];
- List<Widget> valuesFrecuenciasF = [];
- List<Widget> headerFrecuenciasS = [];
- List<Widget> valuesFrecuenciasS = [];
- List<Widget> valuesFrecuenciasT = [];
- List<Widget> valuesFrecuenciasC = [];
- List<Widget> datosAtenuadorSelec = [];
- for(int i = 0; i < frecuencias.length; i++){
- headerFrecuenciasF.add(Container(
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: i == 0 ? 2.0 : 1.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- bottom: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- )
- )
- ),
- child: Text(
- frecuencias[i],
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF333333),
- fontWeight: FontWeight.bold,
- fontSize: 24.0
- ),
- ),
- padding: EdgeInsets.all(16.0),
- width: 150.0,
- ));
- valuesFrecuenciasF.add(Container(
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: i == 0 ? 2.0 : 1.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- top: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- )
- )
- ),
- child: Text(
- arrLwFinal[frecuencias[i]]!.toStringAsFixed(_decimales),
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF666666),
- fontSize: 20.0
- ),
- ),
- padding: EdgeInsets.all(16.0),
- width: 150.0,
- ));
- headerFrecuenciasS.add(Container(
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: i == 0 ? 2.0 : 1.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- bottom: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- )
- )
- ),
- child: Text(
- frecuencias[i],
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF333333),
- fontWeight: FontWeight.bold,
- fontSize: 24.0
- ),
- ),
- padding: EdgeInsets.all(16.0),
- width: 150.0,
- ));
- valuesFrecuenciasS.add(Container(
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: i == 0 ? 2.0 : 1.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- top: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- )
- )
- ),
- child: Text(
- arrLwA[frecuencias[i]]!.toStringAsFixed(_decimales),
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF666666),
- fontSize: 20.0
- ),
- ),
- padding: EdgeInsets.all(16.0),
- width: 150.0,
- ));
- valuesFrecuenciasT.add(Container(
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: i == 0 ? 2.0 : 1.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- top: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- )
- )
- ),
- child: Text(
- arrSumaLog[frecuencias[i]]!.toStringAsFixed(_decimales),
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF666666),
- fontSize: 20.0
- ),
- ),
- padding: EdgeInsets.all(16.0),
- width: 150.0,
- ));
- valuesFrecuenciasC.add(Container(
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: i == 0 ? 2.0 : 1.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- top: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- )
- )
- ),
- child: Text(
- arrEspectroResultante[frecuencias[i]]!.toStringAsFixed(_decimales),
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF666666),
- fontSize: 20.0
- ),
- ),
- padding: EdgeInsets.all(16.0),
- width: 150.0,
- ));
- }
- headerFrecuenciasF.add(Container(
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- ),
- bottom: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- )
- )
- ),
- child: Text(
- 'Lw (dB)',
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF333333),
- fontWeight: FontWeight.bold,
- fontSize: 24.0
- ),
- ),
- padding: EdgeInsets.all(16.0),
- width: 150.0,
- ));
- valuesFrecuenciasF.add(Container(
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- ),
- top: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- )
- )
- ),
- child: Text(
- sumaLogaritmicaLwFinal.toStringAsFixed(_decimales),
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF666666),
- fontSize: 20.0
- ),
- ),
- padding: EdgeInsets.all(16.0),
- width: 150.0,
- ));
- headerFrecuenciasS.add(Container(
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- ),
- bottom: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- )
- )
- ),
- child: Text(
- 'Lw (dBA)',
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF333333),
- fontWeight: FontWeight.bold,
- fontSize: 24.0
- ),
- ),
- padding: EdgeInsets.all(16.0),
- width: 150.0,
- ));
- valuesFrecuenciasS.add(Container(
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- ),
- top: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- )
- )
- ),
- child: Text(
- sumaLogaritmicaLwA.toStringAsFixed(_decimales),
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF666666),
- fontSize: 20.0
- ),
- ),
- padding: EdgeInsets.all(16.0),
- width: 150.0,
- ));
- valuesFrecuenciasT.add(Container(
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- ),
- top: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- )
- )
- ),
- child: Text(
- sumaLogaritmicaLwAtenuado.toStringAsFixed(_decimales),
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF666666),
- fontSize: 20.0
- ),
- ),
- padding: EdgeInsets.all(16.0),
- width: 150.0,
- ));
- valuesFrecuenciasC.add(Container(
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- ),
- top: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- )
- )
- ),
- child: Text(
- sumaLogaritmicaLwAVa.toStringAsFixed(_decimales),
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF666666),
- fontSize: 20.0
- ),
- ),
- padding: EdgeInsets.all(16.0),
- width: 150.0,
- ));
- datosAtenuadorSelec.add(Container(
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- bottom: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- )
- )
- ),
- width: 450.0,
- padding: EdgeInsets.all(16.0),
- child: Text(
- 'Modelo',
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF666666),
- fontSize: 20.0
- ),
- ),
- ));
- datosAtenuadorSelec.add(Container(
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- bottom: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- )
- )
- ),
- width: 300.0,
- padding: EdgeInsets.all(16.0),
- child: Text(
- arrAtenuador.modelo!,
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF666666),
- fontSize: 20.0
- ),
- ),
- ));
- datosAtenuadorSelec.add(Container(
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- bottom: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- )
- )
- ),
- width: 450.0,
- padding: EdgeInsets.all(16.0),
- child: Text(
- 'Longitud del atenuador',
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF666666),
- fontSize: 20.0
- ),
- ),
- ));
- datosAtenuadorSelec.add(Container(
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- ),
- bottom: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- )
- )
- ),
- width: 150.0,
- padding: EdgeInsets.all(16.0),
- child: Text(
- arrAtenuador.longitud!,
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF666666),
- fontSize: 20.0
- ),
- ),
- ));
- _headerFrecuenciasF = Row(
- children: headerFrecuenciasF,
- );
- _valuesFrecuenciasF = Row(
- children: valuesFrecuenciasF,
- );
- _headerFrecuenciasS = Row(
- children: headerFrecuenciasS,
- );
- _valuesFrecuenciasS = Row(
- children: valuesFrecuenciasS,
- );
- _valuesFrecuenciasT = Row(
- children: valuesFrecuenciasT,
- );
- _valuesFrecuenciasC = Row(
- children: valuesFrecuenciasC,
- );
- _datosAtenuadorSelec = Row(
- children: datosAtenuadorSelec,
- );
- });
- }
- void showViewer(File document) {
- Navigator.of(context).push(MaterialPageRoute(
- builder: (context) => PDFViewer(
- localFile: true,
- file: document,
- )
- ));
- }
- @override
- Widget build(BuildContext context) {
- if(_firstState){
- _initTable(widget.frecuencias, widget.arrLwFinal, widget.sumaLogaritmicaLwFinal,
- widget.arrLwA, widget.sumaLogaritmicaLwA, widget.arrSumaLog, widget.sumaLogaritmicaLwFinalVa,
- widget.arrEspectroResultante, widget.sumaLogaritmicaLwAVa, widget.arrAtenuador);
- _jsonInfo += '{"arrDatosDeEntrada":' + jsonEncode(widget.arrDatosEntrada) + ',';
- _jsonInfo += '"arrConversiones":' + jsonEncode(widget.arrConversiones) + ',';
- _jsonInfo += '"frecuencias":' + jsonEncode(widget.frecuencias) + ',';
- _jsonInfo += '"arrLwFinal":' + jsonEncode(widget.arrLwFinal) + ',';
- _jsonInfo += '"sumaLogaritmicaLwFinal":' + widget.sumaLogaritmicaLwFinal.toString() + ',';
- _jsonInfo += '"arrLwA":' + jsonEncode(widget.arrLwA) + ',';
- _jsonInfo += '"sumaLogaritmicaLwA":' + widget.sumaLogaritmicaLwA.toString() + ',';
- _jsonInfo += '"presionSonora":' + widget.presionSonora.toString() + ',';
- _jsonInfo += '"arrSumaLog":' + jsonEncode(widget.arrSumaLog) + ',';
- _jsonInfo += '"sumaLogaritmicaLwFinalVa":' + widget.sumaLogaritmicaLwFinalVa.toString() + ',';
- _jsonInfo += '"arrEspectroResultante":' + jsonEncode(widget.arrEspectroResultante) + ',';
- _jsonInfo += '"sumaLogaritmicaLwAVa":' + widget.sumaLogaritmicaLwAVa.toString() + ',';
- _jsonInfo += '"presionSonoraVa":' + widget.presionSonoraVa.toString() + ',';
- _jsonInfo += '"modelo":"' + widget.arrAtenuador.modelo! + '",';
- _jsonInfo += '"longitud":' + widget.arrAtenuador.longitud! + '}';
- _jsonInfo = _jsonInfo.replaceAll('##', '%%');
- _jsonInfo = base64Encode(utf8.encode(_jsonInfo));
- }
- return Scaffold(
- appBar: AppBar(
- actions: [
- IconButton(
- icon: Icon(
- Icons.picture_as_pdf,
- color: Colors.white,
- ),
- onPressed: (){
- Fluttertoast.showToast(
- msg: 'Abriendo PDF...',
- toastLength: Toast.LENGTH_LONG,
- gravity: ToastGravity.CENTER,
- timeInSecForIosWeb: 1
- );
- _archivosProvider.fetchAtenuador(_jsonInfo).then((archivo){
- _createFileFromString(archivo.data!, archivo.name!).then((name){
- print("==DIRECTORIO: ${name.path}===");
- showViewer(name);
- });
- });
- },
- )
- ],
- ),
- body: SafeArea(
- child: SingleChildScrollView(
- child: SingleChildScrollView(
- scrollDirection: Axis.horizontal,
- child: Column(
- children: [
- Container(
- width: 1350.0,
- child: Text(
- 'Espectro de Potencia Sonora Ventilador Lw',
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF333333),
- fontSize: 24.0,
- fontWeight: FontWeight.bold
- ),
- ),
- margin: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 0.0),
- padding: EdgeInsets.all(16.0),
- decoration: BoxDecoration(
- border: Border.all(
- color: Color(0xFFDDDDDD),
- width: 2.0
- )
- ),
- ),
- _headerFrecuenciasF,
- _valuesFrecuenciasF,
- Container(
- width: 1350.0,
- child: Text(
- 'Espectro de Potencia Sonora Ventilador Ponderación A Lw(A)',
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF333333),
- fontSize: 24.0,
- fontWeight: FontWeight.bold
- ),
- ),
- margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
- padding: EdgeInsets.all(16.0),
- decoration: BoxDecoration(
- border: Border.all(
- color: Color(0xFFDDDDDD),
- width: 2.0
- )
- ),
- ),
- _headerFrecuenciasS,
- _valuesFrecuenciasS,
- Row(
- children: [
- Container(
- padding: EdgeInsets.all(16.0),
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- ),
- top: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- )
- )
- ),
- width: 450.0,
- child: Text(
- 'Presión Sonora',
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF333333),
- fontSize: 24.0,
- fontWeight: FontWeight.bold
- ),
- ),
- ),
- Container(
- padding: EdgeInsets.all(16.0),
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- top: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- )
- )
- ),
- width: 900.0,
- child: Text(
- widget.presionSonora.toStringAsFixed(_decimales),
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF333333),
- fontSize: 24.0,
- fontWeight: FontWeight.bold
- ),
- ),
- )
- ],
- ),
- Container(
- width: 1350.0,
- child: Text(
- 'Espectro de Potencia Sonora Ventilador con Atenuador Lw',
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF333333),
- fontSize: 24.0,
- fontWeight: FontWeight.bold
- ),
- ),
- margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
- padding: EdgeInsets.all(16.0),
- decoration: BoxDecoration(
- border: Border.all(
- color: Color(0xFFDDDDDD),
- width: 2.0
- )
- ),
- ),
- _headerFrecuenciasS,
- _valuesFrecuenciasT,
- Container(
- width: 1350.0,
- child: Text(
- 'Espectro de Potencia Sonora Ventilador con Atenuador Lw(A)',
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF333333),
- fontSize: 24.0,
- fontWeight: FontWeight.bold
- ),
- ),
- margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
- padding: EdgeInsets.all(16.0),
- decoration: BoxDecoration(
- border: Border.all(
- color: Color(0xFFDDDDDD),
- width: 2.0
- )
- ),
- ),
- _headerFrecuenciasS,
- _valuesFrecuenciasC,
- Row(
- children: [
- Container(
- padding: EdgeInsets.all(16.0),
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- ),
- top: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- )
- )
- ),
- width: 450.0,
- child: Text(
- 'Presión Sonora',
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF333333),
- fontSize: 24.0,
- fontWeight: FontWeight.bold
- ),
- ),
- ),
- Container(
- padding: EdgeInsets.all(16.0),
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 1.0
- ),
- top: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- ),
- right: BorderSide(
- color: Color(0xFFDDDDDD),
- width: 2.0
- )
- )
- ),
- width: 900.0,
- child: Text(
- widget.presionSonoraVa.toStringAsFixed(_decimales),
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF333333),
- fontSize: 24.0,
- fontWeight: FontWeight.bold
- ),
- ),
- )
- ],
- ),
- Container(
- width: 1350.0,
- child: Text(
- 'Datos del Atenuador Seleccionado',
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- color: Color(0xFF333333),
- fontSize: 24.0,
- fontWeight: FontWeight.bold
- ),
- ),
- margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
- padding: EdgeInsets.all(16.0),
- decoration: BoxDecoration(
- border: Border.all(
- color: Color(0xFFDDDDDD),
- width: 2.0
- )
- ),
- ),
- _datosAtenuadorSelec,
- SizedBox(height: 8.0),
- ],
- ),
- ),
- ),
- ),
- );
- }
- Future<File> _createFileFromString(String encoded, String name) async{
- Uint8List bytes = base64Decode(encoded);
- String dir = (await getApplicationDocumentsDirectory()).path;
- File file = File(
- "$dir/$name"
- );
- await file.writeAsBytes(bytes);
- return file;
- }
- }
|