-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
210 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
part of 'page_portrait.dart'; | ||
|
||
class PageLand extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
var height = MediaQuery.of(context).size.height; | ||
height -= MediaQuery.of(context).viewInsets.vertical; | ||
return SizedBox.expand( | ||
child: Container( | ||
color: BACKGROUND_COLOR, | ||
child: Padding( | ||
padding: MediaQuery.of(context).padding, | ||
child: Row( | ||
mainAxisSize: MainAxisSize.min, | ||
children: <Widget>[ | ||
Expanded( | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: <Widget>[ | ||
Spacer(), | ||
SystemButtonGroup(), | ||
Spacer(), | ||
Padding( | ||
padding: const EdgeInsets.only(left: 40, bottom: 40), | ||
child: DropButton(), | ||
) | ||
], | ||
), | ||
), | ||
_ScreenDecoration(child: Screen.fromHeight(height * 0.8)), | ||
Expanded( | ||
child: Column( | ||
children: <Widget>[ | ||
Row( | ||
children: <Widget>[ | ||
Spacer(), | ||
FlatButton( | ||
onPressed: () { | ||
showDialog( | ||
context: context, | ||
builder: (context) => DonationDialog()); | ||
}, | ||
child: Text(S.of(context).reward)) | ||
], | ||
), | ||
Spacer(), | ||
DirectionController(), | ||
], | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:tetris/generated/i18n.dart'; | ||
import 'package:tetris/income/donation_dialog.dart'; | ||
import 'package:tetris/main.dart'; | ||
import 'package:tetris/panel/controller.dart'; | ||
import 'package:tetris/panel/screen.dart'; | ||
|
||
part 'page_land.dart'; | ||
|
||
class PagePortrait extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
final size = MediaQuery.of(context).size; | ||
final screenW = size.width * 0.8; | ||
|
||
return SizedBox.expand( | ||
child: Container( | ||
color: BACKGROUND_COLOR, | ||
child: Padding( | ||
padding: MediaQuery.of(context).padding, | ||
child: Column( | ||
children: <Widget>[ | ||
Row( | ||
children: <Widget>[ | ||
Spacer(), | ||
FlatButton( | ||
onPressed: () { | ||
showDialog( | ||
context: context, | ||
builder: (context) => DonationDialog()); | ||
}, | ||
child: Text(S.of(context).reward)) | ||
], | ||
), | ||
Spacer(), | ||
_ScreenDecoration(child: Screen(width: screenW)), | ||
Spacer(flex: 2), | ||
GameController(), | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} | ||
|
||
class _ScreenDecoration extends StatelessWidget { | ||
final Widget child; | ||
|
||
const _ScreenDecoration({Key key, @required this.child}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
decoration: BoxDecoration( | ||
border: Border( | ||
top: BorderSide( | ||
color: const Color(0xFF987f0f), width: SCREEN_BORDER_WIDTH), | ||
left: BorderSide( | ||
color: const Color(0xFF987f0f), width: SCREEN_BORDER_WIDTH), | ||
right: BorderSide( | ||
color: const Color(0xFFfae36c), width: SCREEN_BORDER_WIDTH), | ||
bottom: BorderSide( | ||
color: const Color(0xFFfae36c), width: SCREEN_BORDER_WIDTH), | ||
), | ||
), | ||
child: Container( | ||
decoration: BoxDecoration(border: Border.all(color: Colors.black54)), | ||
child: Container( | ||
padding: const EdgeInsets.all(3), | ||
color: SCREEN_BACKGROUND, | ||
child: child, | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.