74 lines
1.9 KiB
Dart
74 lines
1.9 KiB
Dart
import 'package:birzha/components/categoryNameWidget.dart';
|
|
import 'package:birzha/constants.dart';
|
|
import 'package:birzha/core/adaptix/adaptix.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class AppDialog extends StatelessWidget {
|
|
const AppDialog({
|
|
Key? key,
|
|
this.title,
|
|
required this.child,
|
|
this.actions = const [],
|
|
}) : super(key: key);
|
|
|
|
final String? title;
|
|
final Widget child;
|
|
final List<Widget> actions;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Dialog(
|
|
insetPadding: EdgeInsets.symmetric(
|
|
horizontal: AppConstants.horizontalPadding(context),
|
|
),
|
|
child: Container(
|
|
padding: EdgeInsets.all(
|
|
14.adaptedPx(),
|
|
),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Expanded(
|
|
child: CategoryNameWidget(
|
|
categoryName: title ?? "",
|
|
),
|
|
),
|
|
GestureDetector(
|
|
onTap: () {
|
|
Navigator.of(context).pop();
|
|
},
|
|
child: Icon(
|
|
Icons.cancel_outlined,
|
|
color: Theme.of(context).accentColor,
|
|
size: 22.adaptedPx(),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
SizedBox(
|
|
height: 10.adaptedPx(),
|
|
),
|
|
Flexible(
|
|
child: SingleChildScrollView(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [child],
|
|
),
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: 10.adaptedPx(),
|
|
),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
children: actions,
|
|
)
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|