Skip to content

Commit

Permalink
Merge branch 'main' into feat/implement-proposal-details-page-redirec…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
Zied-Dahmani authored Aug 31, 2024
2 parents b358140 + fb7d8e9 commit a9c5118
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 30 deletions.
2 changes: 1 addition & 1 deletion ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class BottomNavigationView extends StatelessWidget {
return BlocBuilder<BottomNavigationBloc, BottomNavigationState>(
builder: (context, BottomNavigationState state) {
return Scaffold(
extendBody: true,
bottomNavigationBar: DecoratedBox(
decoration: BoxDecoration(
color: context.isDarkTheme
Expand Down
24 changes: 15 additions & 9 deletions lib/ui/profile/components/dao_widget.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:hypha_wallet/core/network/models/dao_data_model.dart';
import 'package:hypha_wallet/design/hypha_card.dart';
Expand Down Expand Up @@ -58,15 +59,20 @@ class DaoWidget extends StatelessWidget {
),
),
const SizedBox(width: 8),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(dao.settingsDaoTitle, style: context.hyphaTextTheme.smallTitles),
Text(
'dao.hypha.earth/${dao.settingsDaoUrl}',
style: context.hyphaTextTheme.reducedTitles.copyWith(color: HyphaColors.primaryBlu),
),
],
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(dao.settingsDaoTitle, style: context.hyphaTextTheme.smallTitles),
AutoSizeText(
minFontSize: 12,
'dao.hypha.earth/${dao.settingsDaoUrl}',
style: context.hyphaTextTheme.reducedTitles.copyWith(color: HyphaColors.primaryBlu),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
),
)
],
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,13 @@ class HyphaProposalsActionCard extends StatelessWidget {
onTap: () {},
),
const SizedBox(width: 5),
Expanded(
Flexible(
child: Text(
daoName,
style: context.hyphaTextTheme.ralMediumSmallNote
.copyWith(color: HyphaColors.white),
.copyWith(color: context.isDarkTheme
? HyphaColors.white
: HyphaColors.darkBlack,),
maxLines: 1,
),
),
Expand Down
4 changes: 3 additions & 1 deletion lib/ui/proposals/list/components/proposals_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,16 @@ class ProposalsView extends StatelessWidget {
child: HyphaBodyWidget(
pageState: state.pageState,
success:(context) => Padding(
padding: const EdgeInsets.all(22),
padding: const EdgeInsets.symmetric(horizontal: 22),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 22,),
Text('${state.proposals.length} Active Proposals',style: context.hyphaTextTheme.ralMediumBody.copyWith(color: HyphaColors.midGrey ),),
const SizedBox(height: 20,),
Expanded(
child: ListView.separated(
padding: const EdgeInsets.only(bottom: 22),
itemBuilder: (BuildContext context,int index) => HyphaProposalsActionCard(proposalModel: state.proposals[index],),
separatorBuilder: (BuildContext context, int index) {
return const SizedBox(height: 16);
Expand Down
28 changes: 13 additions & 15 deletions lib/ui/shared/hypha_body_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,19 @@ class HyphaBodyWidget extends StatelessWidget {

@override
Widget build(BuildContext context) {
return SafeArea(
child: Builder(
builder: (context) {
switch (pageState) {
case PageState.initial:
return initial?.call(context) ?? const SizedBox.shrink();
case PageState.loading:
return loading?.call(context) ?? const Center(child: CircularProgressIndicator.adaptive());
case PageState.failure:
return failure?.call(context) ?? const HyphaErrorWidget();
case PageState.success:
return GestureDetector(onTap: () => FocusScope.of(context).unfocus(), child: success(context));
}
},
),
return Builder(
builder: (context) {
switch (pageState) {
case PageState.initial:
return initial?.call(context) ?? const SizedBox.shrink();
case PageState.loading:
return loading?.call(context) ?? const Center(child: CircularProgressIndicator.adaptive());
case PageState.failure:
return failure?.call(context) ?? const HyphaErrorWidget();
case PageState.success:
return GestureDetector(onTap: () => FocusScope.of(context).unfocus(), child: success(context));
}
},
);
}
}
10 changes: 9 additions & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.11.0"
auto_size_text:
dependency: "direct main"
description:
name: auto_size_text
sha256: "3f5261cd3fb5f2a9ab4e2fc3fba84fd9fcaac8821f20a1d4e71f557521b22599"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
bip32:
dependency: transitive
description:
Expand Down Expand Up @@ -1675,7 +1683,7 @@ packages:
source: hosted
version: "3.0.1"
win32:
dependency: "direct main"
dependency: transitive
description:
name: win32
sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a"
Expand Down
5 changes: 5 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2


# Resize text size based on the available place.
auto_size_text: ^3.0.0


# UI and Navigation
get: ^4.6.5

Expand Down

0 comments on commit a9c5118

Please sign in to comment.