-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from tongvantruong/login-register
UI for login, register
- Loading branch information
Showing
17 changed files
with
370 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class User { | ||
final String email; | ||
final String password; | ||
|
||
const User(this.email, this.password); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
enum ButtonType { | ||
Large, | ||
Medium, | ||
Small | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_web_responsive_layout/constants/app_colors.dart'; | ||
import 'package:flutter_web_responsive_layout/widgets/buttons/button_type.dart'; | ||
|
||
class PrimaryButton extends StatelessWidget { | ||
final ButtonType type; | ||
final String title; | ||
final VoidCallback onPressed; | ||
const PrimaryButton(this.title, this.type, this.onPressed); | ||
|
||
@override | ||
Widget build(Object context) { | ||
return MaterialButton( | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(5) | ||
), | ||
color: primaryColor, | ||
onPressed: () { | ||
onPressed(); | ||
}, | ||
child: Container( | ||
height: _initHeight(), | ||
alignment: Alignment.center, | ||
child: Text(title, | ||
style: TextStyle( | ||
fontSize: _initFontSize(), | ||
fontWeight: _initFontWeight(), | ||
color: Colors.white, | ||
), | ||
), | ||
) | ||
); | ||
} | ||
|
||
FontWeight _initFontWeight() { | ||
switch (type) { | ||
case ButtonType.Large: | ||
return FontWeight.w800; | ||
case ButtonType.Medium: | ||
return FontWeight.w800; | ||
case ButtonType.Small: | ||
return FontWeight.w800; | ||
default: | ||
return FontWeight.w800; | ||
} | ||
} | ||
|
||
double _initFontSize() { | ||
switch (type) { | ||
case ButtonType.Large: | ||
return 16; | ||
case ButtonType.Medium: | ||
return 16; | ||
case ButtonType.Small: | ||
return 16; | ||
default: | ||
return 16; | ||
} | ||
} | ||
|
||
double _initHeight() { | ||
switch (type) { | ||
case ButtonType.Large: | ||
return 70; | ||
case ButtonType.Medium: | ||
return 60; | ||
case ButtonType.Small: | ||
return 50; | ||
default: | ||
return 50; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.