basf_flutter_components 2.0.0 basf_flutter_components: ^2.0.0 copied to clipboard
A collection of BASF Style components such as Buttons, Theming, etc...
basf_flutter_components #
Generated by the Very Good CLI 🤖
A BASF Flutter components library for Flutter
Installing #
Add BASF Flutter Components to your pubspec.yaml file:
dependencies:
basf_flutter_components:
Import the library into your .dart
file:
import 'package:basf_flutter_components/basf_flutter_components.dart';
Use your IDE IntelliSense to import any of the Components built into the library
BASF Flutter Components #
-
Theme #
Themes
theme: BasfThemes.lightMainTheme(BasfThemeType.darkBlue),
/// etc...
Colors
BasfColors.red,
/// etc...
Fonts
Theme.of(context).textTheme.headline1!,
// headline2
// headline3
// headline4
// headline5
// headline6
// bodyText1
// bodyText2
// subtitle1
// subtitle2
// caption
// button
// overline
-
Widgets #
AppSnackBar
AppSnackBar.info(message: 'Button pressed').show(context);
// or
AppSnackBar.error(message: 'Button pressed').show(context);
BasfTextButton
BasfTextButton.contained(
text: 'Styled Button',
onPressed: () => _onPressed(context),
style: TextButton.styleFrom(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0)),
backgroundColor: BasfColors.red,
),
),
// or
BasfTextButton.transparent(
context: context,
text: 'Expanded Button',
expanded: true,
onPressed: () => _onPressed(context),
),
// or
BasfTextButton.hint(
context: context,
text: 'Hint Button',
onPressed: () => _onPressed(context),
),
OutlinedButton
BasfOutlinedButton(
text: 'Outlined Buttons',
onPressed: () { /* --- */ },
);
TransparentButton
BasfTextButton.transparent(
context: context,
text: 'Only Text',
onPressed: () => _onPressed(context),
),
SliderButton
SliderButton(
text: 'Basf Slider button',
onConfirmation: () {},
),
Dialogs
BasfTextButton.contained(
text: 'Text',
onPressed: () {
showDialog<void>(
context: context,
builder: (context) {
return const BasfAlertDialog(
title: 'Title',
description: 'Body Text',
confirmText: 'Confirm Text',
dismissText: 'Dismiss Text',
//onlyConfirm: true, // Optional to hide red text
);
},
);
},
);
Text fields
BasfTextField(
decoration: const InputDecoration(
hintText: 'Enabled',
),
controller: _enabledController,
),
Dropdown
BasfDropDownInput(
controller: TextEditingController(),
values: const ['Option1', 'Option2', 'Option3'],
),
Radio
RadioOptions(
title: 'BASF Radio',
selectedValue: selectedValue,
labelGenerator: (o) => '$o',
values: values,
onSelected: (value) {
setState(() => selectedValue = value.toString());
},
),
CheckBox
BasfCheckbox(
value: selected, // Update this
onChanged: change,
// reverse: true, Optional
),
Icons
Icon(BasfIcons.add),
// or
Icon(BasfIconsData(code /* e842 */)),
-
Animations #
-
Fade
-
Fade(
visible: value, // Update this value
child: Text('Sup'),
);
You can find how to use all of this components at the example project