Updated widgets
This commit is contained in:
parent
78259a6f7e
commit
5ee5902524
4 changed files with 28 additions and 45 deletions
|
|
@ -14,11 +14,11 @@ class BoxWidget extends StatelessWidget {
|
||||||
padding: EdgeInsets.all(16),
|
padding: EdgeInsets.all(16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
color: Color.fromARGB(149, 16, 22, 28),
|
color: Color.fromRGBO(16, 22, 28, 0.584),
|
||||||
border: Border.all(color: const Color.fromRGBO(32, 47, 61, 1)),
|
border: Border.all(color: const Color.fromRGBO(32, 47, 61, 1)),
|
||||||
),
|
),
|
||||||
width: MediaQuery.of(context).size.width - 100,
|
width: MediaQuery.of(context).size.width - 30,
|
||||||
height: MediaQuery.of(context).size.height / 2.2,
|
// height: MediaQuery.of(context).size.height / 2.2,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
|
|
||||||
|
|
@ -1,53 +1,33 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
|
||||||
|
|
||||||
class ButtonWidget extends StatelessWidget {
|
class ButtonWidget extends StatelessWidget {
|
||||||
final String text;
|
final String text;
|
||||||
final VoidCallback onPressed;
|
final VoidCallback? onPressed;
|
||||||
final bool? outline;
|
|
||||||
final double? width;
|
final double? width;
|
||||||
|
final bool disabled;
|
||||||
|
|
||||||
const ButtonWidget({super.key, required this.text, required this.onPressed, this.outline, this.width});
|
const ButtonWidget({super.key, required this.text, this.onPressed, this.width, required this.disabled});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ElevatedButton(
|
return ElevatedButton(
|
||||||
style: outline == true
|
style: ElevatedButton.styleFrom(
|
||||||
? OutlinedButton.styleFrom(
|
foregroundColor: const Color.fromRGBO(250, 250, 250, 1), // text color
|
||||||
foregroundColor: const Color.fromRGBO(0, 0, 0, 1),
|
backgroundColor: disabled ? const Color.fromARGB(112, 13, 109, 253) : const Color(0xff0d6efd),
|
||||||
backgroundColor: Colors.transparent,
|
elevation: disabled ? 0 : 4,
|
||||||
side: const BorderSide(color: Color.fromRGBO(198, 133, 232, 1)),
|
shape: RoundedRectangleBorder(
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
|
borderRadius: BorderRadius.circular(8), // rounded corners
|
||||||
minimumSize: Size(
|
),
|
||||||
MediaQuery.of(context).size.width <= 768 ? MediaQuery.of(context).size.width - 96 : 320,
|
minimumSize: Size(
|
||||||
44,
|
width ?? (MediaQuery.of(context).size.width <= 768 ? MediaQuery.of(context).size.width - 96 : 320),
|
||||||
),
|
44,
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16),
|
),
|
||||||
)
|
|
||||||
: ElevatedButton.styleFrom(
|
|
||||||
foregroundColor: const Color.fromRGBO(0, 0, 0, 1), // text color
|
|
||||||
backgroundColor: const Color.fromRGBO(198, 133, 232, 1),
|
|
||||||
side: const BorderSide(color: Color.fromRGBO(79, 51, 94, 0.4)), // border color
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(20), // rounded corners
|
|
||||||
),
|
|
||||||
minimumSize: Size(
|
|
||||||
width ?? (MediaQuery.of(context).size.width <= 768 ? MediaQuery.of(context).size.width - 96 : 320),
|
|
||||||
44,
|
|
||||||
),
|
|
||||||
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16),
|
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16),
|
||||||
),
|
),
|
||||||
onPressed: onPressed,
|
onPressed: onPressed,
|
||||||
child: Text(text, style: _textStyle(outline)),
|
child: TextWidget(text: text, size: 16),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextStyle _textStyle(bool? outline) {
|
|
||||||
if (outline == true) {
|
|
||||||
return GoogleFonts.roboto(textStyle: const TextStyle(fontSize: 14, color: Color.fromRGBO(198, 133, 232, 1)));
|
|
||||||
} else {
|
|
||||||
return GoogleFonts.roboto(textStyle: const TextStyle(fontSize: 14, color: Color.fromRGBO(0, 0, 0, 1)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,20 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gap/gap.dart';
|
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
|
||||||
class InputWidget extends StatelessWidget {
|
class InputWidget extends StatelessWidget {
|
||||||
final TextEditingController controller;
|
final TextEditingController controller;
|
||||||
final String placeholder;
|
final String? placeholder;
|
||||||
|
final bool password;
|
||||||
|
|
||||||
const InputWidget({super.key, required this.controller, required this.placeholder});
|
const InputWidget({super.key, required this.controller, this.placeholder, required this.password});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return TextField(
|
return TextField(
|
||||||
controller: controller,
|
controller: controller,
|
||||||
|
obscureText: password,
|
||||||
|
enableSuggestions: !password,
|
||||||
|
autocorrect: !password,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: const Color.fromRGBO(255, 255, 255, 1),
|
fillColor: const Color.fromRGBO(255, 255, 255, 1),
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ class MenuWidget extends StatelessWidget {
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
color: Color.fromARGB(149, 16, 22, 28),
|
color: Color.fromARGB(149, 16, 22, 28),
|
||||||
border: Border.all(color: const Color(0xff202f3d)),
|
border: Border.all(color: const Color.fromRGBO(32, 47, 61, 1)),
|
||||||
),
|
),
|
||||||
width: 120,
|
width: 120,
|
||||||
height: 120,
|
height: 120,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue