cosmetic changes on global components

development
Nilo Roberto C Paim 2023-11-26 12:00:21 -03:00
parent 8524e81a76
commit 1d9da1c7e9
4 changed files with 77 additions and 16 deletions

View File

@ -28,6 +28,8 @@ class AppPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
NcButton( NcButton(
width: MediaQuery.of(context).size.width * 0.6,
height: 100,
caption: "Quero testar a plataforma", caption: "Quero testar a plataforma",
backgroundColor: Colors.black, backgroundColor: Colors.black,
captionColor: Colors.white, captionColor: Colors.white,
@ -39,6 +41,8 @@ class AppPage extends StatelessWidget {
height: 40, height: 40,
), ),
NcButton( NcButton(
width: MediaQuery.of(context).size.width * 0.6,
height: 100,
caption: "Já sou cliente", caption: "Já sou cliente",
backgroundColor: Colors.black, backgroundColor: Colors.black,
captionColor: Colors.white, captionColor: Colors.white,

View File

@ -1,5 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pcast/components/nc_base_page.dart'; import 'package:pcast/components/nc_base_page.dart';
import 'package:pcast/components/nc_button.dart';
import 'package:pcast/components/nc_text_field.dart';
import 'package:velocity_x/velocity_x.dart';
Route routeBuilder(BuildContext ctx, RouteSettings settings) { Route routeBuilder(BuildContext ctx, RouteSettings settings) {
return PageRouteBuilder( return PageRouteBuilder(
@ -22,21 +25,37 @@ class LoginPage extends StatefulWidget {
} }
class _LoginPageState extends State<LoginPage> { class _LoginPageState extends State<LoginPage> {
TextEditingController controller = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return const NcBasePage( return NcBasePage(
body: Center( body: Center(
child: Column( child: SizedBox(
mainAxisAlignment: MainAxisAlignment.center, width: MediaQuery.of(context).size.width * 0.6,
children: [ child: Column(
Text( mainAxisAlignment: MainAxisAlignment.center,
"Login Page", children: [
style: TextStyle( "Informe o seu email".text.white.italic.xl4.make(),
color: Colors.white, const SizedBox(
fontSize: 40, height: 40,
), ),
), NCTextField(hintText: "Email", controller: controller),
], const SizedBox(
height: 40,
),
NcButton(
width: 250,
height: 80,
caption: "Próximo",
backgroundColor: Colors.black,
captionColor: Colors.red,
onPressed: () => {
print(controller.text),
},
),
],
),
), ),
), ),
); );

View File

@ -2,23 +2,34 @@ import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
class NcButton extends StatelessWidget { class NcButton extends StatelessWidget {
const NcButton({super.key, required this.caption, required this.backgroundColor, required this.captionColor, this.onPressed}); const NcButton({
super.key,
required this.caption,
required this.backgroundColor,
required this.captionColor,
this.onPressed,
required this.width,
required this.height,
});
final String caption; final String caption;
final Color backgroundColor; final Color backgroundColor;
final Color captionColor; final Color captionColor;
final double width;
final double height;
final void Function()? onPressed; final void Function()? onPressed;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SizedBox( return SizedBox(
width: 500, width: width,
height: 100, height: height,
child: ElevatedButton( child: ElevatedButton(
onPressed: onPressed, onPressed: onPressed,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: backgroundColor, padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 20),
foregroundColor: captionColor, backgroundColor: Colors.black,
foregroundColor: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),

View File

@ -0,0 +1,27 @@
import 'package:flutter/material.dart';
class NCTextField extends StatelessWidget {
const NCTextField({super.key, required this.hintText, required this.controller});
final String hintText;
final TextEditingController controller;
@override
Widget build(BuildContext context) {
return TextField(
controller: controller,
decoration: InputDecoration(
hintText: hintText,
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: const BorderSide(color: Colors.black),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: const BorderSide(color: Colors.black),
),
),
);
}
}