forked from eatvio/eatvio_app
feat(diary): fixes
This commit is contained in:
@@ -56,6 +56,24 @@ class GlossarySyncBannerWidget extends StatelessWidget {
|
||||
color: const Color(0xFFDC2626),
|
||||
icon: Icons.error_outline_rounded,
|
||||
text: message,
|
||||
action: TextButton(
|
||||
onPressed: () => context.read<GlossarySyncCubit>().syncNow(),
|
||||
style: TextButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
minimumSize: Size.zero,
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
),
|
||||
child: const Text(
|
||||
'Повторить',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
decoration: TextDecoration.underline,
|
||||
decorationColor: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -68,6 +86,7 @@ class GlossarySyncBannerWidget extends StatelessWidget {
|
||||
required String text,
|
||||
bool showSpinner = false,
|
||||
double? progress,
|
||||
Widget? action,
|
||||
}) {
|
||||
return _AnimatedBanner(
|
||||
color: color,
|
||||
@@ -75,6 +94,7 @@ class GlossarySyncBannerWidget extends StatelessWidget {
|
||||
text: text,
|
||||
showSpinner: showSpinner,
|
||||
progress: progress,
|
||||
action: action,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -95,6 +115,7 @@ class _AnimatedBanner extends StatefulWidget {
|
||||
final String text;
|
||||
final bool showSpinner;
|
||||
final double? progress;
|
||||
final Widget? action;
|
||||
|
||||
const _AnimatedBanner({
|
||||
required this.color,
|
||||
@@ -102,6 +123,7 @@ class _AnimatedBanner extends StatefulWidget {
|
||||
required this.text,
|
||||
this.showSpinner = false,
|
||||
this.progress,
|
||||
this.action,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -182,6 +204,7 @@ class _AnimatedBannerState extends State<_AnimatedBanner>
|
||||
),
|
||||
),
|
||||
),
|
||||
if (widget.action != null) widget.action!,
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user