Skip to content

Commit

Permalink
Merge pull request #11 from cypherstack/unit_tests
Browse files Browse the repository at this point in the history
about page added
  • Loading branch information
msalazarm authored Jul 25, 2022
2 parents c41d2c6 + 49944d5 commit d23f0fd
Show file tree
Hide file tree
Showing 6 changed files with 268 additions and 21 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (keystorePropertiesFile.exists()) {
}

android {
compileSdkVersion 31
compileSdkVersion 33

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -46,7 +46,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.cypherstack.campfire"
minSdkVersion 23
targetSdkVersion 31
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
3 changes: 3 additions & 0 deletions assets/svg/ellipsis.svg
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 lib/pages/settings_view/settings_subviews/about_view.dart
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,
),
),
],
),
),
],
);
},
),
],
),
),
),
);
},
),
),
);
}
}
20 changes: 20 additions & 0 deletions lib/pages/settings_view/settings_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:paymint/notifications/modal_popup_dialog.dart';
import 'package:paymint/pages/address_book_view/address_book_view.dart';
import 'package:paymint/pages/lockscreen_view.dart';
import 'package:paymint/pages/settings_view/settings_subviews/about_view.dart';
import 'package:paymint/pages/settings_view/settings_subviews/currency_view.dart';
import 'package:paymint/pages/settings_view/settings_subviews/network_settings_view.dart';
import 'package:paymint/pages/settings_view/settings_subviews/wallet_settings_view.dart';
Expand Down Expand Up @@ -303,6 +304,25 @@ class SettingsView extends StatelessWidget {
color: CFColors.fog,
),
// address book item
_buildItem(
"assets/svg/ellipsis.svg",
"About",
() {
Navigator.push(
context,
CupertinoPageRoute(
builder: (_) => AboutView(),
settings: RouteSettings(name: "/settings/about"),
),
);
},
Key("settingsOptionAbout"),
),
Container(
height: 1,
width: double.infinity,
color: CFColors.fog,
),
_buildItem(
"assets/svg/usd-circle.svg",
"Currency",
Expand Down
Loading

0 comments on commit d23f0fd

Please sign in to comment.