Skip to content

Commit

Permalink
[Presentation] Added a tabview to the characters page on landscape
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfteam committed Jul 17, 2021
1 parent 2a9baf3 commit ea2b640
Show file tree
Hide file tree
Showing 7 changed files with 386 additions and 85 deletions.
34 changes: 33 additions & 1 deletion lib/presentation/character/character_page.dart
Expand Up @@ -7,13 +7,45 @@ import 'widgets/character_detail_top.dart';
class CharacterPage extends StatelessWidget {
const CharacterPage({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
final isPortrait = MediaQuery.of(context).orientation == Orientation.portrait;
return isPortrait ? const _PortraitLayout() : const _LandscapeLayout();
}
}

class _PortraitLayout extends StatelessWidget {
const _PortraitLayout({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return ScaffoldWithFab(
child: Stack(
fit: StackFit.passthrough,
clipBehavior: Clip.none,
children: const [CharacterDetailTop(), CharacterDetailBottom()],
alignment: Alignment.topCenter,
children: const [
CharacterDetailTop(),
CharacterDetailBottom(),
],
),
);
}
}

class _LandscapeLayout extends StatelessWidget {
const _LandscapeLayout({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Row(
children: const [
Expanded(child: CharacterDetailTop()),
Expanded(child: CharacterDetailBottom()),
],
),
),
);
}
Expand Down
7 changes: 7 additions & 0 deletions lib/presentation/character/widgets/character_detail.dart
@@ -1,3 +1,5 @@
import 'package:flutter/material.dart';

export 'character_detail_ascension_materials_card.dart';
export 'character_detail_bottom.dart';
export 'character_detail_build_card.dart';
Expand All @@ -11,3 +13,8 @@ export 'character_detail_top.dart';

const double imgSize = 28;
const double imgHeight = 550;
const double charDescriptionHeight = 240;

double getTopHeightForPortrait(BuildContext context) {
return MediaQuery.of(context).size.height * 0.7;
}

0 comments on commit ea2b640

Please sign in to comment.