-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from sayansil/landscape
Add support for landscape orientation screens
- Loading branch information
Showing
36 changed files
with
2,759 additions
and
1,631 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,41 @@ | ||
import 'package:ecosystem/screens/about/components/body/portrait.dart'; | ||
import 'package:ecosystem/screens/about/components/body/landscape.dart'; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:package_info_plus/package_info_plus.dart'; | ||
|
||
class AboutBody extends StatefulWidget { | ||
const AboutBody({super.key}); | ||
|
||
@override | ||
State<AboutBody> createState() => AboutBodyState(); | ||
} | ||
|
||
class AboutBodyState extends State<AboutBody> { | ||
String version = ""; | ||
|
||
Future<void> loadVersion() async { | ||
PackageInfo packageInfo = await PackageInfo.fromPlatform(); | ||
|
||
setState(() { | ||
version = packageInfo.version; | ||
}); | ||
} | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
loadVersion(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return OrientationBuilder( | ||
builder: (BuildContext context, Orientation orientation) { | ||
return orientation == Orientation.portrait ? | ||
getPortraitBody(this) : | ||
getLandscapeBody(this); | ||
} | ||
); | ||
} | ||
} |
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,97 @@ | ||
|
||
|
||
import 'package:flutter/material.dart'; | ||
|
||
import 'package:ecosystem/constants.dart'; | ||
import 'package:ecosystem/screens/common/credits.dart'; | ||
import 'package:ecosystem/screens/common/header.dart'; | ||
import 'package:ecosystem/styles/widget_styles.dart'; | ||
import 'driver.dart'; | ||
|
||
Widget getLandscapeBody(AboutBodyState state) { | ||
Size size = MediaQuery.of(state.context).size; | ||
|
||
return Container( | ||
constraints: const BoxConstraints.expand(), | ||
child: Stack( | ||
children: <Widget>[ | ||
// * Header background | ||
getScreenHeaderBackground(size), | ||
|
||
ShaderMask( | ||
shaderCallback: (Rect bounds) { | ||
return LinearGradient( | ||
end: Alignment.topCenter, | ||
begin: Alignment.bottomCenter, | ||
colors: [Colors.white, Colors.white.withOpacity(0.05)], | ||
stops: const [0.95, 1], | ||
tileMode: TileMode.mirror, | ||
).createShader(bounds); | ||
}, | ||
child: SingleChildScrollView( | ||
padding: const EdgeInsets.only( | ||
left: defaultPadding, | ||
right: defaultPadding, | ||
), | ||
physics: const BouncingScrollPhysics(), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
children: [ | ||
const SizedBox( | ||
height: maskPadding, | ||
), | ||
|
||
Container( | ||
width: double.infinity, | ||
padding: const EdgeInsets.symmetric( | ||
horizontal: defaultPadding, | ||
vertical: defaultPadding, | ||
), | ||
decoration: BoxDecoration( | ||
color: Colors.white, | ||
boxShadow: defaultCardShadow, | ||
borderRadius: BorderRadius.circular(20), | ||
), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
const Text( | ||
aboutText, | ||
style: subHeaderStyle, | ||
), | ||
|
||
const SizedBox(height: 100), | ||
|
||
Visibility( | ||
visible: state.version.isNotEmpty, | ||
child: Container( | ||
padding: const EdgeInsets.symmetric( | ||
vertical: defaultPadding / 4, | ||
horizontal: defaultPadding / 2, | ||
), | ||
decoration: BoxDecoration( | ||
color: colorPrimary, | ||
borderRadius: BorderRadius.circular(20), | ||
), | ||
child: Text( | ||
"version: ${state.version}", | ||
style: subHeaderBrightStyle, | ||
), | ||
), | ||
), | ||
|
||
getFooter(), | ||
], | ||
), | ||
), | ||
|
||
const SizedBox(height: 100), | ||
] | ||
), | ||
) | ||
), | ||
], | ||
), | ||
); | ||
} |
Oops, something went wrong.