Skip to content

Commit

Permalink
added detail
Browse files Browse the repository at this point in the history
  • Loading branch information
drriguz committed Feb 21, 2025
1 parent 621f379 commit 470949c
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
41 changes: 41 additions & 0 deletions lib/src/screens/components/password_detail.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import 'package:cryptowl/main.dart';
import 'package:cryptowl/src/screens/components/passwords.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

class PasswordDetail extends ConsumerWidget {
const PasswordDetail({super.key});

@override
Widget build(BuildContext context, WidgetRef ref) {
final password = ref.watch(selectedPasswordProvider);
logger.fine("Selected password changed: ${password?.id}");
if (password == null) {
return Container();
}
return Column(
children: [
TextFormField(
style: TextStyle(fontSize: 14),
key: Key(password.id),
readOnly: true,
initialValue: password.id,
obscureText: false,
decoration: InputDecoration(
labelText: "ID",
),
),
TextFormField(
key: Key(password.id + password.title),
style: TextStyle(fontSize: 14),
readOnly: true,
initialValue: password.title,
obscureText: false,
decoration: InputDecoration(
labelText: "TITLE",
),
),
],
);
}
}
9 changes: 6 additions & 3 deletions lib/src/screens/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:responsive_framework/responsive_framework.dart';

import 'components/app_drawer.dart';
import 'components/password_categories.dart';
import 'components/password_detail.dart';
import 'components/passwords.dart';

class HomeScreen extends StatefulWidget {
Expand Down Expand Up @@ -80,10 +81,12 @@ class _HomeScreenState extends State<HomeScreen> {
child: PasswordList(),
),
),
Container(
constraints: const BoxConstraints(maxWidth: 100),
Expanded(
child: Center(
child: Text("Details"),
child: SizedBox(
width: 200,
child: PasswordDetail(),
),
),
),
],
Expand Down

0 comments on commit 470949c

Please sign in to comment.