change button language

This commit is contained in:
2025-06-30 23:25:56 +02:00
parent 1c21f59420
commit 4f41aff572
9 changed files with 113 additions and 7 deletions

View File

@@ -0,0 +1,21 @@
import 'package:flutter/material.dart';
class LocaleProvider with ChangeNotifier {
Locale _locale = const Locale('en');
Locale get locale => _locale;
void setLocale(Locale locale) {
if (!L10n.all.contains(locale)) return;
_locale = locale;
notifyListeners();
}
}
class L10n {
static final all = [
const Locale('en'),
const Locale('fr'),
];
}