This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const paginate = ({lastPage,currentPage}) => { | |
const _links = Array.from({ length: lastPage}, (_, i) => i + 1); | |
return _links.reduce((acc, link) => { | |
if ( | |
link === 1 || | |
link === _links.length || | |
(link > currentPage - 2 && link < currentPage + 2) | |
) { | |
acc.push(link); | |
} else if ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ----------------------------------------------------------------------- */ | |
/* ENABLE CUTOUT MODE FOR ANDROID 9.0 AND ABOVE DEVICES */ | |
/* to avoid notch cutout and black bars on the sides issue in flutter */ | |
/* ----------------------------------------------------------------------- */ | |
import android.os.Build | |
import android.view.WindowManager | |
import io.flutter.embedding.android.FlutterActivity | |
class MainActivity: FlutterActivity(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'dart:math'; | |
import 'dart:typed_data'; | |
import 'package:crypto/crypto.dart'; | |
import 'package:tuple/tuple.dart'; | |
import 'package:encrypt/encrypt.dart' as encrypt; | |
String encryptAESCryptoJS(String plainText, String passphrase) { | |
try { | |
final salt = genRandomWithNonZero(8); |