Skip to content

Commit

Permalink
chore: get started fixes (#148)
Browse files Browse the repository at this point in the history
[Notion
task](https://www.notion.so/leftclick/Fix-get-started-e324d9a0be544b2ea35e8634820d0fdc)

This PR uses our [custom
version](fujidaiti/smooth_sheets#222) of
smooth_sheets lib. So that we could control the
`minFlingVelocityToDismiss` and `minDragDistanceToDismiss` dismiss
params.

Also this PR sets all font letter spacing to `0` (to make fonts look
exactly like in figma) - keep that in mind because that might change the
markdown in some places.
  • Loading branch information
ice-orion authored Aug 20, 2024
1 parent 53b88ce commit 99e6a67
Show file tree
Hide file tree
Showing 33 changed files with 134 additions and 112 deletions.
20 changes: 5 additions & 15 deletions .github/workflows/CICD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ jobs:
channel: "stable"
cache: true
- run: flutter --version
- name: Bootstrap
id: bootstrap
run: |
cd main-repo
./scripts/bootstrap.sh
- name: Install dependencies
id: install-dependencies
run: |
Expand Down Expand Up @@ -145,11 +150,6 @@ jobs:
channel: "stable"
cache: true
- run: flutter --version
- name: Install dependencies
id: install-dependencies
run: |
cd main-repo
flutter pub get
- name: Detect context and set APP environment variables
id: setup-env
env:
Expand Down Expand Up @@ -236,16 +236,6 @@ jobs:
channel: "stable"
cache: true
- run: flutter --version
- name: Bootstrap
id: bootstrap
run: |
cd main-repo
./scripts/bootstrap.sh
- name: Install dependencies
id: install-dependencies
run: |
cd main-repo
melos run pub_get
- name: Detect context and set APP environment variables
id: setup-env
env:
Expand Down
Binary file modified assets/images/icons/1.5x/icon_block_information.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/icons/2.0x/icon_block_information.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/icons/3.0x/icon_block_information.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/icons/4.0x/icon_block_information.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/icons/icon_block_information copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions lib/app/constants/links.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class Links {
Links._();

static String terms = 'https://identity.io/terms';

static String privacy = 'https://identity.io/privacy';

static String identity = 'https://identity.io';
}
4 changes: 2 additions & 2 deletions lib/app/features/auth/data/models/auth_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class AuthenticationLoading extends AuthState with _$AuthenticationLoading {
}

@freezed
class UnAuthenticated extends AuthState with _$UnAuthenticated {
const factory UnAuthenticated() = _UnAuthenticated;
class Unauthenticated extends AuthState with _$Unauthenticated {
const factory Unauthenticated() = _Unauthenticated;
}

@freezed
Expand Down
6 changes: 2 additions & 4 deletions lib/app/features/auth/providers/auth_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ class Auth extends _$Auth {
}

Future<void> rehydrate() async {
state = const Authenticated(
authToken: AuthToken(access: 'access', refresh: 'refresh'),
);
state = const Unauthenticated();
}

Future<void> signUp({required String keyName}) async {
Expand Down Expand Up @@ -61,7 +59,7 @@ class Auth extends _$Auth {
try {
state = const AuthenticationLoading();
await Future<void>.delayed(const Duration(seconds: 2));
state = const UnAuthenticated();
state = const Unauthenticated();
} catch (error) {
state = AuthenticationFailure(message: error.toString());
rethrow;
Expand Down
31 changes: 13 additions & 18 deletions lib/app/features/auth/views/components/auth_footer/auth_footer.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:ice/app/extensions/asset_gen_image.dart';
import 'package:ice/app/constants/links.dart';
import 'package:ice/app/extensions/build_context.dart';
import 'package:ice/app/extensions/num.dart';
import 'package:ice/app/extensions/theme_data.dart';
import 'package:ice/generated/assets.gen.dart';
import 'package:ice/app/features/auth/views/components/identity_link/identity_link.dart';
import 'package:ice/app/services/browser/browser.dart';
import 'package:ice/l10n/i10n.dart';

enum FooterLink {
Expand All @@ -23,8 +24,8 @@ enum FooterLink {

VoidCallback get onPressed {
return switch (this) {
FooterLink.terms => () {},
FooterLink.privacy => () {},
FooterLink.terms => () => openUrlInAppBrowser(Links.terms),
FooterLink.privacy => () => openUrlInAppBrowser(Links.privacy),
_ => () {},
};
}
Expand Down Expand Up @@ -65,26 +66,20 @@ class AuthFooter extends HookWidget {
Text.rich(
TextSpan(
children: [
TextSpan(text: context.i18n.auth_secured_by),
const TextSpan(text: ' '),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Assets.images.icons.iconLoginIdentity.icon(size: 20.0.s),
),
const TextSpan(text: ' '),
TextSpan(
text: context.i18n.auth_identity_io,
style: TextStyle(
color: context.theme.appColors.primaryAccent,
text: context.i18n.auth_secured_by,
style: context.theme.appTextThemes.caption.copyWith(
color: context.theme.appColors.secondaryText,
),
recognizer: TapGestureRecognizer()..onTap = () {},
),
WidgetSpan(child: SizedBox(width: 6.0.s)),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: IdentityLink(),
),
],
),
textAlign: TextAlign.center,
style: context.theme.appTextThemes.caption.copyWith(
color: context.theme.appColors.secondaryText,
),
),
SizedBox(height: 20.0.s),
ConstrainedBox(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:ice/app/components/card/info_card.dart';
import 'package:ice/app/components/screen_offset/screen_bottom_offset.dart';
import 'package:ice/app/extensions/asset_gen_image.dart';
import 'package:ice/app/extensions/build_context.dart';
import 'package:ice/app/extensions/num.dart';
import 'package:ice/app/extensions/theme_data.dart';
import 'package:ice/app/features/auth/views/components/identity_link/identity_link.dart';
import 'package:ice/app/router/components/navigation_app_bar/navigation_app_bar.dart';
import 'package:ice/app/router/components/navigation_app_bar/navigation_close_button.dart';
import 'package:ice/generated/assets.gen.dart';
Expand All @@ -21,7 +21,7 @@ class IdentityInfo extends StatelessWidget {
NavigationAppBar.modal(
showBackButton: false,
title: Text(context.i18n.identity_key_name_title),
actions: [NavigationCloseButton()],
actions: [NavigationCloseButton(onPressed: () => context.pop())],
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 24.0.s),
Expand All @@ -37,18 +37,10 @@ class IdentityInfo extends StatelessWidget {
TextSpan(
children: [
TextSpan(text: context.i18n.identity_key_name_usage),
const TextSpan(text: ' '),
WidgetSpan(child: SizedBox(width: 6.0.s)),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Assets.images.icons.iconLoginIdentity.icon(size: 20.0.s),
),
const TextSpan(text: ' '),
TextSpan(
text: context.i18n.auth_identity_io,
style: context.theme.appTextThemes.caption.copyWith(
color: context.theme.appColors.primaryAccent,
),
recognizer: TapGestureRecognizer()..onTap = () {},
child: IdentityLink(),
),
],
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ class IdentityKeyNameInput extends HookWidget {
),
suffixIcon: notShowInfoIcon
? null
: TextInputIcons(
icons: [
IconButton(
icon: Assets.images.icons.iconBlockInformation.icon(
size: 20.0.s,
),
: TextInputIcons(icons: [
SizedBox.square(
dimension: 40.0.s,
child: IconButton(
icon: Assets.images.icons.iconBlockInformation.icon(),
onPressed: () {
hideKeyboardAndCallOnce(callback: () {
showSimpleBottomSheet<void>(
Expand All @@ -52,8 +51,8 @@ class IdentityKeyNameInput extends HookWidget {
});
},
),
],
),
),
]),
labelText: context.i18n.common_identity_key_name,
controller: controller,
validator: (String? value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import 'package:flutter/material.dart';
import 'package:ice/app/constants/links.dart';
import 'package:ice/app/extensions/extensions.dart';
import 'package:ice/app/services/browser/browser.dart';
import 'package:ice/generated/assets.gen.dart';

class IdentityLink extends StatelessWidget {
const IdentityLink({super.key});

@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => openUrlInAppBrowser(Links.identity),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Assets.images.icons.iconLoginIdentity.icon(size: 20.0.s),
SizedBox(width: 4.0.s),
Text(
context.i18n.auth_identity_io,
style: context.theme.appTextThemes.caption.copyWith(
color: context.theme.appColors.primaryAccent,
),
// Disabling text scaling to prevent multiple scaling
// when using this widget as a child of a WidgetSpan
// https://github.com/flutter/flutter/issues/126962
textScaler: TextScaler.linear(1),
)
],
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class FillProfile extends HookWidget {
title: context.i18n.fill_profile_title,
description: context.i18n.fill_profile_description,
icon: AuthHeaderIcon(
icon: Assets.images.icons.iconLoginIcelogo.icon(size: 36.0.s),
icon: Assets.images.icons.iconLoginIcelogo.icon(size: 44.0.s),
),
),
ScreenSideOffset.large(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class GetStartedPage extends HookWidget {
showBackButton: false,
title: context.i18n.get_started_title,
description: context.i18n.get_started_description,
icon: Assets.images.icons.iconLoginIcelogo.icon(size: 36.0.s),
icon: Assets.images.icons.iconLoginIcelogo.icon(size: 44.0.s),
children: [
ScreenSideOffset.large(
child: Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class IntroPage extends HookWidget {
ScaleEffect(
duration: 500.ms,
curve: Curves.easeOutBack,
delay: 10.seconds,
delay: 4.5.seconds,
),
],
child: Button(
Expand Down
2 changes: 1 addition & 1 deletion lib/app/features/core/providers/init_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ part 'init_provider.g.dart';
Future<void> initApp(InitAppRef ref) async {
Nostr.initialize();
await ref.read(envProvider.future);
await Future.wait(<Future<void>>[
await Future.wait([
ref.read(appTemplateProvider.future),
ref.read(authProvider.notifier).rehydrate(),
]);
Expand Down
2 changes: 1 addition & 1 deletion lib/app/features/nostr/providers/relays_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Relays extends _$Relays {
@override
Map<String, NostrRelay> build() {
ref.listen(authProvider, (AuthState? previous, AuthState next) {
if (next is UnAuthenticated) {
if (next is Unauthenticated) {
_closeAll();
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:ice/app/extensions/theme_data.dart';
import 'package:ice/app/features/wallet/model/coin_data.dart';
import 'package:ice/app/features/wallet/model/network_type.dart';
import 'package:ice/app/features/wallet/views/pages/coins_flow/coin_receive_modal/model/coin_receive_modal_data.dart';
import 'package:ice/app/features/wallet/views/pages/coins_flow/network_list/network_list_view.dart';
import 'package:ice/app/features/wallet/views/pages/coins_flow/providers/send_asset_form_provider.dart';
import 'package:ice/app/features/wallet/views/pages/wallet_page/components/balance/balance_actions.dart';
import 'package:ice/app/router/app_routes.dart';
Expand Down Expand Up @@ -74,7 +73,7 @@ class Balance extends ConsumerWidget {
},
onSend: () {
ref.read(sendAssetFormControllerProvider().notifier).setCoin(coinData);
NetworkSelectSendRoute(viewType: NetworkListViewType.send).push<void>(context);
NetworkSelectSendRoute().push<void>(context);
},
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class CoinAddressTile extends HookConsumerWidget {
SizedBox(
width: 6.0.s,
),
Assets.images.icons.iconBlockInformation.icon(size: 14.0.s),
Assets.images.icons.iconBlockInformation.icon(size: 20.0.s),
],
),
SizedBox(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:ice/app/extensions/build_context.dart';
import 'package:ice/app/extensions/theme_data.dart';
import 'package:ice/app/features/wallet/model/coin_data.dart';
import 'package:ice/app/features/wallet/views/pages/coins_flow/coin_receive_modal/components/coins_list_view.dart';
import 'package:ice/app/features/wallet/views/pages/coins_flow/network_list/network_list_view.dart';
import 'package:ice/app/features/wallet/views/pages/coins_flow/receive_coins/providers/receive_coins_form_provider.dart';
import 'package:ice/app/router/app_routes.dart';
import 'package:ice/app/router/components/sheet_content/sheet_content.dart';
Expand All @@ -19,7 +18,7 @@ class ReceiveCoinModalPage extends ConsumerWidget {
body: CoinsListView(
onCoinItemTap: (CoinData coin) {
ref.read(receiveCoinsFormControllerProvider.notifier).setCoin(coin);
NetworkSelectReceiveRoute(viewType: NetworkListViewType.receive).push<void>(context);
NetworkSelectReceiveRoute().push<void>(context);
},
type: CoinsListViewType.receive,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import 'package:ice/app/extensions/extensions.dart';
import 'package:ice/app/features/wallet/components/arrival_time/arrival_time.dart';
import 'package:ice/app/features/wallet/components/network_fee/network_fee.dart';
import 'package:ice/app/features/wallet/model/network_type.dart';
import 'package:ice/app/features/wallet/views/pages/coins_flow/network_list/network_list_view.dart';
import 'package:ice/app/features/wallet/views/pages/coins_flow/providers/send_asset_form_provider.dart';
import 'package:ice/app/features/wallet/views/pages/coins_flow/send_coins/components/buttons/coin_button.dart';
import 'package:ice/app/features/wallet/views/pages/coins_flow/send_coins/components/buttons/network_button.dart';
Expand Down Expand Up @@ -73,8 +72,7 @@ class SendCoinsForm extends HookConsumerWidget {
NetworkButton(
networkType: formController.selectedNetwork,
onTap: () {
NetworkSelectSendRoute(viewType: NetworkListViewType.send)
.push<void>(context);
NetworkSelectSendRoute().push<void>(context);
},
),
SizedBox(height: 12.0.s),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:ice/app/features/wallet/model/coin_data.dart';
import 'package:ice/app/features/wallet/views/pages/coins_flow/coin_receive_modal/components/coins_list_view.dart';
import 'package:ice/app/features/wallet/views/pages/coins_flow/network_list/network_list_view.dart';
import 'package:ice/app/features/wallet/views/pages/coins_flow/providers/send_asset_form_provider.dart';
import 'package:ice/app/router/app_routes.dart';
import 'package:ice/app/router/components/sheet_content/sheet_content.dart';
Expand All @@ -17,7 +16,7 @@ class SendCoinModalPage extends ConsumerWidget {
body: CoinsListView(
onCoinItemTap: (CoinData coin) {
ref.read(sendAssetFormControllerProvider().notifier).setCoin(coin);
NetworkSelectSendRoute(viewType: NetworkListViewType.send).push<void>(context);
NetworkSelectSendRoute().push<void>(context);
},
),
);
Expand Down
Loading

0 comments on commit 99e6a67

Please sign in to comment.