Created preliminary gradient button
This commit is contained in:
parent
5bfafb2101
commit
85f49f1133
2 changed files with 34 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../widgets/logo.dart';
|
||||
import '../widgets/gradient_button.dart';
|
||||
|
||||
class LoginScreen extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
|
|
@ -16,7 +17,9 @@ class LoginScreen extends StatelessWidget {
|
|||
flex: 4,
|
||||
),
|
||||
Expanded(
|
||||
child: Text('Login Buton'),
|
||||
child: Center(
|
||||
child: GradientButton(),
|
||||
),
|
||||
flex: 1,
|
||||
),
|
||||
],
|
||||
|
|
|
|||
30
lib/src/widgets/gradient_button.dart
Normal file
30
lib/src/widgets/gradient_button.dart
Normal 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)
|
||||
]),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue