x_message

Creator: coderz1093

Last updated:

0 purchases

x_message Image
x_message Images
Add to Cart

Description:

x message

x_message #
Show Toast, Message and Loading in Flutter.



Installation #
dependencies:
x_message: ^0.1.0
copied to clipboard
Usage #
Import #
import 'package:x_message/x_message.dart';
// Or
import 'package:x_message/src/toast.dart';
import 'package:x_message/src/message.dart';
import 'package:x_message/src/loading.dart';
copied to clipboard
Basic usage #
Toast
Toast(
context: context,
message: 'Toast',
);
copied to clipboard
Change the styles of Toast.
Toast(
context: context,
message: 'Toast',
position: ToastPosition.center,
padding: const EdgeInsets.all(5),
fontSize: 16,
color: Colors.blue,
backgroundColor: Colors.white,
border: Border.all(
color: Colors.blue,
width: 1,
),
borderRadius: 8,
);
copied to clipboard
Set default styles of Toast.
Toast.defaultToEdge = 40;
Toast.defaultPosition = ToastPosition.center;
Toast.defaultDuration = const Duration(seconds: 2);
Toast.defaultPadding = const EdgeInsets.all(20);
Toast.defaultFontSize = 16;
Toast.defaultColor = Colors.grey;
Toast.defaultBackgroundColor = Colors.black;
Toast.defaultBorder = Border.all(
color: Colors.black,
width: 0.5,
);
Toast.defaultBorderRadius = 7;
copied to clipboard
Reset default styles of Toast.
// Toast.reset();
Toast.resetDefaultToEdge();
Toast.resetDefaultPosition();
Toast.resetDefaultDuration();
Toast.resetDefaultPadding();
Toast.resetDefaultFontSize();
Toast.resetDefaultColor();
Toast.resetDefaultBackgroundColor();
Toast.resetDefaultBorder();
Toast.resetDefaultBorderRadius();
copied to clipboard
Set your own child of Toast.
Toast(
context: context,
child: const Icon(Icons.ac_unit),
);
copied to clipboard
Message
Message(
context: context,
message: 'Message',
);
copied to clipboard
Change the styles of Message.
Message(
context: context,
message: 'Message',
width: 400,
spacer: 20,
duration: const Duration(seconds: 15),
padding: const EdgeInsets.all(15),
fontSize: 17,
textAlign: TextAlign.center,
overflow: TextOverflow.clip,
softWrap: true,
color: Colors.grey,
backgroundColor: Colors.black,
border: Border.all(
color: Colors.black,
width: 0.5,
),
borderRadius: 7,
// showClose: false,
close: const Icon(
Icons.ac_unit,
color: Colors.grey,
),
);
copied to clipboard
Set default styles of Message.
Message.defaultWidth = 400;
Message.defaultSpacer = 20;
Message.defaultDuration = const Duration(seconds: 15);
Message.defaultPadding = const EdgeInsets.all(15);
Message.defaultFontSize = 17;
Message.defaultTextAlign = TextAlign.center;
Message.defaultOverFlow = TextOverflow.clip;
Message.defaultSoftWrap = true;
Message.defaultColor = Colors.grey;
Message.defaultBackgroundColor = Colors.black;
Message.defaultBorder = Border.all(
color: Colors.black,
width: 0.5,
);
Message.defaultBorderRadius = 7;
// Message.defaultShowClose = false;
Message.defaultClose = const Icon(
Icons.ac_unit,
color: Colors.grey,
);
copied to clipboard
Reset default styles of Message.
// Message.reset();
Message.resetDefaultWidth();
Message.resetDefaultSpacer();
Message.resetDefaultDuration();
Message.resetDefaultPadding();
Message.resetDefaultFontSize();
Message.resetDefaultTextAlign();
Message.resetDefaultOverFlow();
Message.resetDefaultSoftWrap();
Message.resetDefaultColor();
Message.resetDefaultBackgroundColor();
Message.resetDefaultBorder();
Message.resetDefaultBorderRadius();
Message.resetDefaultShowClose();
Message.resetDefaultClose();
copied to clipboard
Set your own child of Message.
late Message message;
message = Message(
context: context,
child: Row(
children: [
const Text('Message'),
MaterialButton(
onPressed: () {
message.remove();
},
child: const Text('remove'),
),
],
),
);
copied to clipboard
Loading
final loading = Loading(
context: context,
);
loading.show();
await Future.delayed(const Duration(seconds: 2));
loading.hide();
copied to clipboard
Change the styles of Loading.
final loading = Loading(
context: context,
child: const Icon(Icons.ac_unit),
backgroundColor: Colors.black12,
);
loading.show();
await Future.delayed(const Duration(seconds: 2));
loading.hide();
copied to clipboard
Set default styles of Loading.
Loading.defaultIcon = const Icon(Icons.ac_unit);
Loading.defaultBackgroundColor = Colors.black12;
copied to clipboard
Reset default styles of Loading.
// Loading.reset();
Loading.resetDefaultIcon();
Loading.resetDefaultBackgroundColor();
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.