Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/models/pad_button_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ import 'gestures.dart';
/// Model of one padd button.
class PadButtonItem {
/// [index] required parameter, the key to recognize button instance.
final int index;
final int? index;

/// [buttonText] optional parameter, the text to be displayed inside the
/// button. Omitted if [buttonImage] is set. Default value is empty string.
final String buttonText;
final String? buttonText;

/// [buttonImage] optional parameter, image which will be displayed inside
/// the button.
final Image buttonImage;
final Image? buttonImage;

/// [buttonIcon] optional parameter, image which will be displayed inside
/// the button.
final Icon buttonIcon;
final Icon? buttonIcon;

/// [backgroundColor] color of button in default state.
final Color backgroundColor;
final Color? backgroundColor;

/// [pressedColor] color of button when it is pressed.
final Color pressedColor;
final Color? pressedColor;

/// [supportedGestures] optional parameter, list of gestures for button which
/// will call the callback [PadButtonsView.padButtonPressedCallback].
Expand Down
49 changes: 26 additions & 23 deletions lib/views/circle_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class CircleView extends StatelessWidget {
final double size;
final double? size;

final Color color;
final Color? color;

final List<BoxShadow> boxShadow;
final List<BoxShadow>? boxShadow;

final Border border;
final Border? border;

final double opacity;
final double? opacity;

final Image buttonImage;
final Image? buttonImage;

final Icon buttonIcon;
final Icon? buttonIcon;

final String buttonText;
final String? buttonText;

CircleView({
this.size,
Expand All @@ -34,19 +34,22 @@ class CircleView extends StatelessWidget {
return Container(
width: size,
height: size,
child: Center(
child: buttonIcon != null
? buttonIcon
: (buttonImage != null)
? buttonImage
: (buttonText != null) ? Text(buttonText) : null,
),
decoration: BoxDecoration(
color: color,
shape: BoxShape.circle,
border: border,
boxShadow: boxShadow,
),
child: Center(
// ignore: prefer_if_null_operators
child: buttonIcon != null
? buttonIcon
: (buttonImage != null)
? buttonImage
: (buttonText != null)
? Text(buttonText!)
: null,
),
);
}

Expand Down Expand Up @@ -85,9 +88,9 @@ class CircleView extends StatelessWidget {
],
);

factory CircleView.padBackgroundCircle(
double size, Color backgroundColour, borderColor, Color shadowColor,
{double opacity}) =>
factory CircleView.padBackgroundCircle(double? size, Color? backgroundColour,
borderColor, Color? shadowColor,
{double? opacity}) =>
CircleView(
size: size,
color: backgroundColour,
Expand All @@ -99,7 +102,7 @@ class CircleView extends StatelessWidget {
),
boxShadow: <BoxShadow>[
BoxShadow(
color: shadowColor,
color: shadowColor!,
spreadRadius: 8.0,
blurRadius: 8.0,
)
Expand All @@ -108,10 +111,10 @@ class CircleView extends StatelessWidget {

factory CircleView.padButtonCircle(
double size,
Color color,
Image image,
Icon icon,
String text,
Color? color,
Image? image,
Icon? icon,
String? text,
) =>
CircleView(
size: size,
Expand Down
Loading