Skip to content

Commit

Permalink
Merge pull request #12 from felipecastrosales/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
felipecastrosales authored Feb 12, 2024
2 parents 284837b + 2fc5892 commit 0c0a9f0
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 4 deletions.
59 changes: 59 additions & 0 deletions lib/app/core/platform_info/widgets/platform_info_widget.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:site/app/core/tokens/app_text_styles.dart';

class PlatformInfoWidget extends StatefulWidget {
const PlatformInfoWidget({
super.key,
required this.padding,
});

final EdgeInsets padding;

@override
State<PlatformInfoWidget> createState() => _PlatformInfoWidgetState();
}

class _PlatformInfoWidgetState extends State<PlatformInfoWidget> {
late Future<PackageInfo> packageInfo;

EdgeInsets get padding => widget.padding;

@override
void initState() {
super.initState();
packageInfo = PackageInfo.fromPlatform();
}

@override
Widget build(BuildContext context) {
return FutureBuilder<PackageInfo>(
future: packageInfo,
builder: (context, snapshot) {
if ([
ConnectionState.none,
ConnectionState.active,
ConnectionState.waiting,
].contains(snapshot.connectionState)) {
return const CircularProgressIndicator();
}

if (snapshot.hasData && snapshot.data != null) {
final data = snapshot.data!;
final text =
'v${data.version}${data.buildNumber.isEmpty ? '' : '+${data.buildNumber}'}';

return Padding(
padding: padding,
child: SelectableText(
text,
style: AppTextStyles.f24WhiteFW500,
),
);
}

return const SizedBox.shrink();
},
);
}
}
6 changes: 6 additions & 0 deletions lib/app/core/tokens/app_text_styles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ class AppTextStyles {
fontWeight: FontWeight.w500,
);

static const f24WhiteFW500 = TextStyle(
fontSize: 14,
color: AppColors.white,
fontWeight: FontWeight.w500,
);

static const errorForm = TextStyle(
fontSize: 14,
color: AppColors.white,
Expand Down
6 changes: 5 additions & 1 deletion lib/app/features/home/widgets/footer/footer_web.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';

import 'package:site/app/core/l10n/l10n.dart';
import 'package:site/app/core/platform_info/widgets/platform_info_widget.dart';
import 'package:site/app/core/shared/shared.dart';
import 'package:site/app/core/tokens/tokens.dart';
import 'package:site/app/features/home/widgets/footer/widgets/widgets.dart';
Expand All @@ -12,7 +13,7 @@ class FooterWeb extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
height: 107,
height: 128,
color: AppColors.black,
alignment: Alignment.center,
padding: const EdgeInsets.symmetric(vertical: 24),
Expand Down Expand Up @@ -53,6 +54,9 @@ class FooterWeb extends StatelessWidget {
),
],
),
const PlatformInfoWidget(
padding: EdgeInsets.all(0),
),
],
),
);
Expand Down
11 changes: 10 additions & 1 deletion lib/app/widgets/drawer/custom_drawer.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';

import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
import 'package:site/app/core/platform_info/widgets/platform_info_widget.dart';

import 'package:site/app/core/tokens/tokens.dart';
import 'package:site/app/widgets/dividers/dividers.dart';
Expand All @@ -25,13 +26,21 @@ class CustomDrawer extends StatelessWidget {
surfaceTintColor: AppColors.transparent,
child: SafeArea(
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
const CustomDrawerHeader(),
const CustomDivider(.5, AppColors.primaryDark),
DrawerItems(itemScrollController),
const Spacer(),
const DrawerFooter(),
const Align(
alignment: Alignment.centerLeft,
child: PlatformInfoWidget(
padding: EdgeInsets.only(
bottom: 20,
left: 20,
),
),
),
const Footer(),
],
),
Expand Down
2 changes: 2 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ import Foundation
import firebase_analytics
import firebase_core
import firebase_remote_config
import package_info_plus
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseAnalyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAnalyticsPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseRemoteConfigPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseRemoteConfigPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
}
32 changes: 32 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.1"
ffi:
dependency: transitive
description:
name: ffi
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
file:
dependency: transitive
description:
Expand Down Expand Up @@ -316,6 +324,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.3"
package_info_plus:
dependency: "direct main"
description:
name: package_info_plus
sha256: "88bc797f44a94814f2213db1c9bd5badebafdfb8290ca9f78d4b9ee2a3db4d79"
url: "https://pub.dev"
source: hosted
version: "5.0.1"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -577,6 +601,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.2"
win32:
dependency: transitive
description:
name: win32
sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8"
url: "https://pub.dev"
source: hosted
version: "5.2.0"
xml:
dependency: transitive
description:
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: site
description: Felipe Sales | Social Links.
publish_to: 'none'
version: 2.0.1
version: 2.1.1

environment:
sdk: '>=3.0.0 <4.0.0'

dependencies:
auto_size_text: ^3.0.0
# dart_code_metrics: ^5.7.6
firebase_analytics: ^10.8.5
firebase_core: ^2.25.4
firebase_core_platform_interface: ^5.0.0
Expand All @@ -23,6 +22,7 @@ dependencies:
http: ^1.2.0
intl: ^0.18.1
lottie: ^2.7.0
package_info_plus: ^5.0.1
scrollable_positioned_list: ^0.3.8
url_launcher: ^6.2.4
url_strategy: ^0.2.0
Expand Down

0 comments on commit 0c0a9f0

Please sign in to comment.