You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/lib/utilities/general_utils.dart

48 lines
1.6 KiB
Dart

// import 'package:another_flushbar/flushbar.dart';
// import 'package:flutter/foundation.dart';
// import 'package:flutter/material.dart';
// import 'package:test_sa/new_views/app_style/app_color.dart';
// todo delete
// class GeneralUtils {
// static Duration parseTimeString(String timeString) {
// try {
// print('time string i got is ${timeString}');
// List<String> timeParts = timeString.split(':');
//
// int hours = int.parse(timeParts[0]);
// int minutes = int.parse(timeParts[1]);
// int seconds = int.parse(timeParts[2]);
//
// print('');
//
// return Duration(hours: hours, minutes: minutes, seconds: seconds);
// } catch (e) {
// if (kDebugMode) {
// print("Error parsing time string: $e");
// }
// return Duration.zero; // Return zero duration in case of an error
// }
// }
//
// static Widget showFlushBar({required BuildContext context, String? title, String? message, double? duration}) {
// return Flushbar(
// flushbarPosition: FlushbarPosition.TOP,
// backgroundColor: AppColor.green70,
// title: title ?? "Hey Ninja",
// message: message ?? "Lorem Ipsum is simply dummy text of the printing and typesetting industry",
// duration: Duration(seconds: duration?.toInt() ?? 3),
// flushbarStyle: FlushbarStyle.GROUNDED,
// reverseAnimationCurve: Curves.easeInOut,
// mainButton: IconButton(
// onPressed: () {
// Navigator.pop(context);
// },
// icon: const Icon(
// Icons.close,
// color: AppColor.white20,
// ),
// ),
// )..show(context);
// }
// }