fix issues
parent
79103a5c84
commit
4b89b78ab4
@ -1,16 +1,15 @@
|
||||
// import 'package:firebase_analytics/firebase_analytics.dart';
|
||||
// import 'package:firebase_analytics/observer.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:firebase_analytics/firebase_analytics.dart';
|
||||
import 'package:firebase_analytics/observer.dart';
|
||||
|
||||
class AnalyticsService {
|
||||
// final FirebaseAnalytics _analytics = FirebaseAnalytics();
|
||||
//
|
||||
// FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: _analytics);
|
||||
//
|
||||
final FirebaseAnalytics _analytics = FirebaseAnalytics();
|
||||
|
||||
FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: _analytics);
|
||||
|
||||
Future logEvent({required String eventCategory, required String eventAction}) async {
|
||||
// await _analytics.logEvent(name: 'event', parameters: {
|
||||
// "eventCategory": eventCategory,
|
||||
// "eventAction": eventAction,
|
||||
// });
|
||||
await _analytics.logEvent(name: 'event', parameters: {
|
||||
"eventCategory": eventCategory,
|
||||
"eventAction": eventAction,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,78 +1,26 @@
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
|
||||
class DrAppToastMsg {
|
||||
void showLongToast(msg) {
|
||||
FlutterFlexibleToast.showToast(
|
||||
message: msg,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
);
|
||||
}
|
||||
|
||||
static void showSuccesToast(msg) {
|
||||
FlutterFlexibleToast.showToast(
|
||||
message: msg,
|
||||
Fluttertoast.showToast(
|
||||
msg: msg,
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.TOP,
|
||||
// timeInSecForIosWeb: timeInSeconds,
|
||||
backgroundColor: Colors.green,
|
||||
icon: ICON.SUCCESS,
|
||||
fontSize: 16,
|
||||
imageSize: 35,
|
||||
textColor: Colors.white);
|
||||
textColor: Colors.white,
|
||||
fontSize: 16);
|
||||
}
|
||||
|
||||
static void showErrorToast(msg) {
|
||||
FlutterFlexibleToast.showToast(
|
||||
message: msg,
|
||||
Fluttertoast.showToast(
|
||||
msg: msg,
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
toastGravity: ToastGravity.TOP,
|
||||
gravity: ToastGravity.TOP,
|
||||
backgroundColor: Colors.red,
|
||||
icon: ICON.CLOSE,
|
||||
fontSize: 16,
|
||||
imageSize: 35,
|
||||
timeInSeconds: 912,
|
||||
textColor: Colors.white);
|
||||
}
|
||||
|
||||
static void showShortToast(msg) {
|
||||
FlutterFlexibleToast.showToast(
|
||||
message: msg,
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
icon: ICON.INFO,
|
||||
timeInSeconds: 1);
|
||||
}
|
||||
|
||||
static void showTopShortToast(msg) {
|
||||
FlutterFlexibleToast.showToast(
|
||||
message: msg,
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
toastGravity: ToastGravity.TOP,
|
||||
icon: ICON.WARNING,
|
||||
timeInSeconds: 1);
|
||||
}
|
||||
|
||||
static void showCenterShortToast(msg) {
|
||||
FlutterFlexibleToast.showToast(
|
||||
message: msg,
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
toastGravity: ToastGravity.CENTER,
|
||||
icon: ICON.WARNING,
|
||||
timeInSeconds: 1);
|
||||
}
|
||||
|
||||
static void showCenterShortLoadingToast(msg) {
|
||||
FlutterFlexibleToast.showToast(
|
||||
message: msg,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
toastGravity: ToastGravity.BOTTOM,
|
||||
icon: ICON.LOADING,
|
||||
radius: 20,
|
||||
elevation: 10,
|
||||
textColor: Colors.white,
|
||||
|
||||
timeInSeconds: 2);
|
||||
}
|
||||
|
||||
static void cancelToast(msg) {
|
||||
FlutterFlexibleToast.cancel();
|
||||
fontSize: 16);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue