Added widgets
This commit is contained in:
parent
4fdcc89c9d
commit
126cf6e905
4 changed files with 122 additions and 9 deletions
35
lib/widgets/box_widget.dart
Normal file
35
lib/widgets/box_widget.dart
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:gap/gap.dart';
|
||||||
|
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
|
||||||
|
|
||||||
|
class BoxWidget extends StatelessWidget {
|
||||||
|
final String title;
|
||||||
|
final Widget content;
|
||||||
|
|
||||||
|
const BoxWidget({super.key, required this.title, required this.content});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.all(16),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
color: Color.fromARGB(149, 16, 22, 28),
|
||||||
|
border: Border.all(color: const Color.fromRGBO(32, 47, 61, 1)),
|
||||||
|
),
|
||||||
|
width: MediaQuery.of(context).size.width - 100,
|
||||||
|
height: MediaQuery.of(context).size.height / 2.2,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [TextWidget(text: title, bold: true, size: 24)],
|
||||||
|
),
|
||||||
|
const Gap(16),
|
||||||
|
Padding(padding: const EdgeInsets.all(16), child: content),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
53
lib/widgets/button_widget.dart
Normal file
53
lib/widgets/button_widget.dart
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
|
||||||
|
class ButtonWidget extends StatelessWidget {
|
||||||
|
final String text;
|
||||||
|
final VoidCallback onPressed;
|
||||||
|
final bool? outline;
|
||||||
|
final double? width;
|
||||||
|
|
||||||
|
const ButtonWidget({super.key, required this.text, required this.onPressed, this.outline, this.width});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ElevatedButton(
|
||||||
|
style: outline == true
|
||||||
|
? OutlinedButton.styleFrom(
|
||||||
|
foregroundColor: const Color.fromRGBO(0, 0, 0, 1),
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
side: const BorderSide(color: Color.fromRGBO(198, 133, 232, 1)),
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
|
||||||
|
minimumSize: Size(
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
onPressed: onPressed,
|
||||||
|
child: Text(text, style: _textStyle(outline)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
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)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
25
lib/widgets/input_widget.dart
Normal file
25
lib/widgets/input_widget.dart
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:gap/gap.dart';
|
||||||
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
|
||||||
|
class InputWidget extends StatelessWidget {
|
||||||
|
final TextEditingController controller;
|
||||||
|
final String placeholder;
|
||||||
|
|
||||||
|
const InputWidget({super.key, required this.controller, required this.placeholder});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return TextField(
|
||||||
|
controller: controller,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
filled: true,
|
||||||
|
fillColor: const Color.fromRGBO(255, 255, 255, 1),
|
||||||
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(4)),
|
||||||
|
contentPadding: const EdgeInsets.symmetric(vertical: 0, horizontal: 14),
|
||||||
|
hintText: placeholder,
|
||||||
|
),
|
||||||
|
style: GoogleFonts.roboto(textStyle: const TextStyle(color: Color.fromRGBO(0, 0, 0, 1), fontSize: 16)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,12 +2,12 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
|
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
|
||||||
|
|
||||||
class CircleWidget extends StatelessWidget {
|
class MenuWidget extends StatelessWidget {
|
||||||
final IconData? icon;
|
final IconData? icon;
|
||||||
final String text;
|
final String text;
|
||||||
final VoidCallback onPressed;
|
final VoidCallback onPressed;
|
||||||
|
|
||||||
const CircleWidget({super.key, required this.icon, required this.text, required this.onPressed});
|
const MenuWidget({super.key, required this.icon, required this.text, required this.onPressed});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -16,18 +16,18 @@ class CircleWidget extends StatelessWidget {
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.all(16),
|
padding: EdgeInsets.all(16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(8),
|
||||||
color: Colors.white10,
|
color: Color.fromARGB(149, 16, 22, 28),
|
||||||
border: Border.all(color: const Color.fromARGB(77, 255, 255, 255)),
|
border: Border.all(color: const Color(0xff202f3d)),
|
||||||
),
|
),
|
||||||
width: 120,
|
width: 120,
|
||||||
height: 120,
|
height: 120,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
const Gap(8),
|
const Gap(4),
|
||||||
Icon(icon, color: Colors.white, size: 32),
|
Icon(icon, color: Colors.white, size: 42),
|
||||||
const Gap(8),
|
const Gap(16),
|
||||||
TextWidget(text: text, size: 16),
|
TextWidget(text: text, size: 14),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Loading…
Add table
Add a link
Reference in a new issue