Skip to content

Commit

Permalink
Dev (#11)
Browse files Browse the repository at this point in the history
* completed search screen (#9)

* completed app
  • Loading branch information
vig31 authored Oct 27, 2023
1 parent df63b1b commit fd0f681
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 26 deletions.
2 changes: 1 addition & 1 deletion lib/helpers/extension/extension.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extension StringExtension on String {
String capitalize() {
return "${this[0].toUpperCase()}${this.substring(1).toLowerCase()}";
return "${this[0].toUpperCase()}${substring(1).toLowerCase()}";
}
}
6 changes: 2 additions & 4 deletions lib/helpers/utility.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import 'dart:developer';
import 'dart:io';
import 'dart:typed_data';
import 'package:html/parser.dart';
import 'package:html/dom.dart';
import 'package:pdf/widgets.dart' as pw;
import 'package:markdown/markdown.dart' as md;
import 'package:pdf/pdf.dart' as p;
import 'package:pdf/pdf.dart';
import 'package:http/http.dart' as http;
Expand Down Expand Up @@ -203,8 +201,8 @@ class Styler {
return pw.TextSpan(children: r);
}

pw.TextStyle? s = null;
pw.Divider? f = null;
pw.TextStyle? s;
pw.Divider? f;

// I only implmenented necessary ones, but follow the pattern

Expand Down
5 changes: 1 addition & 4 deletions lib/pages/crerateAndEditPage/createAndEditPage.view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ import 'package:awesome_notifications/awesome_notifications.dart';
import 'package:filesystem_picker/filesystem_picker.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:image_picker/image_picker.dart';
import 'package:notebook/helpers/utility.dart';
import 'package:notebook/pages/crerateAndEditPage/createAndEditPage.vm.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:share_plus/share_plus.dart';
import '../../helpers/constants.dart';
import '../../repositories/imagePickerRepo/imagePickerRepo.dart';
import '../../reuseables/widgets/customAppflowyHeadingToolBarItem.dart';
import '../../reuseables/widgets/customAppflowyLinkToolBarItem.dart';
import '../../reuseables/widgets/customAppflowyListToolBarItem.dart';
Expand Down Expand Up @@ -933,7 +930,7 @@ class _EditorViewState extends State<EditorView> {
return (widget.createAndEditPageVM.isAssestImage)
? const SizedBox.shrink()
: Container(
margin: EdgeInsetsDirectional.only(top: 16),
margin: const EdgeInsetsDirectional.only(top: 16),
child: ClipRRect(
borderRadius: BorderRadius.circular(16),
child: Image.file(
Expand Down
18 changes: 9 additions & 9 deletions lib/pages/homePage/homePage.view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ class _HomePageViewState extends State<HomePageView> {
child: CircularProgressIndicator.adaptive(),
),
child: Visibility(
visible: !(_instanceOfVM.todaysRemainder.length == 0 &&
_instanceOfVM.pinnedNotes.length == 0 &&
_instanceOfVM.allNotes.length == 0),
visible: !(_instanceOfVM.todaysRemainder.isEmpty &&
_instanceOfVM.pinnedNotes.isEmpty &&
_instanceOfVM.allNotes.isEmpty),
replacement: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
Expand Down Expand Up @@ -296,15 +296,15 @@ class _HomePageViewState extends State<HomePageView> {
}),
Observer(builder: (context) {
return Visibility(
visible: _instanceOfVM.pinnedNotes.length != 0,
visible: _instanceOfVM.pinnedNotes.isNotEmpty,
child: const SizedBox(
height: 16,
),
);
}),
Observer(builder: (context) {
return Visibility(
visible: _instanceOfVM.pinnedNotes.length != 0,
visible: _instanceOfVM.pinnedNotes.isNotEmpty,
child: const Padding(
padding: EdgeInsets.symmetric(horizontal: 16),
child: Text(
Expand All @@ -319,7 +319,7 @@ class _HomePageViewState extends State<HomePageView> {
}),
Observer(builder: (context) {
return Visibility(
visible: _instanceOfVM.pinnedNotes.length != 0,
visible: _instanceOfVM.pinnedNotes.isNotEmpty,
child: const SizedBox(
height: 16,
),
Expand Down Expand Up @@ -554,15 +554,15 @@ class _HomePageViewState extends State<HomePageView> {
}),
Observer(builder: (context) {
return Visibility(
visible: _instanceOfVM.allNotes.length != 0,
visible: _instanceOfVM.allNotes.isNotEmpty,
child: const SizedBox(
height: 16,
),
);
}),
Observer(builder: (context) {
return Visibility(
visible: _instanceOfVM.allNotes.length != 0,
visible: _instanceOfVM.allNotes.isNotEmpty,
child: const Padding(
padding: EdgeInsets.symmetric(horizontal: 16),
child: Text(
Expand All @@ -577,7 +577,7 @@ class _HomePageViewState extends State<HomePageView> {
}),
Observer(builder: (context) {
return Visibility(
visible: _instanceOfVM.allNotes.length != 0,
visible: _instanceOfVM.allNotes.isNotEmpty,
child: const SizedBox(
height: 16,
),
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/searchPage/searchPage.view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class _SearchPageState extends State<SearchPage> {
),
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
children: [
SizedBox(height: 16,),
const SizedBox(height: 16,),
SizedBox(
height: 56,
child: TextFormField(
Expand Down Expand Up @@ -83,7 +83,7 @@ class _SearchPageState extends State<SearchPage> {
return Visibility(
visible: _instanceOfSearchPageVM.isLoading,
replacement: Visibility(
visible: _instanceOfSearchPageVM.quiredNotes.length != 0,
visible: _instanceOfSearchPageVM.quiredNotes.isNotEmpty,
replacement: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
Expand Down
2 changes: 1 addition & 1 deletion lib/resources/theme/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final darkTheme = ThemeData(
fontFamily: "Inter",
);

final brandColor = const Color(0xff3498DB);
const brandColor = Color(0xff3498DB);

class CustompageTransitionBuilder extends PageTransitionsBuilder {
/// Constructs a page transition animation that slides the page up.
Expand Down
2 changes: 1 addition & 1 deletion lib/reuseables/widgets/customAppflowyListToolBarItem.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class _ListMenuState extends State<_ListMenu> {
),
label: Text(
currentList.label,
style: TextStyle(fontSize: 12),
style: const TextStyle(fontSize: 12),
),
isSelected: isSelected,
onPressed: () {
Expand Down
6 changes: 3 additions & 3 deletions lib/reuseables/widgets/customAppflowyMobileToolBarItem.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class CustomMobileToolbarWidgetState extends State<CustomMobileToolbarWidget>
height: 32,
width: 32,
child: IconButton(
constraints: BoxConstraints.tight(Size(32, 32)),
constraints: BoxConstraints.tight(const Size(32, 32)),
padding: EdgeInsets.zero,
alignment: Alignment.center,
color: Theme.of(context).iconTheme.color,
Expand All @@ -164,7 +164,7 @@ class CustomMobileToolbarWidgetState extends State<CustomMobileToolbarWidget>
height: 32,
width: 32,
child: IconButton(
constraints: BoxConstraints.tight(Size(32, 32)),
constraints: BoxConstraints.tight(const Size(32, 32)),
padding: EdgeInsets.zero,
alignment: Alignment.center,
color: Theme.of(context).iconTheme.color,
Expand Down Expand Up @@ -216,7 +216,7 @@ class CustomMobileToolbarWidgetState extends State<CustomMobileToolbarWidget>
width: 32,
height: 32,
child: IconButton(
constraints: BoxConstraints.tight(Size(32, 32)),
constraints: BoxConstraints.tight(const Size(32, 32)),
padding: EdgeInsets.zero,
alignment: Alignment.center,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MobileToolbarItem customBuildTextAndBackgroundColorMobileToolbarItem({
List<ColorOption>? backgroundColorOptions,
}) {
return MobileToolbarItem.withMenu(
itemIcon: ImageIcon(
itemIcon: const ImageIcon(
AssetImage(
"lib/resources/icons/paint.png",
),
Expand Down

0 comments on commit fd0f681

Please sign in to comment.