Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app_localizations #94

Closed
ghost opened this issue Aug 6, 2021 · 4 comments
Closed

app_localizations #94

ghost opened this issue Aug 6, 2021 · 4 comments

Comments

@ghost
Copy link

ghost commented Aug 6, 2021

flutter app_localizations package issue

@ferraridamiano
Copy link
Owner

Hi @grow-withcode, could you please elaborate the issue? This project doesn't use any app_localization package

@ghost
Copy link
Author

ghost commented Aug 6, 2021

please check line no 4, issue is resolve but app_localization is used but you said doesn't use

1. import 'pages/ConversionPage.dart';
2. import 'package:converterpro/pages/SettingsPage.dart';
3. import 'package:flutter/material.dart';
4. import 'package:flutter_gen/gen_l10n/app_localizations.dart';
5. import 'package:provider/provider.dart';
6. import 'models/AppModel.dart';
7. import 'models/Conversions.dart';
8. 
9. void main() async {
10.   WidgetsFlutterBinding.ensureInitialized();
11.   runApp(new MyApp());
12. }
13. 
14. class MyApp extends StatefulWidget {
15.   @override
16.   _MyApp createState() => _MyApp();
17. }
18. 
19. class _MyApp extends State<MyApp> {
20.   @override
21.   Widget build(BuildContext context) {
22.     return MultiProvider(
23.       providers: [
24.         ChangeNotifierProvider(
25.           create: (_) => AppModel(),
26.         ),
27.         ChangeNotifierProxyProvider<AppModel, Conversions>(
28.           create: (context) => Conversions(),
29.           update: (context, appModel, conversions) {
30.             conversions?.currentPage = appModel.currentPage;
31.             return conversions!;
32.           },
33.         ),
34.       ],
35.       child: Builder(builder: (BuildContext context) {
36.         bool isDarkAmoled = context.select<AppModel, bool>((appModel) => appModel.isDarkAmoled);
37.         return MaterialApp(
38.           debugShowCheckedModeBanner: false,
39.           title: 'Converter NOW',
40.           initialRoute: '/',
41.           routes: {
42.             '/': (context) => ConversionPage(),
43.             '/settings': (context) => SettingsPage(),
44.           },
45.           themeMode: context.select<AppModel, ThemeMode>((appModel) => appModel.currentThemeMode),
46.           theme: ThemeData(primaryColor: Color(0xFFF2542D), accentColor: Color(0xFF0E9594), brightness: Brightness.light),
47.           darkTheme: ThemeData(
48.             primaryColor: const Color(0xFFF2542D),
49.             accentColor: const Color(0xFF0E9594),
50.             brightness: Brightness.dark,
51.             scaffoldBackgroundColor: isDarkAmoled ? Colors.black : Colors.grey[850],
52.             canvasColor: isDarkAmoled ? Colors.black : Colors.grey[850], // for drawer background
53.             cardColor: isDarkAmoled ? Colors.grey[900] : Colors.grey[800],
54.           ),
55.           supportedLocales: [Locale('en'), Locale('de'), Locale('fr'), Locale('it'), Locale('nb'), Locale('pt'), Locale('ru'), Locale('tr'), Locale('es')],
56.           localizationsDelegates: AppLocalizations.localizationsDelegates,
57.           localeResolutionCallback: (Locale? locale, Iterable<Locale> supportedLocales) {
58.             for (Locale supportedLocale in supportedLocales) {
59.               if (supportedLocale.languageCode == locale?.languageCode || supportedLocale.countryCode == locale?.countryCode) {
60.                 return supportedLocale;
61.               }
62.             }
63.             return supportedLocales.first;
64.           },
65.         );
66.       }),
67.     );
68.   }
69. }

@ferraridamiano
Copy link
Owner

Converter NOW use a package called intl. This package generates a file called app_localizations. It is not a package, is a file generated by a package.
Anyway, what is the issue?

@ferraridamiano
Copy link
Owner

I'm closing this issue since it seems not related to a bug/request of the app. If you want to know how the app works please feel free to open a discussion in the dedicated tab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant