Skip to content

Instantly share code, notes, and snippets.

abstract class RichLogic {
static String removeAllSpecialFormatting(String text) => text
.replaceAll('*', '')
.replaceAll('#', '')
.replaceAll('[', '')
.replaceAll(']', '')
.replaceAll('{', '')
.replaceAll('}', '');
@LordOlumide
LordOlumide / awesome_notifications_actions.dart
Created February 8, 2025 09:05
Everything you should need to implement firebase notifications using awesome notifications
import 'package:awesome_notifications/awesome_notifications.dart';
abstract class AwesomeNotificationActions {
/// Use this method to detect when a new notification or a schedule is created
@pragma("vm:entry-point")
static Future<void> onNotificationCreatedMethod(
ReceivedNotification receivedNotification,
) async {
// Your code goes here
}
// The algorithm implemented is a mix of XOR cipher and Ceasar's cipher.
// It can be seen that the algorithm is case-sensitive from the examples included.
//
// Instructions for usage: Copy this entire Gist to https://dartpad.dev/ and run it.
//
// Output:
// ====================
// How are you doing, my king?
// how are you doing, my king?
// The faullt is not in our stars but in ourselves
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
import 'package:flutter/material.dart';
class CustomNavigationBar extends StatefulWidget {
final String activeScreen;
CustomNavigationBar({required this.activeScreen});
@override
State<CustomNavigationBar> createState() => _CustomNavigationBarState();
}
import 'package:flutter/material.dart';
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(brightness: Brightness.dark),
title: 'Animations tutorial',
import 'package:flutter/material.dart';
import 'dart:math';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
/// Format: "dd/mm/yyyy"
class DateInputFormatter extends TextInputFormatter {
@override
TextEditingValue formatEditUpdate(
TextEditingValue oldValue, TextEditingValue newValue) {
if (newValue.text.isEmpty) {
return newValue;
import 'package:flutter/material.dart';
class TestScreen extends StatefulWidget {
const TestScreen({Key? key}) : super(key: key);
@override
State<TestScreen> createState() => _TestScreenState();
}
class _TestScreenState extends State<TestScreen> {
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(
const MyApp(),
);
}