Flutter

How can I show a pdf in base64 in flutter?

ε祈祈猫儿з 提交于 2021-02-18 17:09:20
问题 I have the content of a pdf in base64 and I need to show it in a container in a flutter application. I'm trying to do it with the image, pdf and convert packages from dart,but I get an error with the image class and I don't know how to show the image. List<int> pdfDataBytes = base64.decode(fileContent); Image img = decodeImage(pdfDataBytes); PdfImage image = PdfImage( pdf, image: img.data.buffer.asUint8List(), width: img.width, height: img.height); This is the message of the error in the

How can I show a pdf in base64 in flutter?

这一生的挚爱 提交于 2021-02-18 17:08:10
问题 I have the content of a pdf in base64 and I need to show it in a container in a flutter application. I'm trying to do it with the image, pdf and convert packages from dart,but I get an error with the image class and I don't know how to show the image. List<int> pdfDataBytes = base64.decode(fileContent); Image img = decodeImage(pdfDataBytes); PdfImage image = PdfImage( pdf, image: img.data.buffer.asUint8List(), width: img.width, height: img.height); This is the message of the error in the

How to change flutter app keyboard color?

…衆ロ難τιáo~ 提交于 2021-02-18 13:56:27
问题 In my flutter , I create a TextFormField, but it's keyboard color is black in iOS, I want to know how to change it to white. flutter language version: >=2.2.2 <3.0.0 this is my code about the TextFormField: TextFormField( style: TextStyle( fontSize: 14, color: Colors.black), autofocus: false, initialValue: 'initial value', maxLines: 1, // onSaved: (String value) => _person = value, // obscureText: _isObscure, validator: (String value) { if (value.isEmpty) { return 'nononono'; } return null; }

Undefined symbols for architecture x86_64 flutter

梦想的初衷 提交于 2021-02-18 10:41:42
问题 I'm working in an app flutter. Android working fine but in ios no. I need some help to run this on ios mobile. I'm using lib: google_maps_flutter: ^0.5.27+3 and firebase_ml_vision: ^0.9.3+8 . Xcode 11.4.1 and Mac os Catalina 10.15.4. Someone knows how to solve this. I didn't found yet. flutter doctor [✓] Flutter (Channel stable, v1.17.0, on Mac OS X 10.15.4 19E287, locale en-BR) [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3) [✓] Xcode - develop for iOS and

How to jump to another page with pageview flutter

时光总嘲笑我的痴心妄想 提交于 2021-02-18 10:33:11
问题 Hello I tried to jump to my second page tab if I press on a button on my first Page tab. Currently I know only call route of my seconde page widget but bottomnavbar isn't present... I don't know how to call my parent widget from my first page tab to jump to the seconde page tab. class Parent { int bottomSelectedIndex = 0; List<BottomNavigationBarItem> buildBottomNavBarItems() { return [ BottomNavigationBarItem( icon: new Icon(Icons.home), title: new Text('First') ), BottomNavigationBarItem(

How to save image data to sqflite database in flutter for persistence

这一生的挚爱 提交于 2021-02-18 10:15:03
问题 I'm building a Flutter app where I would like to keep the data offline. I'm capturing an image using the camera or gallery image picker and able to store that image into a File image variable. File _avatarImg; void _getImage(BuildContext context, ImageSource source) { ImagePicker.pickImage( source: source, maxWidth: 400.0, maxHeight: 400.0, ).then((File image) { _avatarImg = image; }); } This works perfectly however my question is, how would I go about storing this image for persistence?

How to save image data to sqflite database in flutter for persistence

人盡茶涼 提交于 2021-02-18 10:13:59
问题 I'm building a Flutter app where I would like to keep the data offline. I'm capturing an image using the camera or gallery image picker and able to store that image into a File image variable. File _avatarImg; void _getImage(BuildContext context, ImageSource source) { ImagePicker.pickImage( source: source, maxWidth: 400.0, maxHeight: 400.0, ).then((File image) { _avatarImg = image; }); } This works perfectly however my question is, how would I go about storing this image for persistence?

Flutter: bloc, how to show an alert dialog

﹥>﹥吖頭↗ 提交于 2021-02-18 10:13:39
问题 I´m new in the bloc pattern and stream stuff. I want to show up an alert dialog when I press a button, but I can´t find a way to do it. Actually my code is: Widget button() { return RaisedButton( child: Text('Show alert'), color: Colors.blue[700], textColor: Colors.white, onPressed: () { bloc.submit(); }); } return Scaffold( appBar: AppBar( title: Text("Title"), ), body: StreamBuilder( stream: bloc.getAlert, builder: (context, snapshot) { if (snapshot.hasData) { return Text("I have Dataaaaaa

Flutter: bloc, how to show an alert dialog

浪子不回头ぞ 提交于 2021-02-18 10:12:23
问题 I´m new in the bloc pattern and stream stuff. I want to show up an alert dialog when I press a button, but I can´t find a way to do it. Actually my code is: Widget button() { return RaisedButton( child: Text('Show alert'), color: Colors.blue[700], textColor: Colors.white, onPressed: () { bloc.submit(); }); } return Scaffold( appBar: AppBar( title: Text("Title"), ), body: StreamBuilder( stream: bloc.getAlert, builder: (context, snapshot) { if (snapshot.hasData) { return Text("I have Dataaaaaa

iOS Simulator scrolls too fast on Apple M1

本秂侑毒 提交于 2021-02-18 08:38:34
问题 I'm running a flutter project and when dragging any list or scroll view on the simulator, it scrolls with way too much force rendering almost impossible to get to the row I need. This only happens in the simulator, and it seems to work fine on a real device. Also, this problem started when I had migrated to an Apple M1 MacBook Pro. Any ideas? 回答1: I experienced a similar issue but the problem, in my case, is not related to speed but something different. Specifically, if you force your iOS