72 lines
2.0 KiB
Dart
72 lines
2.0 KiB
Dart
part of 'widgets.dart';
|
|
|
|
mixin Template {
|
|
PreferredSizeWidget buildAppBar(
|
|
String title,
|
|
BuildContext context,
|
|
dynamic Function()? backAction,
|
|
) {
|
|
final theme = FlutterFlowTheme.of(context);
|
|
return AppBar(
|
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
|
automaticallyImplyLeading: false,
|
|
title: Text(
|
|
title,
|
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
|
fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily,
|
|
color: FlutterFlowTheme.of(context).primaryText,
|
|
fontSize: 16.0,
|
|
fontWeight: FontWeight.bold,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
FlutterFlowTheme.of(context).headlineMediumFamily),
|
|
),
|
|
),
|
|
leading: _backButton(context, theme, backAction),
|
|
centerTitle: true,
|
|
elevation: 0.0,
|
|
actions: [],
|
|
);
|
|
}
|
|
|
|
Widget _backButton(BuildContext context, FlutterFlowTheme theme,
|
|
dynamic Function()? onPressed) {
|
|
return FlutterFlowIconButton(
|
|
key: ValueKey<String>('BackNavigationAppBar'),
|
|
borderColor: Colors.transparent,
|
|
borderRadius: 30.0,
|
|
borderWidth: 1.0,
|
|
buttonSize: 60.0,
|
|
icon: Icon(
|
|
Icons.keyboard_arrow_left,
|
|
color: theme.primaryText,
|
|
size: 30.0,
|
|
),
|
|
onPressed: onPressed,
|
|
);
|
|
}
|
|
}
|
|
|
|
/// [PageWidget]
|
|
|
|
abstract class PageWidget<T> extends Widget {
|
|
const PageWidget({super.key});
|
|
}
|
|
|
|
abstract class ModelPage<T> extends ModelWidget implements PageWidget<T> {
|
|
const ModelPage({super.key});
|
|
}
|
|
|
|
abstract class StatelessPage<T> extends StatelessWidget
|
|
with Template
|
|
implements PageWidget<T> {
|
|
const StatelessPage({super.key});
|
|
}
|
|
|
|
abstract class StatefulPage<T> extends StatefulWidget implements PageWidget<T> {
|
|
const StatefulPage({super.key});
|
|
}
|
|
|
|
abstract class PageState<T extends StatefulPage> extends State<T>
|
|
with Template {}
|