1
1
import 'package:appbasepe/blocs/theme.dart' ;
2
2
import 'package:appbasepe/components/radio_form.dart' ;
3
+ import 'package:appbasepe/core/internationalization/app_translate.dart' ;
3
4
import 'package:flutter/material.dart' ;
4
5
import 'package:provider/provider.dart' ;
5
6
@@ -9,20 +10,27 @@ class MainDrawer extends StatefulWidget {
9
10
}
10
11
11
12
class _MainDrawerState extends State <MainDrawer > {
12
- static const themeProps = [
13
- {"label" : "Light" , "value" : ThemeColorProps .light},
14
- {"label" : "Dark" , "value" : ThemeColorProps .dark}
15
- ];
16
-
17
- static const fontProps = [
18
- {"label" : 'Small' , "value" : ThemeTextProps .small},
19
- {"label" : 'Medium' , "value" : ThemeTextProps .medium},
20
- {"label" : 'Large' , "value" : ThemeTextProps .large},
21
- {"label" : 'Extra large' , "value" : ThemeTextProps .extraLarge}
22
- ];
23
-
24
13
@override
25
14
Widget build (BuildContext context) {
15
+ final strLight = AppTranslate (context).text ("light" );
16
+ final strDark = AppTranslate (context).text ("dark" );
17
+
18
+ final strSmall = AppTranslate (context).text ("small" );
19
+ final strMedium = AppTranslate (context).text ("medium" );
20
+ final strLarge = AppTranslate (context).text ("large" );
21
+ final strExtraLarge = AppTranslate (context).text ("extra_large" );
22
+
23
+ final themeProps = [
24
+ {"label" : strLight, "value" : ThemeColorProps .light},
25
+ {"label" : strDark, "value" : ThemeColorProps .dark}
26
+ ];
27
+ final fontProps = [
28
+ {"label" : strSmall, "value" : ThemeTextProps .small},
29
+ {"label" : strMedium, "value" : ThemeTextProps .medium},
30
+ {"label" : strLarge, "value" : ThemeTextProps .large},
31
+ {"label" : strExtraLarge, "value" : ThemeTextProps .extraLarge}
32
+ ];
33
+
26
34
final theme = Provider .of <ThemeChanger >(context);
27
35
ThemeColorProps _valueTheme = theme.getThemeColor ();
28
36
ThemeTextProps _valueThemeText = theme.getThemeText ();
@@ -44,7 +52,7 @@ class _MainDrawerState extends State<MainDrawer> {
44
52
return Drawer (
45
53
child: Scaffold (
46
54
appBar: AppBar (
47
- title: Text ("Home" ),
55
+ title: Text (AppTranslate (context). text ( "menu" ) ),
48
56
centerTitle: true ,
49
57
automaticallyImplyLeading: false ,
50
58
),
@@ -57,7 +65,7 @@ class _MainDrawerState extends State<MainDrawer> {
57
65
Container (
58
66
margin: EdgeInsets .only (bottom: 10 ),
59
67
child: Text (
60
- "Settings" ,
68
+ AppTranslate (context). text ( "settings" ) ,
61
69
style: Theme .of (context).textTheme.headline5,
62
70
),
63
71
),
@@ -67,7 +75,7 @@ class _MainDrawerState extends State<MainDrawer> {
67
75
crossAxisAlignment: CrossAxisAlignment .start,
68
76
children: < Widget > [
69
77
Text (
70
- "Theme" ,
78
+ AppTranslate (context). text ( "theme" ) ,
71
79
style: Theme .of (context).textTheme.headline6,
72
80
),
73
81
RadioForm (
@@ -78,7 +86,7 @@ class _MainDrawerState extends State<MainDrawer> {
78
86
),
79
87
SizedBox (height: 10 ),
80
88
Text (
81
- "Font Size" ,
89
+ AppTranslate (context). text ( "font_size" ) ,
82
90
style: Theme .of (context).textTheme.headline6,
83
91
),
84
92
RadioForm (
0 commit comments