You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mohemm-flutter-app/lib/pages/login/login_screen.dart

104 lines
4.0 KiB
Dart

import 'package:easy_localization/easy_localization.dart';
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/sikander_later_will_remove_to_parent_directory/classes/colors.dart';
import 'package:mohem_flutter_app/sikander_later_will_remove_to_parent_directory/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/sikander_later_will_remove_to_parent_directory/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/sikander_later_will_remove_to_parent_directory/widgets/input_widget.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
class LoginScreen extends StatefulWidget {
LoginScreen({Key? key}) : super(key: key);
@override
_LoginScreenState createState() {
return _LoginScreenState();
}
}
class _LoginScreenState extends State<LoginScreen> {
TextEditingController username = TextEditingController();
TextEditingController password = TextEditingController();
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
const SizedBox(height: 23),
Expanded(
child: Padding(
padding: const EdgeInsets.all(21.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(child: SizedBox()),
Row(
children: [
Text(
LocaleKeys.english.tr(),
style: TextStyle(color: MyColors.textMixColor, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.w600),
).onPress(() {}),
Container(
width: 1,
color: MyColors.darkWhiteColor,
height: 16,
margin: const EdgeInsets.only(left: 10, right: 10),
),
Text(
LocaleKeys.arabic.tr(),
style: TextStyle(color: MyColors.darkTextColor, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.w600),
).onPress(() {}),
],
),
],
),
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
LocaleKeys.login.tr(),
style: TextStyle(color: MyColors.darkTextColor, fontSize: 24, letterSpacing: -1.44, fontWeight: FontWeight.w700),
),
Text(
LocaleKeys.pleaseEnterLoginDetails.tr(),
style: TextStyle(color: MyColors.darkTextColor, fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600),
),
16.height,
InputWidget(LocaleKeys.username.tr(), "123456", username),
12.height,
InputWidget(LocaleKeys.password.tr(), "xxxxxx", password, isObscureText: true)
],
),
)
],
),
),
),
DefaultButton(LocaleKeys.login.tr(), () async {
// context.setLocale(const Locale("en", "US")); // to change Loacle
})
.insideContainer
],
),
);
}
}