Skip to content

Instantly share code, notes, and snippets.

View mukireus's full-sized avatar
🏠
Working from home

Muhammet OMER mukireus

🏠
Working from home
View GitHub Profile
void onDrawerButtonPressed(BuildContext _context) {
try {
FocusScope.of(_context).unfocus();
} catch (e) {}
showModalBottomSheet(
context: _context,
backgroundColor: Colors.transparent,
builder: (_context) {
return Container(
height: MediaQuery.of(_context).size.height * .5,
Widget get _bottomNavigationBar => BottomAppBar(
notchMargin: 0,
shape: CircularNotchedRectangle(),
child: Container(
height: 56,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 50),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
class _HomeBodyScreenState extends State<HomeBodyScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: UIColorHelper.LIGHT_COLOR,
body: _body,
);
}
Widget get _body =>
class UIColorHelper {
static const Color PRIMARY_COLOR = Color(0xFF1A237E);
static const Color LIGHT_COLOR = Color(0xFF534BAE);
static const Color DARK_COLOR = Color(0xFF000051);
static const Color TEXT_COLOR = Color(0xFFFFFFFF);
}
UIColorHelper.DEGISKEN_ADI // Bu şekilde kullanabilirsiniz.
class UITextHelper {
static final String name = "Name";
static final String email = "Email address";
static final String username = "Username";
static final String password = "Password";
static final String login = "Login";
static final String forgetPassword = "Forget Password?";
}
UITextHelper.DEGISKEN_ADI // Bu şekilde kullanabilirsiniz.
final ThemeData theme = ThemeData(
primaryColor: Colors.blue,
accentColor: Colors.blueAccent,
textTheme: TextTheme(body1: TextStyle(color: Colors.lightBlue))
);
// Kullanımda ise _textField("Username", true), yazmanız yeterlidir.
Widget _textField(String text, bool obscure) => TextField(
style: TextStyle(color: Colors.white),
textAlign: TextAlign.left,
obscureText: obscure,
autocorrect: false,
cursorColor: Colors.white,
maxLines: 1,
);
//Kullanımda ise _loginButton yazmanız yeterlidir.
Widget get _loginButton => InkWell(
borderRadius: _loginButtonBorderStyle,
onTap: () {},
child: Container(
height: UIHelper.dynamicHeight(300),
width: UIHelper.dynamicWidth(500),
child: Center(
child: Text(UIHelper.signIn.toUpperCase(),
style: UITextStyles.buttonStyle),
BorderRadius get _loginButtonBorderStyle => BorderRadius.only(
bottomRight: Radius.circular(80),
topRight: Radius.circular(80),
);
// Bu şekilde kullanabilirsiniz.
BoxDecoration(color: Colors.white, borderRadius: _loginButtonBorderStyle),
class UIBoxDecoration {
static BoxDecoration boxStyle = BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.blue,
blurRadius: 10.0,
spreadRadius: 1.0,
offset: Offset(
3.0,
3.0,