Skip to content

Commit

Permalink
refactor: add common mixin standard app widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
mediocre9 committed Jul 4, 2023
1 parent 7125f1f commit cce1b25
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions lib/widgets/common.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import 'package:flutter/material.dart';
import '../config/strings/app_strings.dart';

mixin StandardAppWidgets {
void showAboutDialogWidget(
BuildContext context, MediaQueryData mediaQuery, ThemeData theme) {
return showAboutDialog(
context: context,
applicationName: AppString.kAppName,
applicationVersion: AppString.kAppVersion,
applicationIcon: Image.asset(
'assets/images/logo.png',
width: mediaQuery.size.width / 5,
),
children: [
Text(
AppString.kCopyrightStatement,
style: theme.textTheme.labelMedium,
),
],
);
}

void showSnackBarWidget(BuildContext context, String message,
{Color? color}) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(message),
backgroundColor: color,
),
);
}
}

0 comments on commit cce1b25

Please sign in to comment.