Created preliminary gradient button

This commit is contained in:
Mariano Uvalle 2019-03-07 23:42:31 -06:00
parent 5bfafb2101
commit 85f49f1133
2 changed files with 34 additions and 1 deletions

View file

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../widgets/logo.dart'; import '../widgets/logo.dart';
import '../widgets/gradient_button.dart';
class LoginScreen extends StatelessWidget { class LoginScreen extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -16,7 +17,9 @@ class LoginScreen extends StatelessWidget {
flex: 4, flex: 4,
), ),
Expanded( Expanded(
child: Text('Login Buton'), child: Center(
child: GradientButton(),
),
flex: 1, flex: 1,
), ),
], ],

View file

@ -0,0 +1,30 @@
import 'package:flutter/material.dart';
class GradientButton extends StatelessWidget {
Widget build(BuildContext context) {
return ConstrainedBox(
constraints: const BoxConstraints(minWidth: 88.0, minHeight: 36.0),
child: Container(
padding: EdgeInsets.all(5),
child: Center(
widthFactor: 1.0,
heightFactor: 1.0,
child: Text('My custom Button'),
),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
stops: [
0,
1.0
],
colors: [
Color.fromRGBO(32, 156, 227, 1.0),
Color.fromRGBO(45, 83, 216, 1.0)
]),
),
),
);
}
}