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

fix: resolve text overflows caused by text scale factor #56

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 31 additions & 23 deletions lib/src/app/presentation/widgets/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,38 @@ class _AppView extends StatelessWidget {

@override
Widget build(BuildContext context) {
return BlocBuilder<AppCubit, AppState>(
builder: (context, state) {
return switch (state) {
AppInitializing() => const SizedBox.shrink(),
AppInitialized() => MaterialApp(
title: AppConfig.appName,
debugShowCheckedModeBanner: false,
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
theme: getIt<AppTheme>(
param1: state.mainColor.value,
instanceName: '$LightAppTheme',
).data,
darkTheme: getIt<AppTheme>(
param1: state.mainColor.value,
instanceName: '$DarkAppTheme',
).data,
themeMode: state.themeMode,
home: const ErrorListener(
child: AppNavigationBar(),
return MediaQuery(
data: MediaQuery.of(context).copyWith(
textScaler: MediaQuery.textScalerOf(context).clamp(
minScaleFactor: 0.8,
maxScaleFactor: 1.5,
),
),
child: BlocBuilder<AppCubit, AppState>(
builder: (context, state) {
return switch (state) {
AppInitializing() => const SizedBox.shrink(),
AppInitialized() => MaterialApp(
title: AppConfig.appName,
debugShowCheckedModeBanner: false,
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
theme: getIt<AppTheme>(
param1: state.mainColor.value,
instanceName: '$LightAppTheme',
).data,
darkTheme: getIt<AppTheme>(
param1: state.mainColor.value,
instanceName: '$DarkAppTheme',
).data,
themeMode: state.themeMode,
home: const ErrorListener(
child: AppNavigationBar(),
),
),
),
};
},
};
},
),
);
}
}
11 changes: 6 additions & 5 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ packages:
bottom_navy_bar:
dependency: "direct main"
description:
name: bottom_navy_bar
sha256: b30d9a566909b9a56f366b9e8abe0c24ef8939e4b464d1cad5ded6a1e2dcfca1
url: "https://pub.dev"
source: hosted
path: "."
ref: master
resolved-ref: a840c73653ce8b1497599e5aa88f5182d949b58e
url: "https://github.com/BBarisKilic/bottom_navy_bar.git"
source: git
version: "6.0.0"
build:
dependency: transitive
Expand Down Expand Up @@ -1222,5 +1223,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.3.0 <4.0.0"
dart: ">=3.4.0 <4.0.0"
flutter: ">=3.19.0"
5 changes: 4 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ environment:
dependencies:
android_intent_plus: ^5.0.2
bloc: ^8.1.4
bottom_navy_bar: ^6.0.0
bottom_navy_bar:
git:
url: https://github.com/BBarisKilic/bottom_navy_bar.git
ref: master
collection: ^1.18.0
equatable: ^2.0.5
ffmpeg_service:
Expand Down
Loading