Browse Source

fix: padding on tablet

pull/39/head
AmirrezaChegini 1 month ago
parent
commit
c90e5f167b
  1. 22
      lib/features/home/presentation/ui/home_page.dart
  2. 48
      lib/features/level/presentation/ui/level_page.dart
  3. 44
      lib/features/question/presentation/ui/question_page.dart
  4. 2
      lib/features/question/presentation/ui/screens/diamond_screen.dart

22
lib/features/home/presentation/ui/home_page.dart

@ -44,19 +44,17 @@ class HomePage extends StatelessWidget {
Widget _music(BuildContext context) { Widget _music(BuildContext context) {
return PositionedDirectional( return PositionedDirectional(
top: setPlatform(android: MySpaces.s36, iOS: MySpaces.s0),
top: setPlatform(android: MySpaces.s36, iOS: 50),
end: MySpaces.s16, end: MySpaces.s16,
child: SafeArea(
child: SlideDownFade(
delay: Duration(milliseconds: 200),
child: StreamBuilder<double>(
initialData: 1,
stream: context.read<HomeBloc>().volumeStream,
builder: (context, snapshot) => MyInkwell(
onTap: () => context.read<HomeBloc>().changeMute(),
child: MyImage(
image: snapshot.data == 0 ? MyAssets.musicOff : MyAssets.musicOn,
),
child: SlideDownFade(
delay: Duration(milliseconds: 200),
child: StreamBuilder<double>(
initialData: 1,
stream: context.read<HomeBloc>().volumeStream,
builder: (context, snapshot) => MyInkwell(
onTap: () => context.read<HomeBloc>().changeMute(),
child: MyImage(
image: snapshot.data == 0 ? MyAssets.musicOff : MyAssets.musicOn,
), ),
), ),
), ),

48
lib/features/level/presentation/ui/level_page.dart

@ -187,34 +187,32 @@ class LevelPage extends StatelessWidget {
return Positioned( return Positioned(
left: MySpaces.s16, left: MySpaces.s16,
right: MySpaces.s16, right: MySpaces.s16,
top: setPlatform(android: MySpaces.s20, iOS: MySpaces.s0),
child: SafeArea(
child: Row(
spacing: MySpaces.s16,
children: [
MyInkwell(
onTap: () => context.read<LevelBloc>().goToHomePage(context),
audio: MyAudios.back,
child: MyImage(
image: MyAssets.homeButton,
),
),
Spacer(),
DiamondLevel(
diamonds: context.read<LevelBloc>().diamonds,
top: setPlatform(android: MySpaces.s20, iOS: 50),
child: Row(
spacing: MySpaces.s16,
children: [
MyInkwell(
onTap: () => context.read<LevelBloc>().goToHomePage(context),
audio: MyAudios.back,
child: MyImage(
image: MyAssets.homeButton,
), ),
StreamBuilder<double>(
initialData: 1,
stream: context.read<LevelBloc>().volumeStream,
builder: (context, snapshot) => MyInkwell(
onTap: () => context.read<LevelBloc>().changeMute(),
child: MyImage(
image: snapshot.data == 0 ? MyAssets.musicOff : MyAssets.musicOn,
),
),
Spacer(),
DiamondLevel(
diamonds: context.read<LevelBloc>().diamonds,
),
StreamBuilder<double>(
initialData: 1,
stream: context.read<LevelBloc>().volumeStream,
builder: (context, snapshot) => MyInkwell(
onTap: () => context.read<LevelBloc>().changeMute(),
child: MyImage(
image: snapshot.data == 0 ? MyAssets.musicOff : MyAssets.musicOn,
), ),
), ),
],
),
),
],
), ),
); );
} }

44
lib/features/question/presentation/ui/question_page.dart

@ -29,7 +29,6 @@ class QuestionPage extends StatelessWidget {
horizontal: setSize(context: context, horizontal: setSize(context: context,
mobile: MySpaces.s16, mobile: MySpaces.s16,
tablet: MySpaces.s30) ?? 0, tablet: MySpaces.s30) ?? 0,
vertical: setPlatform(android: MySpaces.s20) ?? 0,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( gradient: LinearGradient(
@ -47,29 +46,28 @@ class QuestionPage extends StatelessWidget {
), ),
), ),
), ),
child: SafeArea(
bottom: false,
child: Column(
children: [
_topButtons(context),
MySpaces.s10.gapHeight,
Expanded(
child: BlocBuilder<QuestionBloc, QuestionState>(
buildWhen: (previous, current) =>
(previous.currentQuestion?.order !=
current.currentQuestion?.order),
builder: (context, state) {
if (state.currentQuestion?.order ==
state.levelEntity?.questions?.length) {
return DiamondScreen();
} else {
return QuestionScreen();
}
},
),
child: Column(
children: [
setPlatform<double>(android: MySpaces.s20, iOS: 50)?.gapHeight ?? SizedBox.shrink(),
_topButtons(context),
MySpaces.s10.gapHeight,
Expanded(
child: BlocBuilder<QuestionBloc, QuestionState>(
buildWhen: (previous, current) =>
(previous.currentQuestion?.order !=
current.currentQuestion?.order),
builder: (context, state) {
if (state.currentQuestion?.order ==
state.levelEntity?.questions?.length) {
return DiamondScreen();
} else {
return QuestionScreen();
}
},
), ),
],
),
),
setPlatform<double>(android: MySpaces.s20,)?.gapHeight ?? SizedBox.shrink(),
],
), ),
), ),
), ),

2
lib/features/question/presentation/ui/screens/diamond_screen.dart

@ -7,6 +7,7 @@ import 'package:hadi_hoda_flutter/common_ui/resources/my_assets.dart';
import 'package:hadi_hoda_flutter/common_ui/resources/my_colors.dart'; import 'package:hadi_hoda_flutter/common_ui/resources/my_colors.dart';
import 'package:hadi_hoda_flutter/common_ui/resources/my_spaces.dart'; import 'package:hadi_hoda_flutter/common_ui/resources/my_spaces.dart';
import 'package:hadi_hoda_flutter/common_ui/resources/my_text_style.dart'; import 'package:hadi_hoda_flutter/common_ui/resources/my_text_style.dart';
import 'package:hadi_hoda_flutter/core/utils/gap.dart';
import 'package:hadi_hoda_flutter/core/utils/my_localization.dart'; import 'package:hadi_hoda_flutter/core/utils/my_localization.dart';
import 'package:hadi_hoda_flutter/core/utils/screen_size.dart'; import 'package:hadi_hoda_flutter/core/utils/screen_size.dart';
import 'package:hadi_hoda_flutter/core/utils/set_platform_size.dart'; import 'package:hadi_hoda_flutter/core/utils/set_platform_size.dart';
@ -143,6 +144,7 @@ class DiamondScreen extends StatelessWidget {
_buttons(context), _buttons(context),
], ],
), ),
MySpaces.s20.gapHeight,
], ],
); );
} }

Loading…
Cancel
Save