feat(example_full): create example representing the whole plugin functional

This commit is contained in:
ksenia312
2024-02-06 19:41:56 +01:00
parent 258cdf0adc
commit f71121bd92
89 changed files with 3112 additions and 1164 deletions
+43
View File
@@ -0,0 +1,43 @@
import 'package:flutter/material.dart';
import 'action_button.dart';
class AppShackBar {
AppShackBar._();
static ScaffoldFeatureController<SnackBar, SnackBarClosedReason>? show(
BuildContext context,
String title, {
String? subtitle,
ActionType actionType = ActionType.idle,
}) {
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: actionType.color,
duration: const Duration(seconds: 2),
),
);
}
}