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
mixin OverlayStateMixin<T extends StatefulWidget> on State<T> { | |
@override | |
void dispose() { | |
removeOverlay(); | |
super.dispose(); | |
} | |
@override | |
void didChangeDependencies() { | |
removeOverlay(); |
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:async'; | |
import 'package:amplify_flutter/amplify_flutter.dart'; | |
import 'notification_dto.dart'; | |
import 'service.dart'; | |
Future<void> amplifyBackgroundNotificationReceivedHandler( | |
PushNotificationMessage notification) async { | |
NotificationService.backgroundNotificationReceivedHandler( |
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 'package:flutter/material.dart'; | |
// Records | |
typedef Position = ({double? x, double? y}); | |
typedef VisibleArea = ({Position topLeft, Position bottomRight}); | |
// Callbacks | |
typedef SizeCallback = void Function(({double? height, double? width})); |
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:async'; | |
import 'dart:io'; | |
import 'package:connectivity_plus/connectivity_plus.dart'; | |
/// Connectivity service use to check if an app is connected to the internet. | |
/// Exposes a stream to allow the client perform more on time state changes as connectivity changes. | |
/// Also exposes a hasConnection getter for one-off on-demand connection checks. | |
/// Call ConnectivityService.instance.initialise() to get the service up and running. | |
/// Service depends on connectivity_plus. |
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'; | |
final class CacheItem { | |
final String key; | |
final Object data; | |
final DateTime expiry; | |
const CacheItem._(this.key, this.data, this.expiry); | |
/// This factory constructor is used for caching data that shouldn't persist |
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 'package:flutter/material.dart'; | |
import 'package:notification_poc/toast_notification.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatefulWidget { | |
const MyApp({super.key}); |
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 'package:flutter/material.dart'; | |
/// Widget which determines users inactivity by listening for touch actions, best used at the root(MaterialApp) | |
/// of your project. | |
/// Inactivity duration is the duration to listen for | |
/// onNoActiveInteraction is callback to perform action when the app hasn't been interacted with | |
/// for [inactivityDuration]. | |
class InteractionInactivityWidget extends StatefulWidget { | |
const InteractionInactivityWidget({ | |
super.key, |
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
/// Example Usage | |
class MyWidget extends StatefulWidget { | |
const MyWidget({super.key}); | |
@override | |
State<MyWidget> createState() => _MyWidgetState(); | |
} | |
class _MyWidgetState extends State<MyWidget> { | |
double _progress = 1; |
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 'package:flutter/material.dart'; | |
import 'dart:math'; | |
class CountdownOTPWidget extends StatefulWidget { | |
const CountdownOTPWidget({ | |
super.key, | |
required this.countDownDurationInMinutes, | |
this.children = const [], | |
this.progressColor, | |
this.progressBackgroundColor, |
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 'package:flutter/services.dart'; | |
import 'package:local_auth/error_codes.dart' as auth_error; | |
import 'package:local_auth/local_auth.dart' as local_auth; | |
class BiometricsService implements BiometricsInterface { | |
const BiometricsService(); | |
static final _auth = local_auth.LocalAuthentication(); |
NewerOlder