first commit

This commit is contained in:
ksenia312
2024-01-31 14:16:22 +01:00
commit 541fbeaaf3
132 changed files with 6463 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
part of '../main.dart';
enum _ActionButtonType {
idle(Color(0xFF00C853)),
warning(Color(0xFFD50000));
const _ActionButtonType(this.color);
final Color color;
}
class _ActionButton extends StatelessWidget {
const _ActionButton({
required this.onTap,
required this.title,
this.type = _ActionButtonType.idle,
});
final VoidCallback onTap;
final String title;
final _ActionButtonType type;
@override
Widget build(BuildContext context) {
return ElevatedButton(
onPressed: onTap,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
foregroundColor: Colors.white,
maximumSize: const Size(150, 70),
minimumSize: const Size(70, 70),
elevation: 3,
surfaceTintColor: type.color.withOpacity(0.05),
),
child: Text(
title,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
color: type.color,
height: 1,
),
),
);
}
}
+40
View File
@@ -0,0 +1,40 @@
import 'package:flutter/material.dart';
class AppShackBar {
AppShackBar._();
static ScaffoldFeatureController<SnackBar, SnackBarClosedReason>? show(
BuildContext context,
String title, {
String? subtitle,
}) {
return ScaffoldMessenger.maybeOf(context)?.showSnackBar(
SnackBar(
content: RichText(
text: TextSpan(
text: '$title \n',
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 16),
children: [
if (subtitle != null)
TextSpan(
text: subtitle,
style: const TextStyle(
fontWeight: FontWeight.normal,
fontSize: 14,
),
),
],
),
),
behavior: SnackBarBehavior.floating,
margin: const EdgeInsets.only(
left: 12,
right: 12,
bottom: 20,
),
backgroundColor: Colors.pink.shade800,
duration: const Duration(seconds: 2),
),
);
}
}