I deploy in an apache server a mobile access project, after accesing from local network using an iphone12 is ok but when trying to open the screens or the trends the mobile access go off
mardi 2 novembre 2021
flutter Web) User model cannot be uploaded to firestore after signup
I'm going to upload the user model to the database after signing up as a member through firebase Auth on the flutter web. If sign up, I can register well with Firebase Auth. However, after that, an error is output while uploading to the database.
pubspec.uaml
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
firebase_core: ^0.5.0 #웹을 위해 추가?
firebase_auth: ^0.18.0 #0.16.1
cloud_firestore: ^0.14.0 #0.13.7
firebase_storage: ^4.0.0 #3.1.6
flutter_web_frame: ^0.0.2 #웹에서 최대 사이즈를 지정해주는 패키지
carousel_slider: ^3.0.0
get: ^3.3.0
cached_network_image: ^2.2.0+1
provider: ^4.3.3
auth and firestore code
class Transformers {
//DocumentSnapshot -> UserModel Transform
final toUser = StreamTransformer<DocumentSnapshot, UserModel>.fromHandlers(
handleData: (snapshot, sink) async {
sink.add(UserModel.fromSnapShot(snapshot));
}
);
}
class UserNetworkRepo with Transformers{
//When signing up, check if user model is registered in the firestore and upload if not.
Future<void> attempCreatUser({String userKey, String userEmail}) async {
final DocumentReference userRef =
FirebaseFirestore.instance.collection(COLLECTION_USERS).doc(userKey);
//get user document
DocumentSnapshot snapshot = await userRef.get();
//check user database
if (!snapshot.exists) {
return await userRef.set(UserModel.getMapForCreatUser(userEmail));
}
}
Stream<UserModel> getUserModelStream(String userKey) {
return FirebaseFirestore.instance
.collection(COLLECTION_USERS)
.doc(userKey)
.snapshots()
//documentSnapshot data -> UserNodel
.transform(toUser);
}
During the debug, the StreamTransformer brakes and then outputs the following errors.
TypeError: Cannot read properties of null (reading 'Symbol(dartx._get)')
at user_model.UserModel.fromSnapShot.user_model.UserModel.fromMap (http://localhost:65386/packages/omd_test/model/user_model.dart.lib.js:103:42)
at new user_model.UserModel.fromSnapShot (http://localhost:65386/packages/omd_test/model/user_model.dart.lib.js:113:34)
at http://localhost:65386/packages/omd_test/repo/helper/transformer.dart.lib.js:36:18
at Generator.next (<anonymous>)
at runBody (http://localhost:65386/dart_sdk.js:40666:34)
at Object._async [as async] (http://localhost:65386/dart_sdk.js:40697:7)
at http://localhost:65386/packages/omd_test/repo/helper/transformer.dart.lib.js:35:137
at _HandlerEventSink.new.add (http://localhost:65386/dart_sdk.js:39044:11)
at _SinkTransformerStreamSubscription.new.[_handleData] (http://localhost:65386/dart_sdk.js:38869:34)
at _RootZone.runUnaryGuarded (http://localhost:65386/dart_sdk.js:40429:11)
at _ForwardingStreamSubscription.new.[_sendData] (http://localhost:65386/dart_sdk.js:33989:22)
at _ForwardingStreamSubscription.new.[_add] (http://localhost:65386/dart_sdk.js:33935:26)
at _ForwardingStreamSubscription.new.[_add] (http://localhost:65386/dart_sdk.js:38197:20)
at _MapStream.new.[_handleData] (http://localhost:65386/dart_sdk.js:38328:19)
at _ForwardingStreamSubscription.new.[_handleData] (http://localhost:65386/dart_sdk.js:38225:37)
at _RootZone.runUnaryGuarded (http://localhost:65386/dart_sdk.js:40429:11)
at _ForwardingStreamSubscription.new.[_sendData] (http://localhost:65386/dart_sdk.js:33989:22)
at _ForwardingStreamSubscription.new.[_add] (http://localhost:65386/dart_sdk.js:33935:26)
at _ForwardingStreamSubscription.new.[_add] (http://localhost:65386/dart_sdk.js:38197:20)
at _HandleErrorStream.new.[_handleData] (http://localhost:65386/dart_sdk.js:38403:19)
at _ForwardingStreamSubscription.new.[_handleData] (http://localhost:65386/dart_sdk.js:38225:37)
at _RootZone.runUnaryGuarded (http://localhost:65386/dart_sdk.js:40429:11)
at _ForwardingStreamSubscription.new.[_sendData] (http://localhost:65386/dart_sdk.js:33989:22)
at _ForwardingStreamSubscription.new.[_add] (http://localhost:65386/dart_sdk.js:33935:26)
at _ForwardingStreamSubscription.new.[_add] (http://localhost:65386/dart_sdk.js:38197:20)
at _MapStream.new.[_handleData] (http://localhost:65386/dart_sdk.js:38328:19)
at _ForwardingStreamSubscription.new.[_handleData] (http://localhost:65386/dart_sdk.js:38225:37)
at _RootZone.runUnaryGuarded (http://localhost:65386/dart_sdk.js:40429:11)
at _BroadcastSubscription.new.[_sendData] (http://localhost:65386/dart_sdk.js:33989:22)
at _BroadcastSubscription.new.[_add] (http://localhost:65386/dart_sdk.js:33935:26)
at _SyncBroadcastStreamController.new.[_sendData] (http://localhost:65386/dart_sdk.js:34655:34)
at _SyncBroadcastStreamController.new.add (http://localhost:65386/dart_sdk.js:34449:24)
at http://localhost:65386/packages/cloud_firestore_web/src/interop/utils/utils.dart.lib.js:367:22
at Object._checkAndCall (http://localhost:65386/dart_sdk.js:5586:16)
at Object.dcall (http://localhost:65386/dart_sdk.js:5591:17)
at Object.ret [as next] (http://localhost:65386/dart_sdk.js:62759:21)
at Object.next (https://www.gstatic.com/firebasejs/8.6.1/firebase-firestore.js:1:320206)
at next (https://www.gstatic.com/firebasejs/8.6.1/firebase-firestore.js:1:303665)
at https://www.gstatic.com/firebasejs/8.6.1/firebase-firestore.js:1:244953
[2021-11-02T07:24:18.188Z] @firebase/firestore:
I'm making the web and the app together, the app works well. Can I know the problem with this?
Thank you.
Spotify like, LIKE BUTTON in Notification Bar with MEDIA SESSION API in web
There are limited properties to setActionHandlers(). eg- Play pause, seekForward....
I want to add a like button apart from limited to play, pause, seekForward... in the notification bar of my web music player.
Similar, to Spotify Like Button in the Notification bar along with Media Controls......in web May be with Media Session Api
lundi 1 novembre 2021
How to hide subcategories from menu in wordpress and keep only categories?
I have web site, but there is menu where shown categories and subcategories. I need to hide subcategories. i suppose, here i need to change php code or change theme.
P.s. I use envo marketplace theme
Here is code of this menu:
https://github.com/PieceOfNachos/Stackoverflow/blob/main/wp-menu1.php
Which is better framework Django or Flask? [closed]
I asked this question with my friends but they didn't know about it i am looking for a better framework for Web Development that is coded in Python please help ;/
How to retrive from other table and input it again into another table in laravel?
I want to retrieve some data from 'tbl_karyawan' and input into 'tbl_absen' which is if the NIP exist from 'tbl_karyawan' then parshing some data into 'tbl_absen'. I was create the code, and the data is going well. but i have something trouble with 
i want the data input in Nip_kyn be like 'KIP001' not [{"Nip_kyn":"KIP001"}].
this is my Model
public function presensi($data)
{
$isExist = DB::table('tbl_karyawan')
->where('Nip_kyn', $data)->exists();
if ($isExist) {
$namakyn = DB::table('tbl_karyawan')->where($data)->get('Nama_kyn');
$nippppp = DB::table('tbl_karyawan')->where($data)->select('Nip_kyn')->get($data);
$values = array('Nip_kyn' => $nippppp, 'Nama_kyn' => $namakyn, 'Jam_msk' => now(), 'Log_date' => today());
DB::table('tbl_absen')->insert($values);
} else {
echo 'data not available';
}
}
this is my controller
public function get()
{
$day = [
'time_in' => $this->AbsenModel->timeIN(),
'time_out' => $this->AbsenModel->timeOut(),
'break' => $this->AbsenModel->break(),
// absen here
's' => $this->AbsenModel->absensi(),
];
$data = [
'Nip_kyn' => Request()->Nip_kyn,
];
$this->AbsenModel->presensi($data);
return view('v_absen', $data, $day);
}
Issues with Freenom Domains [closed]
I resigested a freenom domain recently with a .tk address and have wanted to use it for email. How do you do it? I assume that the target is the IP of my server and the name is a subdomain. Help would be appreciated. Freenom MX Record Thing