create static method
AppBarGeneralFrameworkWidget
create({
- Key? key,
- required Widget? leadingBuilder(
- BuildContext context,
- Widget? child
- required BuildContext context,
- required String title,
- DecorationBuilderGeneralFrameworkWidget? decorationBuilder,
- required GeneralLibFlutterStatefulWidget<
StatefulWidget> pageState, - bool isAddChangeTheme = true,
- bool isHideAppBarContent = false,
- required bool isShowApplicationIconAndtitle,
- required bool isApplicationFullScreen,
- required String applicationTitle,
- required dynamic applicationIcon,
- Widget? backIcon,
- required GeneralLibFlutterApp generalLibFlutterApp,
- required Iterable<
Widget> actions(- BuildContext context,
- GeneralLibFlutterStatefulWidget<
StatefulWidget> pageState
- required Iterable<
Widget> builder(- BuildContext context,
- GeneralLibFlutterStatefulWidget<
StatefulWidget> pageState
- required Widget appBarBuilder(
- BuildContext context,
- Widget appBar
Implementation
static AppBarGeneralFrameworkWidget create({
Key? key,
required Widget? Function(BuildContext context, Widget? child)
leadingBuilder,
required BuildContext context,
required String title,
DecorationBuilderGeneralFrameworkWidget? decorationBuilder,
required GeneralLibFlutterStatefulWidget pageState,
bool isAddChangeTheme = true,
bool isHideAppBarContent = false,
required bool isShowApplicationIconAndtitle,
required bool isApplicationFullScreen,
required String applicationTitle,
required dynamic applicationIcon,
Widget? backIcon,
required GeneralLibFlutterApp generalLibFlutterApp,
required Iterable<Widget> Function(
BuildContext context, GeneralLibFlutterStatefulWidget pageState)
actions,
required Iterable<Widget> Function(
BuildContext context, GeneralLibFlutterStatefulWidget pageState)
builder,
required Widget Function(BuildContext context, Widget appBar) appBarBuilder,
}) {
return AppBarGeneralFrameworkWidget.raw(
key: key,
context: context,
isShowApplicationIconAndtitle: isShowApplicationIconAndtitle,
decorationBuilder: decorationBuilder,
pageState: pageState,
isApplicationFullScreen: isApplicationFullScreen,
applicationIcon: applicationIcon,
applicationTitle: applicationTitle,
generalLibFlutterApp: generalLibFlutterApp,
builder: (context, GeneralLibFlutterStatefulWidget pageState) sync* {
if (isHideAppBarContent == false) {
yield appBarBuilder(
context,
MediaQuery.removePadding(
context: context,
removeBottom: true,
removeLeft: true,
removeRight: true,
removeTop: true,
child: AppBar(
centerTitle: true,
leading: () {
return leadingBuilder(context, () {
if (context.navigator().canPop()) {
return backButtonWidget(
context: context,
generalLibFlutterStatefulWidget: pageState,
backIcon: backIcon ?? const Icon(Icons.arrow_back),
onPressed: () {
context.navigator().pop();
},
);
}
return null;
}());
}(),
title: SkeletonizerGeneralFramework(
enabled: pageState.isLoading,
child: Text(
title,
style: context.theme.textTheme.titleLarge,
),
),
actions: [
if (isAddChangeTheme) ...[
SkeletonizerGeneralFramework(
enabled: pageState.isLoading,
child: AppBarGeneralFrameworkWidget.themeChangeWidget(
generalLibFlutterApp: generalLibFlutterApp,
),
),
],
for (final element in actions(context, pageState)) ...[
element,
]
],
),
),
);
}
yield* builder(context, pageState);
return;
},
);
}