Skip to content

Commit

Permalink
removed theme.dart .. also updated ImportExpensePage call as the para…
Browse files Browse the repository at this point in the history
…ms are optional .. restarted renderImageIcon to be used for icon rendering
  • Loading branch information
Ashish Sharma committed Dec 14, 2023
1 parent 40f96bc commit 901b5da
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 60 deletions.
14 changes: 6 additions & 8 deletions lib/common_widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,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 @@ -201,10 +200,9 @@ InputDecoration customUnderlineInputdecoration(
suffixIcon: suffixicon ?? const SizedBox());
}


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

Widget customContactUi({required Function()? onTap}){
Widget customContactUi({required Function()? onTap}) {
return InkWell(
onTap: onTap,
child: const Icon(
Expand Down
6 changes: 2 additions & 4 deletions lib/detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ class _TagDetailState extends State<TagDetailPage> {
return Scaffold(
appBar: AppBar(
leading: const BackButton(),
title: Row(children: [
renderImageIcon('assets/images/tag.png'),
Text(widget.title)
]),
title: Row(
children: [renderImageIcon(Icons.turned_in), Text(widget.title)]),
actions: <Widget>[
appBarSearchIcon(null),
appBarEditIcon(null),
Expand Down
20 changes: 5 additions & 15 deletions lib/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ class _HomePageState extends State<HomePage> {
);
}

var newFiles = <File>[];
@override
Widget build(BuildContext context) {
return Scaffold(
Expand All @@ -118,18 +117,10 @@ class _HomePageState extends State<HomePage> {
itemBuilder: (context, index) {
return ListTile(
tileColor: tileBackgroundColor,
leading: _homePageItems[index].type == HomePageItemType.tag
? const Icon(
Icons.turned_in,
size: 35,
color: kTextColor,
)
: const Icon(
Icons.link,
size: 35,
color: kTextColor,
),
// renderImageIcon(_homePageItems[index].type == HomePageItemType.tag ?FileConstants.tag : FileConstants.link),
leading: renderImageIcon(
_homePageItems[index].type == HomePageItemType.tag
? Icons.turned_in
: Icons.link),
onTap: () {
moveToTagDetailScreen(_homePageItems[index].title);
},
Expand Down Expand Up @@ -169,8 +160,7 @@ class _HomePageState extends State<HomePage> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
ImportExpensePage(files: newFiles, text: "")));
builder: (context) => const ImportExpensePage()));
}),
),
);
Expand Down
37 changes: 27 additions & 10 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:kilvish/home_screen.dart';
import 'package:kilvish/signup_screen.dart';
import 'package:kilvish/utils/theme.dart';
import 'package:receive_sharing_intent/receive_sharing_intent.dart';
import 'style.dart';
import 'dart:io';
Expand Down Expand Up @@ -54,15 +53,33 @@ class _MainScreenState extends State<Kilvish> {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Kilvish App',
theme:theme(),
home:
// _pageToShow == "SignupPage"
// ? const SignUpPage()
// :
//HandleShare(files: newFiles, text: ""),
HomePage()
debugShowCheckedModeBanner: false,
title: 'Kilvish App',
theme: theme(),
home:
// _pageToShow == "SignupPage"
// ? const SignUpPage()
// :
//HandleShare(files: newFiles, text: ""),
HomePage());
}

ThemeData theme() {
return ThemeData(
backgroundColor: kWhitecolor,
fontFamily: "Roboto",
appBarTheme: appBarTheme(),
);
}

AppBarTheme appBarTheme() {
// ignore: prefer_const_constructors
return AppBarTheme(
elevation: 2,
backgroundColor: primaryColor,
iconTheme: const IconThemeData(
color: kWhitecolor,
),
);
}
}
23 changes: 0 additions & 23 deletions lib/utils/theme.dart

This file was deleted.

0 comments on commit 901b5da

Please sign in to comment.