Skip to content

Commit

Permalink
Merge pull request #92 from ia-toki/fix/large-display
Browse files Browse the repository at this point in the history
Adjust display in large screen
  • Loading branch information
atnanahidiw authored Nov 19, 2023
2 parents 1e1c255 + fd0dd63 commit 82c2a57
Show file tree
Hide file tree
Showing 10 changed files with 148 additions and 125 deletions.
36 changes: 19 additions & 17 deletions app/lib/features/main/presentation/pages/main_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class _MainPageState extends State<MainPage> {
Padding(
padding: const EdgeInsets.all(32),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
Assets.bebrasPandaiText,
Expand All @@ -40,18 +39,21 @@ class _MainPageState extends State<MainPage> {
),
BlocBuilder<MainCubit, MainState>(builder: (context, state) {
if (state is MainSuccess) {
return RichText(
text: TextSpan(
text: 'Selamat Datang\n',
style: FontTheme.blackTitle(),
children: <TextSpan>[
TextSpan(
text: toBeginningOfSentenceCase(
'${state.userData['name']}!',
return Align(
alignment: Alignment.centerLeft,
child: RichText(
text: TextSpan(
text: 'Selamat Datang\n',
style: FontTheme.blackTitle(),
children: <TextSpan>[
TextSpan(
text: toBeginningOfSentenceCase(
'${state.userData['name']}!',
),
style: FontTheme.blackTitleBold(),
),
style: FontTheme.blackTitleBold(),
),
],
],
),
),
);
}
Expand All @@ -74,7 +76,7 @@ class _MainPageState extends State<MainPage> {
text: 'ℹ️ Tentang Tantangan Bebras ℹ️',
),
const SizedBox(
height: 20,
height: 25,
),
Button(
buttonType: ButtonType.primary,
Expand All @@ -84,7 +86,7 @@ class _MainPageState extends State<MainPage> {
text: 'Lihat / Cetak Materi',
),
const SizedBox(
height: 20,
height: 25,
),
Button(
buttonType: ButtonType.primary,
Expand All @@ -94,7 +96,7 @@ class _MainPageState extends State<MainPage> {
text: 'Ikut Latihan Mingguan',
),
const SizedBox(
height: 20,
height: 25,
),
Button(
onTap: () async {
Expand All @@ -104,8 +106,8 @@ class _MainPageState extends State<MainPage> {
customTextColor: Colors.white,
text: 'Pengaturan',
),
const SizedBox(
height: 255,
SizedBox(
height: MediaQuery.of(context).size.height - 620,
),
InkWell(
onTap: () async {
Expand Down
13 changes: 6 additions & 7 deletions app/lib/features/main/presentation/pages/setting_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class _SettingPageState extends State<SettingPage> {
Padding(
padding: const EdgeInsets.all(32),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
Assets.bebrasPandaiText,
Expand All @@ -44,7 +43,7 @@ class _SettingPageState extends State<SettingPage> {
text: 'Edit Profil',
),
const SizedBox(
height: 20,
height: 25,
),
Button(
onTap: () async {
Expand All @@ -60,7 +59,7 @@ class _SettingPageState extends State<SettingPage> {
text: 'Hapus Akun',
),
const SizedBox(
height: 40,
height: 50,
),
Button(
buttonType: ButtonType.primary,
Expand All @@ -75,7 +74,7 @@ class _SettingPageState extends State<SettingPage> {
text: 'Kebijakan Privasi',
),
const SizedBox(
height: 20,
height: 25,
),
Button(
onTap: () async {
Expand All @@ -90,8 +89,8 @@ class _SettingPageState extends State<SettingPage> {
customTextColor: Colors.white,
text: 'Bantu Donasi 💌',
),
const SizedBox(
height: 200,
SizedBox(
height: MediaQuery.of(context).size.height - 695,
),
Button(
onTap: () async {
Expand All @@ -104,7 +103,7 @@ class _SettingPageState extends State<SettingPage> {
text: 'Keluar',
),
const SizedBox(
height: 40,
height: 50,
),
InkWell(
onTap: () async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class _MaterialMenuState extends State<MaterialMenu> {
),
SizedBox(
height: 40,
width: MediaQuery.of(context).size.height - 10,
width: MediaQuery.of(context).size.width - 10,
child: ListView(
scrollDirection: Axis.horizontal,
children: <Widget>[
Expand Down Expand Up @@ -160,12 +160,14 @@ class _MaterialMenuState extends State<MaterialMenu> {
}

if (snapshot.connectionState == ConnectionState.waiting) {
return const Text('Loading');
return const Center(
child: CircularProgressIndicator(),
);
}

var displayEmpty = true;
final boxHeight =
MediaQuery.of(context).size.height * 0.65;
MediaQuery.of(context).size.height - 320;
return SingleChildScrollView(
child: SizedBox(
height: boxHeight,
Expand Down
30 changes: 10 additions & 20 deletions app/lib/features/onboarding/presentation/pages/splash_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,20 @@ class SplashScreen extends StatelessWidget {
}
},
child: Scaffold(
body: Column(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Container(
height: size.width * 0.8,
width: size.width * 0.8,
alignment: Alignment.center,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.logo,
),
fit: BoxFit.contain,
),
),
body: Center(
child: Container(
height: size.width * 0.75,
width: size.width * 0.75,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.logo,
),
fit: BoxFit.contain,
),
),
],
),
),
// safeArea: false,
// padding: false,
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ class _QuizExercisePageState extends State<QuizExercisePage> {
return state is! QuizExerciseFinished;
}, builder: (context, state) {
if (state is QuizExerciseLoading) {
return const Text('LOADING');
return const Center(
child: CircularProgressIndicator(),
);
}
if (state is QuizExerciseFailed) {
return Text(state.error);
Expand Down Expand Up @@ -197,34 +199,39 @@ class _QuizExercisePageState extends State<QuizExercisePage> {
index++;

return RadioListTile(
title: SizedBox(
width: 100,
title: SizedBox(
child: Transform.translate(
offset: const Offset(
-20,
0,
), // Set the desired offset
child: Row(
children: [
Text(
current,
style: const TextStyle(fontSize: 12),
),
const SizedBox(
width: 10,
),
Text('$current. '),
state.quizExercise.type ==
'MULTIPLE_CHOICE_IMAGE'
? Image.network(
e.content,
width: 140,
width: MediaQuery.of(context)
.size
.width -
240,
)
: Flexible(
child: Text(e.content),
)
: Text(e.content),
],
),
),
value: e.id,
groupValue: state.selectedAnswer,
onChanged: (value) {
context
.read<QuizExerciseCubit>()
.selectAnswer(e.id);
});
),
value: e.id,
groupValue: state.selectedAnswer,
onChanged: (value) {
context
.read<QuizExerciseCubit>()
.selectAnswer(e.id);
},
);
}),
state.quizExercise.type == 'SHORT_ANSWER'
? Container(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import '../../../../core/bases/enum/button_type.dart';
import '../../../../core/bases/widgets/atoms/button.dart';
import '../../../../core/bases/widgets/layout/bebras_scaffold.dart';
import '../../../../core/constants/assets.dart';
import '../../../../core/theme/font_theme.dart';
import '../../../../models/quiz_participation.dart';
import '../../../../services/quiz_service.dart';
import '../bloc/quiz_registration_cubit.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,20 @@ class _QuizRegistrationPageState extends State<QuizRegistrationPage> {
Padding(
padding: const EdgeInsets.all(32),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
Assets.bebrasPandaiText,
),
const SizedBox(
height: 40,
),
const Text('Latihan yang pernah diikuti'),
Align(
alignment: Alignment.centerLeft,
child: Text(
'Latihan yang pernah diikuti',
style: FontTheme.blackSubtitleBold(),
),
),
BlocConsumer<QuizRegistrationCubit, QuizRegistrationState>(
listener: (context, state) {
if (state is QuizRegistrationSuccess) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';

import '../../../../core/bases/widgets/layout/bebras_scaffold.dart';
import '../../../../core/constants/assets.dart';
import '../../../../core/theme/font_theme.dart';
import '../bloc/quiz_result_cubit.dart';

part 'quiz_result_page.dart';
Loading

0 comments on commit 82c2a57

Please sign in to comment.