mirror of
https://github.com/immich-app/immich.git
synced 2026-03-28 20:38:10 -04:00
* refactor: form & form field * chore: remove unused components --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Alex <alex.tran1502@gmail.com>
32 lines
828 B
Dart
32 lines
828 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class ImmichTranslations {
|
|
late String submit;
|
|
late String password;
|
|
|
|
ImmichTranslations({String? submit, String? password}) {
|
|
this.submit = submit ?? 'Submit';
|
|
this.password = password ?? 'Password';
|
|
}
|
|
}
|
|
|
|
class ImmichTranslationProvider extends InheritedWidget {
|
|
final ImmichTranslations? translations;
|
|
|
|
const ImmichTranslationProvider({
|
|
super.key,
|
|
this.translations,
|
|
required super.child,
|
|
});
|
|
|
|
static ImmichTranslations of(BuildContext context) {
|
|
final provider = context.dependOnInheritedWidgetOfExactType<ImmichTranslationProvider>();
|
|
return provider?.translations ?? ImmichTranslations();
|
|
}
|
|
|
|
@override
|
|
bool updateShouldNotify(covariant ImmichTranslationProvider oldWidget) {
|
|
return oldWidget.translations != translations;
|
|
}
|
|
}
|