mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
Fixes
This commit is contained in:
+7
-1
@@ -124,10 +124,16 @@ extension HiveBindable<T extends Keyable> on ObservableList<T> {
|
||||
listen().listen((event) => dest.acceptEntityChange(event));
|
||||
|
||||
void acceptBoxChange(BoxEvent event, {T transformed}) {
|
||||
print('---------------------');
|
||||
print('event.key: ${event.key}; event.deleted: ${event.deleted};');
|
||||
if (event.deleted) {
|
||||
removeWhere((el) => el.keyIndex == event.key);
|
||||
removeWhere((el) {
|
||||
print('el.keyIndex ${el.keyIndex}');
|
||||
return el.keyIndex == event.key; });
|
||||
}
|
||||
|
||||
print('---------------------');
|
||||
|
||||
final dynamic value = transformed ?? event.value;
|
||||
|
||||
if (value is T) {
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
import 'package:flushbar/flushbar.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Future<T> showBar<T>(BuildContext context, String text,
|
||||
{bool isDark = false, Duration duration = const Duration(seconds: 1), bool isDismissible = true}) {
|
||||
final bar = Flushbar<T>(
|
||||
boxShadows: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.09),
|
||||
blurRadius: 8,
|
||||
offset: Offset(0, 2))
|
||||
],
|
||||
backgroundColor: isDark ? Colors.black : Colors.white,
|
||||
borderRadius: 35,
|
||||
margin: EdgeInsets.all(50),
|
||||
messageText: Text(text,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: isDark ? Colors.white : Colors.black)),
|
||||
duration: duration,
|
||||
isDismissible: isDismissible,
|
||||
flushbarPosition: FlushbarPosition.TOP,
|
||||
flushbarStyle: FlushbarStyle.FLOATING);
|
||||
|
||||
return bar.show(context);
|
||||
}
|
||||
|
||||
Flushbar<T> createBar<T>(String text,
|
||||
{bool isDark = false, Duration duration = const Duration(seconds: 1), bool isDismissible = true}) {
|
||||
return Flushbar<T>(
|
||||
boxShadows: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.09),
|
||||
blurRadius: 8,
|
||||
offset: Offset(0, 2))
|
||||
],
|
||||
backgroundColor: isDark ? Colors.black : Colors.white,
|
||||
borderRadius: 35,
|
||||
margin: EdgeInsets.all(50),
|
||||
messageText: Text(text,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: isDark ? Colors.white : Colors.black)),
|
||||
duration: duration,
|
||||
isDismissible: isDismissible,
|
||||
flushbarPosition: FlushbarPosition.TOP,
|
||||
flushbarStyle: FlushbarStyle.FLOATING);
|
||||
}
|
||||
Reference in New Issue
Block a user