Skip to content

Commit

Permalink
Merge pull request #74 from humhub/f-helper-page-v2
Browse files Browse the repository at this point in the history
Helper page v2
  • Loading branch information
luke- authored May 18, 2023
2 parents dcd43c0 + 4e623c5 commit 5e25c19
Show file tree
Hide file tree
Showing 19 changed files with 284 additions and 165 deletions.
Binary file added assets/fonts/OpenSans-Regular.ttf
Binary file not shown.
Binary file added assets/fonts/OpenSans-SemiBold.ttf
Binary file not shown.
1 change: 1 addition & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ post_install do |installer|
target.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "13.0"
end
end
end
36 changes: 18 additions & 18 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ PODS:
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/Logger (~> 7.8)
- FirebaseCoreInternal (10.4.0):
- FirebaseCoreInternal (10.9.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseInstallations (10.4.0):
- FirebaseInstallations (10.9.0):
- FirebaseCore (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
Expand Down Expand Up @@ -49,26 +49,26 @@ PODS:
- Flutter
- flutter_secure_storage (6.0.0):
- Flutter
- GoogleDataTransport (9.2.0):
- GoogleDataTransport (9.2.3):
- GoogleUtilities/Environment (~> 7.7)
- nanopb (< 2.30910.0, >= 2.30908.0)
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/AppDelegateSwizzler (7.11.0):
- GoogleUtilities/AppDelegateSwizzler (7.11.1):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (7.11.0):
- GoogleUtilities/Environment (7.11.1):
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Logger (7.11.0):
- GoogleUtilities/Logger (7.11.1):
- GoogleUtilities/Environment
- GoogleUtilities/Network (7.11.0):
- GoogleUtilities/Network (7.11.1):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (7.11.0)"
- GoogleUtilities/Reachability (7.11.0):
- "GoogleUtilities/NSData+zlib (7.11.1)"
- GoogleUtilities/Reachability (7.11.1):
- GoogleUtilities/Logger
- GoogleUtilities/UserDefaults (7.11.0):
- GoogleUtilities/UserDefaults (7.11.1):
- GoogleUtilities/Logger
- nanopb (2.30909.0):
- nanopb/decode (= 2.30909.0)
Expand All @@ -80,7 +80,7 @@ PODS:
- Flutter
- permission_handler_apple (9.0.4):
- Flutter
- PromisesObjC (2.1.1)
- PromisesObjC (2.2.0)
- receive_sharing_intent (0.0.1):
- Flutter
- uni_links (0.0.1):
Expand Down Expand Up @@ -158,27 +158,27 @@ SPEC CHECKSUMS:
firebase_core: 6242f038aefa4582e028536e71312f7e3a41e6bb
firebase_messaging: ee61b8065c395a117864224e3031729e656232af
FirebaseCore: 988754646ab3bd4bdcb740f1bfe26b9f6c0d5f2a
FirebaseCoreInternal: e301297f4c15a17489e48ed722d733b1578e0c02
FirebaseInstallations: 36b38c733fd37e50857e5e8d74138648f466f18c
FirebaseCoreInternal: d2b4acb827908e72eca47a9fd896767c3053921e
FirebaseInstallations: c58489c9caacdbf27d1da60891a87318e20218e0
FirebaseMessaging: e345b219fd15d325f0cf2fef28cb8ce00d851b3f
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_app_badger: b87fc231847b03b92ce1412aa351842e7e97932f
flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
flutter_native_timezone: 5f05b2de06c9776b4cc70e1839f03de178394d22
flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
GoogleDataTransport: 1c8145da7117bd68bbbed00cf304edb6a24de00f
GoogleUtilities: c2bdc4cf2ce786c4d2e6b3bcfd599a25ca78f06f
GoogleDataTransport: f0308f5905a745f94fb91fea9c6cbaf3831cb1bd
GoogleUtilities: 9aa0ad5a7bc171f8bae016300bfcfa3fb8425749
nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
PromisesObjC: ab77feca74fa2823e7af4249b8326368e61014cb
PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef
receive_sharing_intent: c0d87310754e74c0f9542947e7cbdf3a0335a3b1
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
webview_flutter_wkwebview: b7e70ef1ddded7e69c796c7390ee74180182971f

PODFILE CHECKSUM: 0a52d83fbddb1550bcb1a6192e3fd985e3f22580
PODFILE CHECKSUM: e704e7bcf1390f0a0f9e6894b8154aeda97f153d

COCOAPODS: 1.11.3
COCOAPODS: 1.12.1

This file was deleted.

23 changes: 23 additions & 0 deletions lib/components/animated_padding_component.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'package:flutter/material.dart';

class AnimatedPaddingComponent extends StatefulWidget {
final EdgeInsetsGeometry padding;
final Widget child;

const AnimatedPaddingComponent({super.key, required this.padding, required this.child});

@override
AnimatedPaddingComponentState createState() => AnimatedPaddingComponentState();
}

class AnimatedPaddingComponentState extends State<AnimatedPaddingComponent> {

@override
Widget build(BuildContext context) {
return AnimatedPadding(
duration: const Duration(milliseconds: 500),
padding: widget.padding,
child: widget.child
);
}
}
108 changes: 60 additions & 48 deletions lib/components/bottom_navigation_bar.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@


import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';

import 'animated_padding_component.dart';

class BottomNavigation extends StatefulWidget {
final int pageCount;
final Function(int) onPageChange;
Expand Down Expand Up @@ -39,62 +44,58 @@ class BottomNavigationState extends State<BottomNavigation> with TickerProviderS
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 1,
child: Align(
alignment: Alignment.bottomLeft,
child: TextButton(
onPressed: _selectedIndex == 0
? () {
Navigator.pop(context);
}
: () {
setState(() {
_selectedIndex--;
widget.onPageChange(_selectedIndex);
});
},
child: const Text(
"Back",
style: TextStyle(color: Colors.grey),
),
flex: 3,
child: TextButton(
onPressed: _selectedIndex == 0
? () {
Navigator.pop(context);
}
: () {
setState(() {
_selectedIndex--;
widget.onPageChange(_selectedIndex);
});
},
child: const AutoSizeText(
"Back",
style: TextStyle(color: Colors.grey),
maxLines: 1,
),
),
),
Expanded(
flex: 1,
child: Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.only(bottom: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
_buildPageIndicator(0),
const SizedBox(width: 8.0),
_buildPageIndicator(1),
const SizedBox(width: 8.0),
_buildPageIndicator(2),
],
),
flex: 7,
child: AnimatedPaddingComponent(
padding: getPadding(_selectedIndex),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
_buildPageIndicator(0),
const SizedBox(width: 8),
_buildPageIndicator(1),
const SizedBox(width: 8),
_buildPageIndicator(2),
],
),
),
),
Expanded(
flex: 1,
child: Align(
alignment: Alignment.bottomRight,
child: TextButton(
onPressed: _selectedIndex == widget.pageCount - 1
? () {
Navigator.pop(context);
}
: () {
setState(() {
_selectedIndex++;
widget.onPageChange(_selectedIndex);
});
},
child: Text(_selectedIndex != 2 ? "Next" : "Connect now", style: const TextStyle(color: Colors.grey)),
flex: 3,
child: TextButton(
onPressed: _selectedIndex == widget.pageCount - 1
? () {
Navigator.pop(context);
}
: () {
setState(() {
_selectedIndex++;
widget.onPageChange(_selectedIndex);
});
},
child: AutoSizeText(
_selectedIndex != 2 ? "Next" : "Connect now",
style: const TextStyle(color: Colors.grey),
maxLines: 1,
),
),
),
Expand All @@ -104,6 +105,17 @@ class BottomNavigationState extends State<BottomNavigation> with TickerProviderS
);
}

getPadding(int selectedIndex) {
if (selectedIndex == 0) {
return const EdgeInsets.only(left: 34);
}
if (selectedIndex == 2) {
return const EdgeInsets.only(right: 34);
} else {
return const EdgeInsets.only();
}
}

Widget _buildPageIndicator(int index) {
bool isActive = index == _selectedIndex;
return AnimatedContainer(
Expand Down
47 changes: 0 additions & 47 deletions lib/components/hatch_image.dart

This file was deleted.

60 changes: 60 additions & 0 deletions lib/components/help_safe_area.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import 'dart:math' as math;

class HelpSafeArea extends StatelessWidget {
const HelpSafeArea({
super.key,
this.left = true,
this.top = true,
this.right = true,
this.minimum = EdgeInsets.zero,
this.maintainBottomViewPadding = false,
required this.child,
});

final bool left;
final bool top;
final bool right;
final EdgeInsets minimum;
final bool maintainBottomViewPadding;
final Widget child;

@override
Widget build(BuildContext context) {
assert(debugCheckHasMediaQuery(context));
final MediaQueryData data = MediaQuery.of(context);
EdgeInsets padding = data.padding;
// Bottom padding has been consumed - i.e. by the keyboard
if (maintainBottomViewPadding) {
padding = padding.copyWith(bottom: data.viewPadding.bottom);
}

return Container(
padding: EdgeInsets.only(
left: math.max(left ? padding.left : 0.0, minimum.left),
top: math.max(top ? padding.top : 0.0, minimum.top),
right: math.max(right ? padding.right : 0.0, minimum.right),
),
child: OverflowBox(
maxHeight: MediaQuery.of(context).size.height,
minHeight: MediaQuery.of(context).size.height,
child: MediaQuery.removePadding(
context: context,
removeLeft: left,
removeTop: top,
removeRight: right,
child: child,
),
),
);
}

@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(FlagProperty('left', value: left, ifTrue: 'avoid left padding'));
properties.add(FlagProperty('top', value: top, ifTrue: 'avoid top padding'));
properties.add(FlagProperty('right', value: right, ifTrue: 'avoid right padding'));
}
}
Loading

0 comments on commit 5e25c19

Please sign in to comment.