Line data Source code
1 : // Copyright 2023 The terCAD team. All rights reserved. 2 : // Use of this source code is governed by a CC BY-NC-ND 4.0 license that can be found in the LICENSE file. 3 : 4 : import 'package:app_finance/_configs/theme_helper.dart'; 5 : import 'package:flutter/material.dart'; 6 : 7 : class NotificationBar { 8 0 : static void showSnackBar(BuildContext context, String message, [bool asError = false]) { 9 0 : ScaffoldMessenger.of(context).showSnackBar( 10 0 : SnackBar( 11 0 : content: Row( 12 0 : children: [ 13 : asError ? const Icon(Icons.error_outline, color: Colors.red) : const Icon(Icons.check, color: Colors.green), 14 : ThemeHelper.wIndent, 15 0 : Text(message), 16 : ], 17 : ), 18 : duration: const Duration(seconds: 3), 19 : ), 20 : ); 21 : } 22 : }