Archie Mistry

Archie Mistry

1605201120

Include Common Utils And Widgets

Flutter Common

include common Utils and Widgets

Utils

1. CommonApp

get app info, like: label, packageName, versionName, versionCode

2. CommonCrypto
  • toMd5(): MD5 encryption
  • encodeB64(): Base64 encoding
  • decodeB64(): Base64 decoding
  • aesEncrypt(): AES encryption
  • aesDecrypt(): AES decryption
3. CommonDevice
  • model(): model
  • releaseVersion(): firmware version
  • identifier(): Device Id
3. CommonFile
  • strSize(): Format the display file size
4. CommonSp

Use shared_preferences for lightweight data access

  • getInt(): Get int data by key
  • putInt(): store int data
5. CommonSystem
  • copyToClipboard(): copy text to clipboard
  • screenWidth(): Get the current device screen width
  • screenHeight(): Get the current device screen height
  • statusBarHeight(): Get the height of the current device screen status bar
6. CommonTime
  • currentMillisecondsTimeStamp(): Get the millisecond timestamp of the current time
  • currentTimeStamp(): Get the second timestamp of the current time
  • parseDateTimeStr(): Convert the specified format characters to Date
  • dateTimeToStr(): Convert Date to specified format characters
  • timeStampToStr(): Convert the specified timestamp to a time string
  • timeStampToStrWrapped(): Convert the specified timestamp to a standard format string
  • diffDays(): Calculate the number of days between two dates
7. CommonColor
  • fromStr(): Generate different colors according to different strings

Widgets


1. loading view

loading view

2. network image view

loading view

3. file selector

loading view

4. bottom menu

loading view

5. bottom modal

loading view

6. dialog

loading view

Download Details:

Author: wiatec

Source Code: https://github.com/wiatec/flutter_common

#flutter #dart #mobile-apps

What is GEEK

Buddha Community

Include Common Utils And Widgets
Coy  Roberts

Coy Roberts

1599768240

Javascript String Includes Example | String.prototype.includes()

Javascript string includes() is an inbuilt function that determines whether one string may be found within another string, returning true or false as appropriate. With ES6 JavaScript added the includes method natively to both the Array and String natives. While true or false may provide the answer you need, regular expressions can check if a substring exists with a more detailed answer.

Javascript String Includes Example

The string includes() method lets you determine whether or not a  string includes another string. See the following syntax.

str.includes(searchString)

It has only one required parameter which is searchString. It is the substring, which we need to search in the String. See the following example.

// app.js

strA = 'Hello World, Welcome to ES9';

console.log(strA.includes('ES9'));

In the above example, we are checking if the ES9 substring is there inside the strA and if yes then it will return true. In the above example, it is there, so we will see the output true.

#javascript #includes* #string.prototype.includes #js

Archie Mistry

Archie Mistry

1605201120

Include Common Utils And Widgets

Flutter Common

include common Utils and Widgets

Utils

1. CommonApp

get app info, like: label, packageName, versionName, versionCode

2. CommonCrypto
  • toMd5(): MD5 encryption
  • encodeB64(): Base64 encoding
  • decodeB64(): Base64 decoding
  • aesEncrypt(): AES encryption
  • aesDecrypt(): AES decryption
3. CommonDevice
  • model(): model
  • releaseVersion(): firmware version
  • identifier(): Device Id
3. CommonFile
  • strSize(): Format the display file size
4. CommonSp

Use shared_preferences for lightweight data access

  • getInt(): Get int data by key
  • putInt(): store int data
5. CommonSystem
  • copyToClipboard(): copy text to clipboard
  • screenWidth(): Get the current device screen width
  • screenHeight(): Get the current device screen height
  • statusBarHeight(): Get the height of the current device screen status bar
6. CommonTime
  • currentMillisecondsTimeStamp(): Get the millisecond timestamp of the current time
  • currentTimeStamp(): Get the second timestamp of the current time
  • parseDateTimeStr(): Convert the specified format characters to Date
  • dateTimeToStr(): Convert Date to specified format characters
  • timeStampToStr(): Convert the specified timestamp to a time string
  • timeStampToStrWrapped(): Convert the specified timestamp to a standard format string
  • diffDays(): Calculate the number of days between two dates
7. CommonColor
  • fromStr(): Generate different colors according to different strings

Widgets


1. loading view

loading view

2. network image view

loading view

3. file selector

loading view

4. bottom menu

loading view

5. bottom modal

loading view

6. dialog

loading view

Download Details:

Author: wiatec

Source Code: https://github.com/wiatec/flutter_common

#flutter #dart #mobile-apps

Murray  Beatty

Murray Beatty

1597773960

Is Common Sense Common In NLP Models?

NLP Models have shown tremendous advancements in syntactic, semantic and linguistic knowledge for downstream tasks. However, that raises an interesting research question — is it possible for them to go beyond pattern recognition and apply common sense for word-sense disambiguation?

Thus, to identify if BERT, a large pre-trained NLP model developed by Google, can solve common sense tasks, researchers took a closer look. The researchers from Westlake University and Fudan University, in collaboration with Microsoft Research Asia, discovered how the model computes the structured, common sense knowledge for downstream NLP tasks.

According to the researchers, it has been a long-standing debate as to whether pre-trained language models can solve tasks leveraging only a few shallow clues and their common sense of knowledge. To figure that out, researchers used a CommonsenseQA dataset for BERT to solve multiple-choice problems.

#opinions #ai common sense #bert #bert model #common sense #nlp model #nlp models

Hunter  Krajcik

Hunter Krajcik

1624422526

Writing custom Widgets in Flutter (Part 1) — EllipsizedText

Intro

Declarative UI in Flutter is pretty nice, easy to use and it is very enticing to use it as much as possible. But very often developers just go overboard with it — writing everything in a declarative style even when sometimes task can be done much more efficiently and easier to understand in a more imperative way.

What everyone should understand — there always must be a balance between declarative and imperative programming. Each has its own uses and each shines at some tasks brighter than other.

In this series of articles I’ll describe how to solve different problems by creating custom Widgets from scratch. Each one is a little more complicated than a previous one.

Quick Theory

There some basic things we need to know before looking at the code.

Widget — is just an immutable (preferably const) class that contains configuration properties for Elements and RenderObjects. It is also responsible for creating said Elements and RenderObjects. Important thing to understand — Widgets never contain state nor any business logic, only pass them.

Element — is an entity responsible for the actual UI tree. It has references to all children and (unlike Widget) to its parent. Elements are reused most of the time, unless key or Widget are changed. So if onlyWidget properties are changed, even though new Widget is allocated, Element will remain the same.

State — is nothing more than a user-defined class inside Element that also has some callbacks from itsElement exposed.

#custom-widget #ellipsis #flutter #widget

Elliott  Owen

Elliott Owen

1626913620

Exploring Flutter Widgets || Flutter Scaffold Widget & Its Properties #16

In this video I have discussed about Scaffold widget and its different properties.

It is a widget which implements the basic material design structure for the flutter app.

#flutter #exploring flutter widgets #flutter scaffold widget #its properties