8-21/1
This commit is contained in:
@@ -6,46 +6,57 @@ import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../controller/local/local_controller.dart';
|
||||
import '../auth/login_page.dart';
|
||||
import '../home/home_page.dart';
|
||||
import '../home/map_page.dart';
|
||||
|
||||
class Language extends GetView<LocaleController> {
|
||||
class Language extends StatelessWidget {
|
||||
const Language({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
body: GetBuilder<LocaleController>(
|
||||
builder: (controller) => Center(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text("Choose Language".tr,
|
||||
style: Theme.of(context).textTheme.headlineLarge),
|
||||
const SizedBox(height: 20),
|
||||
MyElevatedButton(
|
||||
title: 'Ar',
|
||||
onPressed: () {
|
||||
controller.changeLang("ar");
|
||||
// main();
|
||||
box.read(BoxName.email) != null
|
||||
? Get.offAll(() => const MapPage())
|
||||
: Get.offAll(() => LoginPage());
|
||||
},
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: "En",
|
||||
onPressed: () {
|
||||
controller.changeLang("en");
|
||||
box.read(BoxName.email) != null
|
||||
? Get.offAll(() => const MapPage())
|
||||
: Get.offAll(() => LoginPage());
|
||||
},
|
||||
),
|
||||
],
|
||||
)),
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
"Choose Language".tr,
|
||||
style: Theme.of(context).textTheme.headlineLarge,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
MyElevatedButton(
|
||||
title: 'Ar',
|
||||
onPressed: () {
|
||||
controller.changeLang("ar");
|
||||
box.read(BoxName.email) != null
|
||||
? Get.offAll(() => const MapPage())
|
||||
: Get.offAll(() => LoginPage());
|
||||
},
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: "En",
|
||||
onPressed: () {
|
||||
controller.changeLang("en");
|
||||
box.read(BoxName.email) != null
|
||||
? Get.offAll(() => const MapPage())
|
||||
: Get.offAll(() => LoginPage());
|
||||
},
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: "Tr",
|
||||
onPressed: () {
|
||||
controller.changeLang("tr");
|
||||
box.read(BoxName.email) != null
|
||||
? Get.offAll(() => const MapPage())
|
||||
: Get.offAll(() => LoginPage());
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user