x_constants 0.0.1
x_constants: ^0.0.1 copied to clipboard
A Flutter package with a conveniently designed common constants for Flutter projects
A Flutter package with a conveniently designed common constants for Flutter projects.
At the moment includes 4 types of constants:
- Border
- Duration
- Padding
- Spacing
Features #
Getting started #
In the pubspec.yaml of your flutter project, add the following dependency:
dependencies:
x_constants: ^0.0.1
Import it:
import 'package:x_constants/x_constants.dart';
Usage #
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
decoration: const BoxDecoration(
borderRadius: XBorder.all16,
color: Colors.yellow,
),
child: const Padding(
padding: XPadding.all16,
child: Text('Text 1'),
),
),
XSpacing.vertical16,
const Padding(
padding: XPadding.all16,
child: Text('Text 2'),
),
],
);
}
Additional information #
Feel free to raise a PR, but make sure that new constants are commonly used.