first commit
This commit is contained in:
53
lib/app/setup_snackbar_ui.dart
Normal file
53
lib/app/setup_snackbar_ui.dart
Normal file
@ -0,0 +1,53 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stacked_services/stacked_services.dart';
|
||||
|
||||
import 'app.locator.dart';
|
||||
import 'enum/snackbar_enum.dart';
|
||||
|
||||
void setupSnackbarUi() {
|
||||
final service = locator<SnackbarService>();
|
||||
|
||||
service.registerCustomSnackbarConfig(
|
||||
variant: SnackbarType.sukses,
|
||||
config: SnackbarConfig(
|
||||
backgroundColor: Colors.black.withOpacity(.5),
|
||||
textColor: Colors.green,
|
||||
borderRadius: 50,
|
||||
icon: Icon(
|
||||
Icons.check,
|
||||
color: Colors.green,
|
||||
),
|
||||
snackPosition: SnackPosition.TOP,
|
||||
margin: EdgeInsets.all(10),
|
||||
),
|
||||
);
|
||||
|
||||
service.registerCustomSnackbarConfig(
|
||||
variant: SnackbarType.gagal,
|
||||
config: SnackbarConfig(
|
||||
backgroundColor: Colors.black.withOpacity(.5),
|
||||
textColor: Colors.red,
|
||||
borderRadius: 50,
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: Colors.red,
|
||||
),
|
||||
snackPosition: SnackPosition.TOP,
|
||||
margin: EdgeInsets.all(10),
|
||||
),
|
||||
);
|
||||
service.registerCustomSnackbarConfig(
|
||||
variant: SnackbarType.info,
|
||||
config: SnackbarConfig(
|
||||
backgroundColor: Colors.black.withOpacity(.5),
|
||||
textColor: Colors.blue,
|
||||
borderRadius: 50,
|
||||
icon: Icon(
|
||||
Icons.info,
|
||||
color: Colors.blue,
|
||||
),
|
||||
snackPosition: SnackPosition.TOP,
|
||||
margin: EdgeInsets.all(10),
|
||||
),
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user