Skip to content

Commit

Permalink
Merge branch 'Changing_grpc' into change_app_name
Browse files Browse the repository at this point in the history
# Conflicts:
#	lib/presentation/atoms/atoms.dart
#	lib/presentation/pages/splash_page.dart
#	pubspec.yaml
  • Loading branch information
guyluz11 committed Dec 29, 2023
2 parents 26bf36e + 264ff48 commit e0a77e0
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/presentation/atoms/atoms.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export 'bottom_navigation_bar_item_atom.dart';
export 'card_atom.dart';
export 'button_atom.dart';
export 'circular_progress_indicator_atom.dart';
export 'icon_atom.dart';
export 'image_atom.dart';
Expand Down
69 changes: 69 additions & 0 deletions lib/presentation/atoms/button_atom.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import 'package:cybear_jinni/presentation/atoms/atoms.dart';
import 'package:flutter/material.dart';

class ButtonWidgetAtom extends StatelessWidget {
const ButtonWidgetAtom({
required this.variant,
required this.onPressed,
super.key,
this.text,
this.icon,
this.disabled = false,
this.disableActionType = false,
this.translate = true,
});

final ButtonVariant variant;
final VoidCallback onPressed;
final String? text;
final IconData? icon;
double get width => 250;
double get _height => 60;
final bool disabled;
final bool translate;
final bool disableActionType;

@override
Widget build(BuildContext context) {
final ThemeData themeData = Theme.of(context);
final TextTheme textTheme = themeData.textTheme;
final ColorScheme colorScheme = themeData.colorScheme;

if (variant == ButtonVariant.primary) {
return Container(
constraints: const BoxConstraints(
minWidth: 300,
),
height: _height,
child: FilledButton.icon(
onPressed: onPressed,
style: FilledButton.styleFrom().copyWith(
alignment: Alignment.center,
backgroundColor: disabled
? MaterialStateProperty.all(colorScheme.surfaceVariant)
: null,
),
icon: Icon(icon),
label: TextAtom(
text ?? '',
translate: translate,
maxLines: 1,
style: textTheme.bodyLarge!.copyWith(
color: colorScheme.onPrimary,
),
),
),
);
}
return const Text('Type is not supported yet');
}
}

enum ButtonVariant {
primary,
secondary,
tertiary,
action,
actionToggled,
back,
}
5 changes: 5 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ flutter:
uses-material-design: true
assets:
- assets/
- assets/symbols/
- assets/translations/
- assets/gif/

fonts:
- family: gidole_regular
Expand Down Expand Up @@ -70,6 +72,8 @@ dependencies:
sdk: flutter
# HSV(HSB)/HSL/RGB/Material color picker
flutter_colorpicker: ^1.0.3
# A cross platform plugin for displaying local notifications.
flutter_local_notifications: ^16.1.0
# An easy to implement custom switch
flutter_switch: ^0.3.2
# Getting the local timezone of the os.
Expand All @@ -81,6 +85,7 @@ dependencies:
# Service locator
get_it: ^7.6.4
# Google Mobile Ads
google_mobile_ads: ^3.1.0
# Secure authentication system for signing in with a Google account on Android and iOS
# google_sign_in: ^5.0.4
# A high performance, open source, general RPC framework that puts mobile and HTTP/2 first.
Expand Down

0 comments on commit e0a77e0

Please sign in to comment.