Categories
Mastering Development

Webpack – import const from .d.ts file not working – Can’t resolve ‘@nuvolo/servicenow-types/server/GlideRecord’

I’m doing this: import { GlideRecord } from "@nuvolo/servicenow-types/server/GlideRecord"; I have a file node_modules/@nuvolo/servicenow-types/server/GlideRecord.d.ts It contains: … type GlideRecordConstructor = { new <T>(table: string): GlideRecord<T> }; type GlideRecord<T> = GlideRecordBase<T> & T; declare const GlideRecord: GlideRecordConstructor; export { GlideRecord }; If I run tsc it works, no errors Webpack says: Module not found: Error: Can’t […]

Categories
Mastering Development

Sequelize multiple associations between two tables

I’m creating a website for sports and I’m having trouble setting up the linking between teams and games. Each game has an homeTeamId and awayTeamId which is associated to my Teams table. Teams Model Associations: teams.hasMany(models.games, { as: ‘homeTeam’, foreignKey: { allowNull: false, name: ‘homeTeamId’ }, onDelete: ‘CASCADE’, }); teams.hasMany(models.games, { as: ‘awayTeam’, foreignKey: { […]

Categories
Mastering Development

The getter ‘ ‘ isn’t defined for the type ‘List

I’m trying to call "${brand.subject.acura_id}" but get an error error: The getter ‘acura_id’ isn’t defined for the type ‘List<Subject’. Where could I go wrong? I need this to pass data by id to the next screen, depending on the selected GestureDetector. If there are other options to implement this, I will also be glad to […]

Categories
Mastering Development

bazel: how to create a rule that strips relative path of all files in subfolders

I’m trying to write a bazel BUILD for GSL the problem is that it has various gsl_*.h header files in subfolders, but they are always included as #include <gsl/gsl_somename.h> so for example the header gsl_errno.h that lives in gsl/err/gsl_errno.h is included as #include <gsl/gsl_errno.h> and gsl_math.h that lives in gsl/gsl_math.h is also included as #include […]

Categories
Mastering Development

Flutter Gesture detector doesn’t pass taps even with HitTestBehavior set to translucent

In the following example the bottom GestureDetector doesn’t activate, even though the top one’s behaviour is set to translucent. How can I make it work? Stack( fit: StackFit.expand, children: [ GestureDetector( child: Container( color: Colors.purple, ), onTap: () => print(‘bottom’), ), GestureDetector( child: Container( color: Colors.green, ), onTap: () => print(‘top’), behavior: HitTestBehavior.translucent, ), ], […]

Categories
CMS Drupal Mastering Development

Custom field widget with user entity reference doesn’t work

I have created a custom field and custom field widget. The field widget has an entity_reference to a user field, which is never saved when the field is saved. I see the following error when I try to add a user. The default_property has to be an entity object The code I am using is […]

Categories
Mastering Development

how to make string as global variable in flutter

I was create SharedPreferences to save user loading in logon page. Then data of user will be save in SharedPreferences and move to main page. But my problem now in main page I need use this variable in different places in main page. But I cant do that. I need to make variable of logindata […]

Categories
Mastering Development

Recursively iterate over a nested object to change a key value on all occurrences (JS)

I’ve got this confusing data object that inside it contains objects within objects and objects within arrays because it gets returned as one big blob of data. I’m trying to figure out how to replace the value for all occurrences of link in the attributes object with something else, but I’m having a difficult time […]

Categories
Mastering Development

Flutter: Get json fixed data and ordered-by alphabetically

I get data from a json API. And want to show my app which data’s category is equal to 1. I could have done this by call category-1 url link but I need all data by link at a time and then divided into many parts. I am using if(mydata[index].category==1)then return. But I think it’s […]

Categories
Mastering Development

stream builder is not updating after navigation

I am using a stream builder to detect if user logged in or not. return StreamBuilder<User>( stream: AuthService().user, builder: (context, snapshot) { if (snapshot.hasData) return SectionWrapper(); else return Authentication(); }); and this is the stream I am using Stream<User> get user { return _auth.onAuthStateChanged.map(_userFromFirebaseUser); } //create user object based on firebase user User _userFromFirebaseUser(FirebaseUser user) […]