Skip to content

Commit

Permalink
chore :ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Divyakumar21202 committed Mar 30, 2024
1 parent bb882f7 commit 712ae14
Show file tree
Hide file tree
Showing 5 changed files with 203 additions and 11 deletions.
42 changes: 42 additions & 0 deletions lib/features/User-Data-Widgets/sigle_user_data_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import 'package:flutter/material.dart';
import 'package:jp_book/features/User-Data-Widgets/single_user_total_widget.dart';
import 'package:jp_book/widgets/single_entry_widget.dart';

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

@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
const SingleUserTotalWidget(),
const SizedBox(height: 7),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 7.0, vertical: 14),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Icon(Icons.person_off_rounded),
Icon(Icons.currency_rupee_sharp),
Icon(Icons.wechat_sharp),
Icon(Icons.sms_outlined),
],
),
),
Expanded(
child: ListView.builder(
itemCount: 20,
itemBuilder: ((context, index) {
return const SingleEntryWidget(
balance: '79',
description: 'this is the rupees i recieve',
time: '25 Mar 24 05:30 PM',
);
})),
),
],
),
);
}
}
61 changes: 61 additions & 0 deletions lib/features/User-Data-Widgets/single_user_total_widget.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import 'package:flutter/material.dart';

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

@override
Widget build(BuildContext context) {
return Container(
color: Colors.blue,
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 14),
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(7),
),
padding: const EdgeInsets.symmetric(vertical: 14, horizontal: 14),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'You will get',
style: Theme.of(context).textTheme.titleMedium,
),
Text(
'Rs 79',
style: Theme.of(context)
.textTheme
.titleMedium!
.copyWith(color: Colors.red),
)
],
),
const Divider(color: Colors.grey),
Row(
children: [
const Icon(
Icons.perm_contact_calendar_outlined,
),
const SizedBox(width: 7),
Text(
'Set Collection reminder',
style: Theme.of(context).textTheme.bodyLarge,
),
const Expanded(child: SizedBox()),
Text(
'SET DATE',
style: Theme.of(context)
.textTheme
.titleSmall!
.copyWith(color: Colors.blue),
),
],
)
],
),
),
);
}
}
21 changes: 10 additions & 11 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:jp_book/features/User-Data-Widgets/user_total.dart';

void main() {
runApp(
Expand All @@ -13,9 +12,16 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
darkTheme: ThemeData.dark(),
theme: ThemeData(
iconTheme: const IconThemeData(color: Colors.white, size: 40),
scaffoldBackgroundColor: Colors.grey[200],
appBarTheme: const AppBarTheme(color: Colors.blue, elevation: 0),
iconTheme: const IconThemeData(color: Colors.blue, size: 28),
textTheme: const TextTheme(
bodyMedium: TextStyle(
fontSize: 7,
color: Colors.black,
),
),
),
debugShowCheckedModeBanner: false,
home: const HomeScreen(),
Expand Down Expand Up @@ -65,14 +71,7 @@ class _HomeScreenState extends State<HomeScreen> {
setState(() {});
},
),
body: const Center(
child: Column(
children: [
UserTotal(credit: '345', debit: '500'),
Expanded(child: SizedBox()),
],
),
),
body: const HomeScreen(),
);
}
}
18 changes: 18 additions & 0 deletions lib/screens/home_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
import 'package:jp_book/features/User-Data-Widgets/user_total.dart';

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

@override
Widget build(BuildContext context) {
return const Center(
child: Column(
children: [
UserTotal(credit: '345', debit: '500'),
Expanded(child: SizedBox()),
],
),
);
}
}
72 changes: 72 additions & 0 deletions lib/widgets/single_entry_widget.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import 'package:flutter/material.dart';

class SingleEntryWidget extends StatelessWidget {
final String time;
final String balance;
final String description;

const SingleEntryWidget({
super.key,
required this.balance,
required this.description,
required this.time,
});

@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.symmetric(horizontal: 11, vertical: 11),
padding: const EdgeInsets.symmetric(vertical: 3.5, horizontal: 14),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(3),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
time,
style: Theme.of(context).textTheme.bodyLarge,
),
Card(
child: Padding(
padding: const EdgeInsets.all(2),
child: Text(
'Bal. rs $balance',
style: Theme.of(context).textTheme.labelLarge,
),
),
),
Text(
description,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.bodySmall,
),
],
),
),
Expanded(
flex: 1,
child: Text(
'Rs 50',
style: Theme.of(context).textTheme.titleSmall,
),
),
Expanded(
flex: 1,
child: Text(
'Rs 16',
style: Theme.of(context).textTheme.titleSmall,
),
)
],
),
);
}
}

0 comments on commit 712ae14

Please sign in to comment.