phoenix_widgets 1.5.1 phoenix_widgets: ^1.5.1 copied to clipboard
Phoenix library collections.
phoenix_widgets #
Phoenix Widgets is widget collections.
Getting Started #
In the pubspec.yaml
of your flutter project, add the following dependency:
dependencies:
...
phoenix_widgets: "^latestVersion"
Import it:
import 'package:phoenix_widgets/phoenix_widgets.dart';
PhoenixCard #
PhoenixCard is widget to create card
Usage Examples #
PhoenixCard(
title: Text(
"Title with Image",
style: Theme.of(context).textTheme.headline6,
),
description: Text(
"Description",
style: Theme.of(context).textTheme.bodyText2,
),
footer: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const CircleAvatar(backgroundColor: Colors.red),
const SizedBox(width: 8),
Text(
"Footer",
style: Theme.of(context).textTheme.headline6,
)
],
),
image: Image.network(
"https://images.contentstack.io/v3/assets/blt2a130c768c36b9df/blt5f384c7eb51e7cff/5f7d972ddf178b0ea98488e1/banner_sadaqah.jpg?auto=webp",
fit: BoxFit.cover,
),
onTap: () {},
),
Available Parameters #
Param | Type | isRequired | Default |
---|---|---|---|
image | Widget | No | |
title | Widget | Yes | |
description | Widget | Yes | |
footer | Widget | No | |
width | double | No | double.maxFinite |
padding | EdgeInsets | No | |
margin | EdgeInsets | No | const EdgeInsets.symmetric(horizontal: 16,vertical: 8) |
onTap | VoidCallback | No | |
backgroundColor | Color | No | Colors.white |
borderRadius | double | No | 4 |
PhoenixBottomMenu #
PhoenixBottomMenu is widget to create navigation bar
Usage Examples #
PhoenixBottomMenuUHF(
navBarItems: [
NavBarItem("Home", 'assets/tab_home.png'),
NavBarItem("Profile", 'assets/tab_profile.png'),
NavBarItem("Setting", 'assets/tab_setting.png'),
],
selectedTabColor: Colors.red, ///optional
unselectedTabColor: Colors.black54, ///optional
onTabChange: (index) {
setState(() {});
_tabController!.jumpToPage(index);
},
)
Available Parameters #
Param | Type | isRequired | Default |
---|---|---|---|
navBarItems | List | Yes | |
selectedTabColor | Color | No | Colors.red |
unselectedTabColor | Color | No | Colors.black54 |
onTabChange | Function | Yes |
PhoenixButton #
PhoenixButton is widget to create button
Usage Examples #
PhoenixButton(
///required
text: "Click Me !!",
///optional
buttonColour: Colors.red,
buttonElevation: 0.5,
textColour: Colors.white,
textScaleFactor: 1.0,
textAlign: TextAlign.center,
fontSize: 16.0,
fontWeight: FontWeight.bold,
radius: 10.0,
disableButtonColour: Colors.blue,
marginLeft: 10.0,
marginRight: 10.0,
marginTop: 10.0,
marginBottom: 10.0,
paddingTop: 10.0,
paddingBottom: 100.0,
paddingLeft: 10.0,
paddingRight: 10.0,
height: 100,
width: double.infinity,
onPressed: () {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text("Button Clicked"),
));
},
),
Available Parameters #
Param | Type | isRequired | Default |
---|---|---|---|
text | String | Yes | |
buttonColour | Color | No | Colors.red |
buttonElevation | Double | No | 0.0 |
textColour | Color | No | Colors.white |
textScaleFactor | Double | No | 1.0 |
textAlign | TextAlign | No | TextAlign.center |
fontSize | Double | No | 16.0 |
fontWeight | FontWeight | No | FontWeight.normal |
radius | Double | No | 0.0 |
disableButtonColour | Color | No | #67C1BF |
marginLeft | Double | No | |
marginRight | Double | No | |
marginTop | Double | No | |
marginBottom | Double | No | |
paddingTop | Double | No | |
paddingBottom | Double | No | |
paddingLeft | Double | No | |
paddingRight | Double | No | |
height | Double | No | |
width | Double | No | double.infinity |
onPressed | VoidCallback | No |
PhoenixProductTiles #
PhoenixProductTiles is a widget to create product tiles
Usage Examples #
PhoenixProductTiles(
onTap: (index) {},
items: [
PhoenixProductItem(
"Tile 1",
Image.asset(
"assets/tile_1.png",
width: 45,
height: 45,
)),
PhoenixProductItem(
"Tile 2",
Image.asset(
"assets/tile_2.png",
width: 45,
height: 45,
))
]
)
Available Parameters #
Param | Type | isRequired | Default |
---|---|---|---|
items | List | Yes | |
onTap | Function | Yes | |
crossAxisCount | int | No | 4 |
PhoenixGenericPopUp #
PhoenixGenericPopUp is a function to show popup dialog with two or one button
Usage Examples #
phoenixGenericPopUp(
///required
context: context,
popUpTitleWidget: Text(
'Pop Up Two Button Title',
),
popUpContentWidget: Text(
"This is Pop Up One Button Message, Lorem ipsum dolor sit amet, consectetur adipiscing elit",
),
///optional
ensureWidget: Text(
"Confirm",
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
cancelWidget: Text(
"Cancel",
style: TextStyle(
color: Colors.red,
),
),
//if type != 1 the popup will not dismiss when click confirm button
type: 1,
dismissOnOutsideTouch: false,
ensureCallback: () {
showSnackBar("Confirm Button Clicked");
},
cancelCallback: () {
showSnackBar("Cancel Button Clicked");
},
);
Available Parameters #
Param | Type | isRequired | Default |
---|---|---|---|
context | BuildContext | Yes | |
popUpTitleWidget | Widget | Yes | |
popUpContentWidget | Widget | Yes | |
ensureWidget | Widget | No | Confirm |
cancelWidget | Widget | No | |
type | int | No | 1 |
dismissOnOutsideTouch | bool | No | false |
ensureCallback | VoidCallback | No | |
cancelCallback | VoidCallback | No |
PhoenixWebview #
PhoenixWebview is a widget to create a webview
Usage Examples #
PhoenixWebview(url: "https://flutter.dev/", title: "Flutter Dev");
Available Parameters #
Param | Type | isRequired | Default |
---|---|---|---|
url | String | Yes | |
title | String | Yes |
PhoenixBackButton #
PhoenixBackButton is a widget to create back button
Usage Examples #
PhoenixBackButton();
Available Parameters #
Param | Type | isRequired | Default |
---|---|---|---|
color | Color | No | |
callback | VoidCallback | No |
PhoenixTitle #
PhoenixTitle is a widget to create title
Usage Examples #
PhoenixTitle(title: "Phoenix Title"));
Available Parameters #
Param | Type | isRequired | Default |
---|---|---|---|
title | String | Yes | |
fontSize | double | No | |
fontWeight | FontWeight | No | |
color | Color | No |
PhoenixEmptyPage #
PhoenixEmptyPage is a widget to create empty pages
Usage Examples #
PhoenixEmptyPage(
title: "No Data",
pageImage: Image.asset(
"assets/illustration.png",
),
textStyle: const TextStyle(
fontSize: 16.0,
color: Color(0xff212124),
),
)
Available Parameters #
Param | Type | isRequired | Default |
---|---|---|---|
title | String | Yes | |
pageImage | Widget | Yes | |
textStyle | TextStyle | No | fontSize: 16.0 |
color: Color(0xff212124) |
PhoenixExpandableContentBlock #
PhoenixExpandableContentBlock is a widget to create product tiles
Usage Examples #
PhoenixExpandableContentBlock(
text: "Flutter is Google’s portable UI toolkit. Visit https://flutter.dev to learn more.",
style: Theme.of(context).textTheme.bodyText2,
urls: [Url("https://flutter.dev", [47, 66])],
shortenButtonLabel: "[See less]",
expandButtonLabel: "[See more]"
)
Available Parameters #
Param | Type | isRequired | Default |
---|---|---|---|
text | List | Yes | |
style | TextStyle | Yes | |
urls | Url | No | |
shortenButtonLabel | String | Yes | |
expandButtonLabel | String | Yes | |
maxLines | int | No | 6 |
callback | VoidCallback | No |