Flutter

Flutter PhotoView - Rotation about the point between the fingers

时间秒杀一切 提交于 2021-01-28 12:13:47
问题 I am using PhotoView (https://pub.dev/packages/photo_view) to showcase a map saved in gif format. I need the ability to zoom and rotate. My code: class MapView extends StatelessWidget { @override Widget build(BuildContext context) { return PhotoView( imageProvider: AssetImage("assets/maps/my_map.gif"), enableRotation: true, backgroundDecoration: BoxDecoration( color: Colors.white, ), ); } } The problem is that the picture is rotated relative to the center of the picture, which is inconvenient

Flutter: setState() or markNeedsBuild() called during build

有些话、适合烂在心里 提交于 2021-01-28 12:09:25
问题 I have a page that shows video. But when I complete the video and pop back to the previous page I get this bellow error. My app works all fine and good with no breaks, but this below error bothers me. setState() or markNeedsBuild() called during build is the error that I am unable to fix I need help to fix this error. Here is my error: ══╡ EXCEPTION CAUGHT BY FOUNDATION LIBRARY ╞════════════════════════════════════════════════════════ The following assertion was thrown while dispatching

async/await to do CircularProgressIndicator in a Login Page in Flutter

时光总嘲笑我的痴心妄想 提交于 2021-01-28 11:40:46
问题 I am facing problems with the CircularProgressIndicator in a login page. I would like to do this. When the users tap in "log in" button I want that the app makes a CircularProgressIndicator and kick the raisedButton Text and add the CircularProgessIdnicator, and after that my app get the data from my webservice I want to stop the CircularProgessIndicator. Any Tips? thanks. Actual Code (you can compile it without problems just add http: ^0.12.0 in dependencies). Photos of the actual system:

How to fetch the data from cloud_firestore and display it in the TextField in flutter

穿精又带淫゛_ 提交于 2021-01-28 11:34:04
问题 Padding( padding: const EdgeInsets.all(14.0), child: Container( child: TextFormField( initialValue: fullName, cursorColor: Colors.deepPurpleAccent, decoration: InputDecoration( hintText: 'Full Name', focusedBorder: InputBorder.none, focusColor: Colors.deepPurpleAccent, enabledBorder: OutlineInputBorder( borderSide: BorderSide( color: Colors.deepPurpleAccent, ), ), ), ), ), ), String fullName; void _fetchUserData() async { try { FirebaseUser _currentUser = await FirebaseAuth.instance

Heart Rate Value in BLE

霸气de小男生 提交于 2021-01-28 11:13:17
问题 I am having a hard time getting a valid value out of the HR characteristics. I am clearly not handling the values properly in Dart. Example Data: List<int> value = [22, 56, 55, 4, 7, 3]; Flags Field: I convert the first item in the main byte array to binary to get the flags 22 = 10110 (as binary) this leads me to believe that it is U16 (bit[0] is == 1) HR Value: Because it is 16 bit I am trying to get the bytes in the 1 & 2 indexes. I then try to buffer them into a ByteData. From there I get

Flutter FCM Navigation onResume/onLaunch

自古美人都是妖i 提交于 2021-01-28 10:55:18
问题 In my app, I got a class "home" where the user is navigated to after he is authorized. Within "home" there is a PageView with BottomNavigationBar. When the user is getting a push notification from firebase (new message) he should be navigated to ChatHome and to the specific chat after tapping. How can I do this? Home does look like this @override Widget build(BuildContext context) { return Scaffold( key: _scaffoldKey, body: PageView( children: <Widget>[ Feed(userID: widget.userID), SearchView

How to load async Stream only one time in Flutter?

给你一囗甜甜゛ 提交于 2021-01-28 10:35:26
问题 I get a normal Stream of DocumentSnapshots from Firebase, and from it I generate another stream with the asyncMap() method : final _dataBaseReference = FirebaseFirestore.instance; Future<Stream> getPersonalShiftsbyDay() async { //the first, normal stream Stream firstStream = Stream<DocumentSnapshot> _personalShifts = _dataBaseReference.doc("personalScheduledShift/$_empId").snapshots(); // the second stream, obtained with asyncMap return _personalShifts.asyncMap((event) async { _shiftDetails =

How to load async Stream only one time in Flutter?

眉间皱痕 提交于 2021-01-28 10:31:50
问题 I get a normal Stream of DocumentSnapshots from Firebase, and from it I generate another stream with the asyncMap() method : final _dataBaseReference = FirebaseFirestore.instance; Future<Stream> getPersonalShiftsbyDay() async { //the first, normal stream Stream firstStream = Stream<DocumentSnapshot> _personalShifts = _dataBaseReference.doc("personalScheduledShift/$_empId").snapshots(); // the second stream, obtained with asyncMap return _personalShifts.asyncMap((event) async { _shiftDetails =

How to load async Stream only one time in Flutter?

社会主义新天地 提交于 2021-01-28 10:29:05
问题 I get a normal Stream of DocumentSnapshots from Firebase, and from it I generate another stream with the asyncMap() method : final _dataBaseReference = FirebaseFirestore.instance; Future<Stream> getPersonalShiftsbyDay() async { //the first, normal stream Stream firstStream = Stream<DocumentSnapshot> _personalShifts = _dataBaseReference.doc("personalScheduledShift/$_empId").snapshots(); // the second stream, obtained with asyncMap return _personalShifts.asyncMap((event) async { _shiftDetails =

Assertion failed: url != null is not true

半城伤御伤魂 提交于 2021-01-28 10:21:24
问题 ════════ Exception caught by widgets library ═══════════════════════════════════ The following assertion was thrown building HomePage(dirty, state: _HomePageState#493d9): Assertion failed: F:\…\painting_network_image_web.dart:23 url != null is not true This is the error I get when I add this codes in home.dart WallpaperModel wallpaperModel = WallpaperModel(); wallpaperModel = WallpaperModel.fromMap(element); wallpapers.add(wallpaperModel); also /widget/widget.dart Widget wallpapersList({List