Skip to content

Commit

Permalink
fix: constrain sizing to environment and remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
jolexxa committed Jul 29, 2024
1 parent 5b762c8 commit 436acb6
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 242 deletions.
57 changes: 31 additions & 26 deletions lib/demo/widgets/app_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class AppScaffold extends StatelessWidget {
final textTheme = theme.textTheme;

final title = Text(l10n.deviceFrameAppBarTitle);
final size = MediaQuery.sizeOf(context);

return Scaffold(
extendBodyBehindAppBar: extendBodyBehindAppBar,
Expand All @@ -38,34 +39,38 @@ class AppScaffold extends StatelessWidget {
title: showTitleInAppBar ? title : null,
titleTextStyle: textTheme.titleMedium,
),
body: SingleChildScrollView(
child: Padding(
padding: extendBodyBehindAppBar
? EdgeInsets.only(
top: AppBar().preferredSize.height + AppSpacing.lg,
bottom: AppSpacing.lg,
)
: const EdgeInsets.all(AppSpacing.lg),
child: Column(
children: [
if (!showTitleInAppBar) ...[
DefaultTextStyle(
style: textTheme.displayMedium!,
child: Padding(
padding: titlePadding,
child: title,
body: SizedBox(
width: size.width,
height: size.height,
child: SingleChildScrollView(
child: Padding(
padding: extendBodyBehindAppBar
? EdgeInsets.only(
top: AppBar().preferredSize.height + AppSpacing.lg,
bottom: AppSpacing.lg,
)
: const EdgeInsets.all(AppSpacing.lg),
child: Column(
children: [
if (!showTitleInAppBar) ...[
DefaultTextStyle(
style: textTheme.displayMedium!,
child: Padding(
padding: titlePadding,
child: title,
),
),
),
const SizedBox(height: AppSpacing.lg),
const SizedBox(height: AppSpacing.lg),
],
predictionChart,
if (goalStats != null) ...[
const SizedBox(height: AppSpacing.lg),
goalStats!,
const SizedBox(height: AppSpacing.lg),
],
transactions,
],
predictionChart,
if (goalStats != null) ...[
const SizedBox(height: AppSpacing.lg),
goalStats!,
const SizedBox(height: AppSpacing.lg),
],
transactions,
],
),
),
),
),
Expand Down
7 changes: 6 additions & 1 deletion lib/demo/widgets/device_frame.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ class DeviceFrame extends StatelessWidget {

return Theme(
data: data,
child: child,
child: Material(
elevation: elevation,
borderRadius: BorderRadius.circular(borderRadius),
clipBehavior: Clip.antiAlias,
child: child,
),
);
}
}
1 change: 0 additions & 1 deletion lib/thumbnail/thumbnail.dart

This file was deleted.

144 changes: 0 additions & 144 deletions lib/thumbnail/view/theme_potential_thumbnail.dart

This file was deleted.

5 changes: 4 additions & 1 deletion test/helpers/pump_experience.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ extension PumpExperience on WidgetTester {
child: MaterialApp(
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: widget,
home: MediaQuery(
data: const MediaQueryData(),
child: widget,
),
),
),
);
Expand Down
69 changes: 0 additions & 69 deletions test/thumbnail/theme_potential_thumbnail_test.dart

This file was deleted.

0 comments on commit 436acb6

Please sign in to comment.