Dashboard webview hybrid composition support
This commit is contained in:
@@ -12,13 +12,14 @@ class TbAppBar extends TbContextWidget<TbAppBar, _TbAppBarState> implements Pref
|
||||
final Widget? title;
|
||||
final List<Widget>? actions;
|
||||
final double? elevation;
|
||||
final Color? shadowColor;
|
||||
final bool showLoadingIndicator;
|
||||
|
||||
@override
|
||||
final Size preferredSize;
|
||||
|
||||
TbAppBar(TbContext tbContext, {this.leading, this.title, this.actions, this.elevation = 8,
|
||||
this.showLoadingIndicator = false}) :
|
||||
this.shadowColor, this.showLoadingIndicator = false}) :
|
||||
preferredSize = Size.fromHeight(kToolbarHeight + (showLoadingIndicator ? 4 : 0)),
|
||||
super(tbContext);
|
||||
|
||||
@@ -68,7 +69,7 @@ class _TbAppBarState extends TbContextState<TbAppBar, _TbAppBarState> {
|
||||
title: widget.title,
|
||||
actions: widget.actions,
|
||||
elevation: widget.elevation,
|
||||
shadowColor: Color(0xFFFFFFFF).withAlpha(150),
|
||||
shadowColor: widget.shadowColor ?? Color(0xFFFFFFFF).withAlpha(150),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
33
lib/widgets/two_value_listenable_builder.dart
Normal file
33
lib/widgets/two_value_listenable_builder.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class TwoValueListenableBuilder<A, B> extends StatelessWidget {
|
||||
TwoValueListenableBuilder(
|
||||
{
|
||||
Key? key,
|
||||
required this.firstValueListenable,
|
||||
required this.secondValueListenable,
|
||||
required this.builder,
|
||||
this.child,
|
||||
}) : super(key: key);
|
||||
|
||||
final ValueListenable<A> firstValueListenable;
|
||||
final ValueListenable<B> secondValueListenable;
|
||||
final Widget? child;
|
||||
final Widget Function(BuildContext context, A a, B b, Widget? child) builder;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ValueListenableBuilder<A>(
|
||||
valueListenable: firstValueListenable,
|
||||
builder: (_, a, __) {
|
||||
return ValueListenableBuilder<B>(
|
||||
valueListenable: secondValueListenable,
|
||||
builder: (context, b, __) {
|
||||
return builder(context, a, b, child);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user