From 8918c67006cd78ca8a458163591ad0e3fd8ab118 Mon Sep 17 00:00:00 2001 From: AYM1607 Date: Fri, 8 Mar 2019 21:37:56 -0600 Subject: [PATCH] Added IBM Plex sans as custom font, added more properties to the gradient button --- lib/src/App.dart | 1 + lib/src/screens/login_screen.dart | 13 +++++++++++-- lib/src/widgets/gradient_button.dart | 18 +++++++++++++++++- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/lib/src/App.dart b/lib/src/App.dart index 94db294..c021bc2 100644 --- a/lib/src/App.dart +++ b/lib/src/App.dart @@ -9,6 +9,7 @@ class App extends StatelessWidget { home: LoginScreen(), theme: ThemeData( canvasColor: Color.fromRGBO(23, 25, 29, 1.0), + fontFamily: 'IBM Plex Sans', ), ); } diff --git a/lib/src/screens/login_screen.dart b/lib/src/screens/login_screen.dart index c742991..2a534e4 100644 --- a/lib/src/screens/login_screen.dart +++ b/lib/src/screens/login_screen.dart @@ -14,11 +14,20 @@ class LoginScreen extends StatelessWidget { child: Center( child: Logo(), ), - flex: 4, + flex: 3, ), Expanded( child: Center( - child: GradientButton(), + child: GradientButton( + child: Text( + 'LOGIN', + style: TextStyle( + color: Colors.white, + fontSize: 15, + fontWeight: FontWeight.w600, + ), + ), + ), ), flex: 1, ), diff --git a/lib/src/widgets/gradient_button.dart b/lib/src/widgets/gradient_button.dart index c1274da..794ff2e 100644 --- a/lib/src/widgets/gradient_button.dart +++ b/lib/src/widgets/gradient_button.dart @@ -1,17 +1,33 @@ +import 'dart:math'; + import 'package:flutter/material.dart'; class GradientButton extends StatelessWidget { + final double radius; + final Widget child; + final double height; + final double width; + GradientButton({ + this.radius = 4, + @required this.child, + this.height, + this.width, + }); + Widget build(BuildContext context) { return ConstrainedBox( constraints: const BoxConstraints(minWidth: 88.0, minHeight: 36.0), child: Container( + width: width, + height: height, padding: EdgeInsets.all(5), child: Center( widthFactor: 1.0, heightFactor: 1.0, - child: Text('My custom Button'), + child: child, ), decoration: BoxDecoration( + borderRadius: BorderRadius.circular(radius), gradient: LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight,