Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
saiankit committed Nov 20, 2022
1 parent 83123ac commit 9b69694
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 35 deletions.
13 changes: 9 additions & 4 deletions lib/components/documentCard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class DocumentCard extends StatelessWidget {
children: [
Text(
document.title,
overflow: TextOverflow.ellipsis,
style: TextStyles.t12.apply(
color: Colors.white,
),
Expand All @@ -49,10 +50,14 @@ class DocumentCard extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
document.primaryDetail.content,
style: TextStyles.t20.apply(
color: Colors.white,
Expanded(
child: Text(
document.primaryDetail.content,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyles.t20.apply(
color: Colors.white,
),
),
),
IconButton(
Expand Down
9 changes: 9 additions & 0 deletions lib/providers/fieldsProvider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,13 @@ class FieldsProvider extends ChangeNotifier {
primaryContentDetailController.clear();
documentDetailController.clear();
}

bool validate() {
if (documentDetailController.text != '' ||
primaryContentDetailController.text != '' ||
primaryNameDetailController.text != '') {
return false;
}
return true;
}
}
1 change: 0 additions & 1 deletion lib/providers/navBarProvider.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:doxbox/views/home/home_screen.dart';
import 'package:flutter/material.dart';

class BottomNavBarProvider extends ChangeNotifier {
Expand Down
9 changes: 3 additions & 6 deletions lib/services/migrate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ class Migrate {
for (int x = 1; x < paths.length; x++) {
String folder = paths[x];
if (folder != "Android") {
newPath += "/" + folder;
newPath += "/$folder";
} else {
break;
}
}
newPath = newPath + "/Documents";
newPath = "$newPath/Documents";
directory = Directory(newPath);
} else {
return false;
Expand All @@ -55,8 +55,7 @@ class Migrate {
await directory.create(recursive: true);
}
if (await directory.exists()) {
print(fileName);
File exportFile = File(directory.path + "/$fileName");
File exportFile = File("${directory.path}/$fileName");
await exportFile.writeAsString(csvData);

return true;
Expand Down Expand Up @@ -89,8 +88,6 @@ class Migrate {

var _listData = await CSV.parse(file);

print(_listData.length);

for (var i = 1; i < _listData.length; i++) {
List<dynamic> doc = _listData[i];
var title = doc[1];
Expand Down
18 changes: 16 additions & 2 deletions lib/views/details/details_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,25 @@ class DetailWidget extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(detail.name, style: TextStyles.t12),
Expanded(
child: Text(
detail.name,
maxLines: 5,
overflow: TextOverflow.ellipsis,
style: TextStyles.t12,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(detail.content, style: TextStyles.t20),
Expanded(
child: Text(
detail.content,
maxLines: 5,
overflow: TextOverflow.ellipsis,
style: TextStyles.t20,
),
),
IconButton(
onPressed: () {
FlutterClipboard.copy(detail.content).then(
Expand Down
10 changes: 7 additions & 3 deletions lib/views/upload/upload_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ class UploadScreen extends StatelessWidget {
builder: (context, navBarViewModel, _) {
return ElevatedButton(
onPressed: () {
fieldsProvider.addDocument();
navBarViewModel.changeNavBarSelectedIndex(0);
if (fieldsProvider.validate()) {
fieldsProvider.addDocument();
navBarViewModel.changeNavBarSelectedIndex(0);
}
},
style: ElevatedButton.styleFrom(
primary: Nord.orange,
primary: fieldsProvider.validate()
? Nord.orange
: Nord.nord2,
// minimumSize: Size.fromHeight(Converts.c48),
),
child: Text(
Expand Down
31 changes: 12 additions & 19 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.2"
version: "2.9.0"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -112,14 +112,7 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
version: "1.2.1"
checked_yaml:
dependency: transitive
description:
Expand All @@ -140,7 +133,7 @@ packages:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.1.1"
code_builder:
dependency: transitive
description:
Expand Down Expand Up @@ -189,7 +182,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.3.1"
ffi:
dependency: transitive
description:
Expand Down Expand Up @@ -379,21 +372,21 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
version: "0.12.12"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
version: "0.1.5"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -428,7 +421,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.2"
path_drawing:
dependency: transitive
description:
Expand Down Expand Up @@ -664,7 +657,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.2"
version: "1.9.0"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -692,21 +685,21 @@ packages:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.1.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.9"
version: "0.4.12"
timing:
dependency: transitive
description:
Expand Down

0 comments on commit 9b69694

Please sign in to comment.