|
|
|
@ -1,17 +1,34 @@
|
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
|
|
|
|
|
|
import '../../routes.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import '../../i18n/ar.i18n.dart' as ar;
|
|
|
|
|
import '../../i18n/en.i18n.dart' as en;
|
|
|
|
|
|
|
|
|
|
class AppDrawer extends StatelessWidget {
|
|
|
|
|
ar.Ar arLang = ar.Ar();
|
|
|
|
|
en.En enLang = en.En();
|
|
|
|
|
ar.Ar arLang = ar.Ar();
|
|
|
|
|
en.En enLang = en.En();
|
|
|
|
|
|
|
|
|
|
Future<SharedPreferences> _prefs = SharedPreferences.getInstance();
|
|
|
|
|
// final SharedPreferences prefs = await _prefs;
|
|
|
|
|
|
|
|
|
|
Future<void> getCounter() async {
|
|
|
|
|
final SharedPreferences prefs = await _prefs;
|
|
|
|
|
final int counter = (prefs.getInt('counter') ?? 0);
|
|
|
|
|
print("dddddd" + prefs.getInt('counter').toString());
|
|
|
|
|
// setState(() {
|
|
|
|
|
// prefs.setInt("counter", counter).then((bool success) {
|
|
|
|
|
// print(counter);
|
|
|
|
|
// return counter;
|
|
|
|
|
// // });
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
|
|
print(arLang.button.save);
|
|
|
|
|
print(enLang.button.save);
|
|
|
|
|
|
|
|
|
|
print(arLang.button.save);
|
|
|
|
|
print(enLang.button.save);
|
|
|
|
|
getCounter();
|
|
|
|
|
return Drawer(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
@ -37,7 +54,7 @@ class AppDrawer extends StatelessWidget {
|
|
|
|
|
ListTile(
|
|
|
|
|
title: Text('Settings'),
|
|
|
|
|
leading: Icon(Icons.settings),
|
|
|
|
|
onTap: () {
|
|
|
|
|
onTap: () {
|
|
|
|
|
drawerNavigator(context, SETTINGS);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
@ -54,7 +71,7 @@ class AppDrawer extends StatelessWidget {
|
|
|
|
|
title: Text('Log Out'),
|
|
|
|
|
leading: Icon(Icons.exit_to_app),
|
|
|
|
|
onTap: () {
|
|
|
|
|
drawerNavigator(context, LOGIN);
|
|
|
|
|
drawerNavigator(context, LOGIN);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|