Skip to content

Commit

Permalink
import screen (#21)
Browse files Browse the repository at this point in the history
* import screen

* personselector screen

* some refactoring changes

* contact screen , image picker, tag

* removed theme.dart .. also updated ImportExpensePage call as the params are optional .. restarted renderImageIcon to be used for icon rendering

* simplied import expense screen rendering logic .. reusing tags layout from tags screen .. the to field also use the same tag

---------

Co-authored-by: Ashish Sharma <[email protected]>
  • Loading branch information
Ruchi71 and Ashish Sharma authored Dec 15, 2023
1 parent 71c02ba commit 2b51a41
Show file tree
Hide file tree
Showing 21 changed files with 531 additions and 208 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.9.21'
repositories {
google()
mavenCentral()
Expand Down
Binary file added assets/fonts/Roboto-Regular.ttf
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
125 changes: 108 additions & 17 deletions lib/common_widgets.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import 'package:flutter/material.dart';
import 'package:jiffy/jiffy.dart';
import 'package:kilvish/constants/dimens_constants.dart';
import 'style.dart';
import 'models.dart';

Widget appBarMenu(Function()? onPressedAction) {
return IconButton(
icon: const Icon(Icons.menu),
icon: const Icon(
Icons.menu,
color: kWhitecolor,
),
onPressed: onPressedAction,
);
}
Expand Down Expand Up @@ -82,12 +86,11 @@ Widget renderMainBottomButton(String text, Function()? onPressed,
]);
}

Widget renderImageIcon(String url) {
return Image.asset(
url,
width: 30,
height: 30,
fit: BoxFit.fitWidth,
Widget renderImageIcon(IconData icon) {
return Icon(
icon,
size: 35,
color: kWhitecolor,
);
}

Expand Down Expand Up @@ -128,20 +131,25 @@ Widget renderTag(
);
}

Widget renderPrimaryColorLabel({required String text}) {
return renderLabel(text: text, color: primaryColor);
Widget renderPrimaryColorLabel(
{required String text,
double topSpacing = DimensionConstants.leftPadding15}) {
return renderLabel(text: text, color: primaryColor, topSpacing: topSpacing);
}

Widget renderLabel(
{required String text,
required Color color,
double fontSize = defaultFontSize}) {
return Align(
alignment: Alignment.centerLeft,
child: Text(
text,
style: TextStyle(color: color, fontSize: fontSize),
));
Color color = inactiveColor,
double fontSize = defaultFontSize,
double topSpacing = 0}) {
return Container(
margin: EdgeInsets.only(top: topSpacing),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
text,
style: TextStyle(color: color, fontSize: fontSize),
)));
}

Widget renderHelperText({required String text}) {
Expand All @@ -150,3 +158,86 @@ Widget renderHelperText({required String text}) {
child: renderLabel(
text: text, color: inactiveColor, fontSize: smallFontSize));
}

//-------------------------Custom Text--------------------

Widget customText(String text, Color textColor, double size, fontWeight,
{int maxLine = 1,
TextAlign? align,
TextOverflow? overflow,
TextDecoration? textDecoration}) {
return Text(
text,
textAlign: align,
maxLines: maxLine,
overflow: overflow,
style: TextStyle(
decoration: textDecoration,
color: textColor,
fontSize: size,
fontWeight: fontWeight,
),
);
}

// -------------- form header text -----------------------------------
Widget headertext(String text) {
return customText(text, primaryColor, largeFontSize,
FontSizeWeightConstants.fontWeightBold);
}

Widget appBarTitleText(String text) {
return customText(
text, kWhitecolor, titleFontSize, FontSizeWeightConstants.fontWeightBold);
}

// -------------------- Textfield underline inputdecoration --------------------

InputDecoration customUnderlineInputdecoration(
{required String hintText,
required Color bordersideColor,
Widget? suffixicon}) {
return InputDecoration(
hintText: hintText,
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: bordersideColor),
),
suffixIcon: suffixicon ?? const SizedBox());
}

// ------------------ contact ui --------------------------

Widget customContactUi({required Function()? onTap}) {
return InkWell(
onTap: onTap,
child: const Icon(
Icons.contact_page,
color: primaryColor,
size: 35,
));
}

Widget renderTagGroup(
{required Set<Tag> tags,
required dynamic Function() onPressed,
TagStatus status = TagStatus.unselected}) {
if (tags.isEmpty) {
return const Text('No tags found ..',
style: TextStyle(color: inactiveColor));
}

return Wrap(
direction: Axis.horizontal,
crossAxisAlignment: WrapCrossAlignment.start,
spacing: 5,
runSpacing: 10,
children: tags.map((tag) {
return renderTag(
text: tag.name,
status: status,
isUpdated: false,
onPressed: onPressed);
//onPressed: () => executeOnTagButtonPress(tag: tag, status: status));
}).toList(),
);
}
11 changes: 6 additions & 5 deletions lib/constants/dimens_constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:flutter/widgets.dart';
class DimensionConstants {
//Circular
static const double circular20 = 20.0;
static const double circular15 = 15.0;

//Padding
static const double bottomPadding8 = 8.0;
Expand All @@ -21,7 +22,9 @@ class DimensionConstants {

//Height
static const double imageHeight30 = 30.0;
static const double containerHeight40 = 40.0;
static const double containerHeight50 = 50.0;
static const double containerHeight200 = 200.0;
static const double containerHeight60 = 60.0;
static const double sizedBoxHeight5 = 5.0;

Expand All @@ -40,14 +43,12 @@ class FileConstants {
static const String icSend = "assets/images/ic_send.png";
static const String icBack = "assets/images/ic_back.png";
static const String icShareMedia = "assets/images/ic_share_media.png";
static const String kilvish = 'assets/images/kilvish.png';
static const String tag = 'assets/images/tag.png';
static const String link = 'assets/images/link.png';
}

class FontSizeWeightConstants {
//Font Size
static const double fontSize14 = 14.0;
static const double fontSize20 = 20.0;
static const double fontSize24 = 24.0;

//Font Weight
static const FontWeight fontWeightBold = FontWeight.bold;
static const FontWeight fontWeightNormal = FontWeight.normal;
Expand Down
2 changes: 1 addition & 1 deletion lib/detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class _TagDetailState extends State<TagDetailPage> {
appBar: AppBar(
leading: const BackButton(),
title: Row(
children: [renderImageIcon('images/tag.png'), Text(widget.title)]),
children: [renderImageIcon(Icons.turned_in), Text(widget.title)]),
actions: <Widget>[
appBarSearchIcon(null),
appBarEditIcon(null),
Expand Down
107 changes: 0 additions & 107 deletions lib/handle_share.dart

This file was deleted.

Loading

0 comments on commit 2b51a41

Please sign in to comment.