mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 17:57:40 +00:00
23 lines
473 B
Dart
23 lines
473 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class ConditionalParent extends StatelessWidget {
|
|
const ConditionalParent({
|
|
Key? key,
|
|
required this.condition,
|
|
required this.builder,
|
|
required this.child,
|
|
}) : super(key: key);
|
|
|
|
final bool condition;
|
|
final Widget Function(Widget) builder;
|
|
final Widget child;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (condition) {
|
|
return builder(child);
|
|
} else {
|
|
return child;
|
|
}
|
|
}
|
|
}
|