Skip to content

Instantly share code, notes, and snippets.

View AlexV525's full-sized avatar
🌍
typedef Day = πŸ› || πŸ–₯

Alex Li AlexV525

🌍
typedef Day = πŸ› || πŸ–₯
  • China, Shanghai
  • 13:43 (UTC +08:00)
  • X @AlexV525
View GitHub Profile
//
// [Author] Alex (https://github.com/AlexV525)
// [Date] 2020/9/15 14:06
//
import 'dart:async';
import 'package:flutter/widgets.dart';
extension SafeSetStateExtension on State {
@AlexV525
AlexV525 / drawer.dart
Last active June 7, 2022 09:29
Drawer in a transparent page route
//
// [Author] Alex (https://github.com/AlexV525)
// [Date] 2022/6/7 16:35
//
import 'package:flutter/material.dart';
/// A wrapped [Drawer] that typically useful when placed in a transparent route.
class CustomDrawer extends StatefulWidget {
const CustomDrawer({
@AlexV525
AlexV525 / lark_signer.dart
Created June 7, 2022 06:46
Signer for Lark webhooks
import 'dart:convert';
import 'package:crypto/crypto.dart';
Map<String, String> sign({
required String key,
DateTime? dateTime,
}) {
dateTime ??= DateTime.now();
final int timestamp = dateTime.millisecondsSinceEpoch ~/ 1000;
@AlexV525
AlexV525 / main.dart
Created April 28, 2022 03:15
None (same as `nil`, but named `None`)
///
/// [Author] Alex (https://github.com/AlexV525)
/// [Date] 2022/04/28 11:12
///
import 'package:flutter/widgets.dart';
const None none = None();
class None extends Widget {
const None({Key? key}) : super(key: key);
@AlexV525
AlexV525 / main.dart
Last active February 22, 2023 02:41
How to set the highest refresh rate on Android in Flutter using `flutter_displaymode`?
///
/// [Author] Alex (https://github.com/AlexV525)
/// [Date] 2022/03/07 23:25
///
import 'dart:async';
import 'dart:io';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
@AlexV525
AlexV525 / main.dart
Created October 22, 2021 10:39
Subtypes filtering from Supertype stream.
///
/// [Author] Alex (https://github.com/AlexV525)
/// [Date] 2021/10/22 18:38
///
import 'dart:async';
import 'package:meta/meta.dart';
void main() {
_initObservers();
@AlexV525
AlexV525 / decorated_sliver.dart
Last active October 14, 2021 06:39
DecoratedSliver
///
/// [Author] Alex (https://github.com/AlexV525)
/// [Date] 2021/10/13 14:36
///
import 'dart:math' as math;
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
@immutable
@AlexV525
AlexV525 / init.gradle
Last active July 17, 2023 02:38
Gradle with Chinese mirrors
// Use https://gist.github.com/AlexV525/5aff2a1621482e11abc8e97d88200ac1 instead.
🌞 Morning 178 commits β–ˆβ–ˆβ–ˆβ–Žβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 15.8%
πŸŒ† Daytime 503 commits β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Žβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 44.6%
πŸŒƒ Evening 396 commits β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Žβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 35.1%
πŸŒ™ Night 51 commits β–‰β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 4.5%
@AlexV525
AlexV525 / main.dart
Last active June 6, 2021 05:04
CountdownButton
///
/// [Author] Alex (https://github.com/AlexV525)
/// [Date] 2021-04-30 12:41
///
import 'dart:math' as math;
import 'dart:ui';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());