mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
format code
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
|
||||
extension ContextExt on BuildContext {
|
||||
T read<T>(ProviderBase<T> provider) {
|
||||
@@ -10,3 +11,15 @@ extension ContextExt on BuildContext {
|
||||
return (this as WidgetRef).watch<T>(provider);
|
||||
}
|
||||
}
|
||||
|
||||
extension StringExt on String? {
|
||||
void toast() {
|
||||
if (this == null || this!.isEmpty) return;
|
||||
Fluttertoast.showToast(
|
||||
msg: this!,
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.CENTER,
|
||||
timeInSecForIosWeb: 1,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user