Skip to content

Commit

Permalink
added various details
Browse files Browse the repository at this point in the history
  • Loading branch information
sapatevaibhav committed Nov 13, 2023
1 parent 0fec617 commit 438bdc3
Show file tree
Hide file tree
Showing 48 changed files with 67 additions and 402 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
4 changes: 4 additions & 0 deletions android/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#ffffff</color>
</resources>
6 changes: 0 additions & 6 deletions assets/android/res/mipmap-anydpi-v26/ic_launcher.xml

This file was deleted.

Binary file removed assets/android/res/mipmap-hdpi/ic_launcher.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed assets/android/res/mipmap-mdpi/ic_launcher.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed assets/android/res/mipmap-xhdpi/ic_launcher.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed assets/android/res/mipmap-xxhdpi/ic_launcher.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed assets/android/res/mipmap-xxxhdpi/ic_launcher.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added assets/fg.png
24 changes: 9 additions & 15 deletions lib/AddModal.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// ignore_for_file: prefer_const_constructors, sized_box_for_whitespace
import 'package:flutter/material.dart';
import 'package:password_manager/Model/password_model.dart';
import 'constants.dart';

class AddModal extends StatefulWidget {
final Function(String, String, String) onAddPassword;
Expand Down Expand Up @@ -78,28 +76,24 @@ class _AddModalState extends State<AddModal> {
style: ButtonStyle(
elevation: MaterialStateProperty.all(5),
shadowColor:
MaterialStateProperty.all(Constants.buttonBackground),
MaterialStateProperty.all(
Color.fromARGB(255, 55, 114, 255)),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(24.0),
side: BorderSide(color: Constants.buttonBackground),
side: BorderSide(color: Color.fromARGB(255, 55, 114, 255)),
),
),
backgroundColor:
MaterialStateProperty.all(Constants.buttonBackground),
MaterialStateProperty.all(
Color.fromARGB(255, 55, 114, 255)),
),
onPressed: () async {
final username = usernameController.text;
final description = descriptionController.text;
final password = passwordController.text;

Constants.passwordData.add(
passwords(
userName: username,
description: description,
password: password,
),
);


widget.onAddPassword(username, description, password);
Navigator.pop(context);
Expand All @@ -111,7 +105,7 @@ class _AddModalState extends State<AddModal> {
),
),
SizedBox(
height: 20,
height: 270,
),
SizedBox(
height: 30,
Expand All @@ -136,14 +130,14 @@ class _AddModalState extends State<AddModal> {
padding: EdgeInsets.fromLTRB(20, 5, 5, 5),
child: Icon(
icon,
color: Constants.searchGrey,
color: Color.fromARGB(255, 82, 101, 120),
),
),
filled: true,
contentPadding: EdgeInsets.all(16),
hintText: hintText,
hintStyle: TextStyle(
color: Constants.searchGrey, fontWeight: FontWeight.w500),
color: Color.fromARGB(255, 82, 101, 120), fontWeight: FontWeight.w500),
fillColor: Color.fromARGB(247, 232, 235, 237),
border: OutlineInputBorder(
borderSide: BorderSide(
Expand Down
42 changes: 0 additions & 42 deletions lib/constants.dart

This file was deleted.

62 changes: 37 additions & 25 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
import 'package:password_manager/AddModal.dart';
import 'package:password_manager/DatabaseHelper.dart';
import 'package:password_manager/Model/password_model.dart';
import 'package:password_manager/constants.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();
Expand Down Expand Up @@ -33,6 +32,7 @@ class _MyAppState extends State<MyApp> {
primarySwatch: Colors.blue,
),
home: HomePage(),
debugShowCheckedModeBanner: false,
);
}
}
Expand Down Expand Up @@ -93,34 +93,45 @@ class _HomePageState extends State<HomePage> {
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
floatingActionButton: FloatingActionButton(
onPressed: () => bottomModal(context),
backgroundColor: Constants.fabBackground,
backgroundColor: Color.fromARGB(255, 55, 114, 255),
child: Icon(Icons.add),
),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.fromLTRB(8.0, 0, 8, 0),
child: Column(
children: [
SizedBox(height: 15),
headingText("Saved Passwords"),
SizedBox(
height: 10,
),
passwordData.isEmpty
? Center(heightFactor: 15,
child: Text(
"There isn't any entry available",
style: TextStyle(fontSize: 20,color: Colors.redAccent),
))
: ListView.builder(
child: Column(
children: [
SizedBox(height: 15),
headingText("Passwords Manager"),
Divider(
color: Colors.blueAccent,
height: 30,
thickness: 2,
),
passwordData.isEmpty
? Center(
heightFactor: 20,
child: Text(
"There isn't any entry available",
style:
TextStyle(fontSize: 20, color: Colors.blueAccent),
))
: Padding(
padding: const EdgeInsets.all(8.0),
child: ListView.builder(
shrinkWrap: true,
itemCount: passwordData.length,
itemCount: passwordData.length * 2 - 1,
itemBuilder: (context, index) {
final password = passwordData[index];
if (index.isOdd) {
return Divider(
height: 1, thickness: 1, color: Colors.black);
}

final passwordIndex = index ~/ 2;
final password = passwordData[passwordIndex];

return Dismissible(
key: Key(password.userName),
onDismissed: (direction) {
deletePassword(index);
deletePassword(passwordIndex);
},
background: Container(
color: Colors.red,
Expand All @@ -133,14 +144,15 @@ class _HomePageState extends State<HomePage> {
],
),
),
child: passwordTile(password, index, context, () {
deletePassword(index);
child: passwordTile(
password, passwordIndex, context, () {
deletePassword(passwordIndex);
}),
);
},
),
],
),
)
],
),
),
),
Expand Down
4 changes: 0 additions & 4 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
import FlutterMacOS
import Foundation

import path_provider_foundation
import shared_preferences_foundation
import sqflite

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
}
Loading

0 comments on commit 438bdc3

Please sign in to comment.