mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 08:14:55 +00:00
Added loading and success icons to login button
This commit is contained in:
@ -1,24 +1,27 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
class DefaultTextButton extends StatelessWidget {
|
||||
const DefaultTextButton({
|
||||
class DefaultButton extends StatelessWidget {
|
||||
const DefaultButton({
|
||||
super.key,
|
||||
this.enabled = true,
|
||||
this.onPressed,
|
||||
required this.text,
|
||||
this.child,
|
||||
this.isSecondary = false,
|
||||
this.text,
|
||||
});
|
||||
|
||||
final void Function()? onPressed;
|
||||
final String text;
|
||||
final Widget? child;
|
||||
|
||||
final String? text;
|
||||
final bool isSecondary;
|
||||
|
||||
final bool enabled;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return TextButton(
|
||||
return ElevatedButton(
|
||||
onPressed: enabled ? onPressed : null,
|
||||
style: isSecondary
|
||||
? null
|
||||
@ -31,15 +34,18 @@ class DefaultTextButton extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
color: isSecondary
|
||||
? Colors.black
|
||||
: enabled
|
||||
? Colors.white
|
||||
: Colors.black),
|
||||
),
|
||||
child: text != null
|
||||
? Text(
|
||||
text!,
|
||||
style: TextStyle(
|
||||
color: isSecondary
|
||||
? Colors.black
|
||||
: enabled
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
),
|
||||
)
|
||||
: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user