-
Notifications
You must be signed in to change notification settings - Fork 8
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 #11 from cypherstack/unit_tests
about page added
- Loading branch information
Showing
6 changed files
with
268 additions
and
21 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
159 changes: 159 additions & 0 deletions
159
lib/pages/settings_view/settings_subviews/about_view.dart
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,159 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:google_fonts/google_fonts.dart'; | ||
import 'package:package_info_plus/package_info_plus.dart'; | ||
import 'package:paymint/pages/settings_view/helpers/builders.dart'; | ||
import 'package:paymint/utilities/cfcolors.dart'; | ||
|
||
class AboutView extends StatelessWidget { | ||
const AboutView({Key key}) : super(key: key); | ||
|
||
static const String routeName = "/about"; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
backgroundColor: CFColors.white, | ||
appBar: buildSettingsAppBar( | ||
context, | ||
"About", | ||
), | ||
body: Padding( | ||
padding: const EdgeInsets.all(16), | ||
child: LayoutBuilder( | ||
builder: (context, constraints) { | ||
return SingleChildScrollView( | ||
child: ConstrainedBox( | ||
constraints: BoxConstraints( | ||
minHeight: constraints.maxHeight, | ||
), | ||
child: IntrinsicHeight( | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: [ | ||
SizedBox( | ||
height: 24, | ||
), | ||
FutureBuilder( | ||
future: PackageInfo.fromPlatform(), | ||
builder: | ||
(context, AsyncSnapshot<PackageInfo> snapshot) { | ||
String version = ""; | ||
String appName = ""; | ||
String build = ""; | ||
|
||
if (snapshot.connectionState == | ||
ConnectionState.done && | ||
snapshot.hasData) { | ||
version = snapshot.data.version; | ||
build = snapshot.data.buildNumber; | ||
appName = snapshot.data.appName; | ||
} | ||
|
||
return Column( | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: [ | ||
Container( | ||
child: Column( | ||
crossAxisAlignment: | ||
CrossAxisAlignment.stretch, | ||
children: [ | ||
Text( | ||
"Name", | ||
style: GoogleFonts.workSans( | ||
color: CFColors.twilight, | ||
fontWeight: FontWeight.w500, | ||
fontSize: 12, | ||
), | ||
), | ||
SizedBox( | ||
height: 4, | ||
), | ||
SelectableText( | ||
appName, | ||
style: GoogleFonts.workSans( | ||
color: CFColors.dusk, | ||
fontWeight: FontWeight.w600, | ||
fontSize: 14, | ||
letterSpacing: 0.25, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
SizedBox( | ||
height: 12, | ||
), | ||
Container( | ||
child: Column( | ||
crossAxisAlignment: | ||
CrossAxisAlignment.stretch, | ||
children: [ | ||
Text( | ||
"Version", | ||
style: GoogleFonts.workSans( | ||
color: CFColors.twilight, | ||
fontWeight: FontWeight.w500, | ||
fontSize: 12, | ||
), | ||
), | ||
SizedBox( | ||
height: 4, | ||
), | ||
SelectableText( | ||
version, | ||
style: GoogleFonts.workSans( | ||
color: CFColors.dusk, | ||
fontWeight: FontWeight.w600, | ||
fontSize: 14, | ||
letterSpacing: 0.25, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
SizedBox( | ||
height: 12, | ||
), | ||
Container( | ||
child: Column( | ||
crossAxisAlignment: | ||
CrossAxisAlignment.stretch, | ||
children: [ | ||
Text( | ||
"Build number", | ||
style: GoogleFonts.workSans( | ||
color: CFColors.twilight, | ||
fontWeight: FontWeight.w500, | ||
fontSize: 12, | ||
), | ||
), | ||
SizedBox( | ||
height: 4, | ||
), | ||
SelectableText( | ||
build, | ||
style: GoogleFonts.workSans( | ||
color: CFColors.dusk, | ||
fontWeight: FontWeight.w600, | ||
fontSize: 14, | ||
letterSpacing: 0.25, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
], | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
), | ||
), | ||
); | ||
}, | ||
), | ||
), | ||
); | ||
} | ||
} |
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.