WIP
This commit is contained in:
parent
5a481f8ab7
commit
ae24dd2d7c
|
@ -406,7 +406,7 @@ class DocumentModel extends FlutterFlowModel<DocumentPage> {
|
||||||
onChanged: (value) => EasyDebounce.debounce(
|
onChanged: (value) => EasyDebounce.debounce(
|
||||||
'_model.keyTextFieldTextController',
|
'_model.keyTextFieldTextController',
|
||||||
const Duration(milliseconds: 500),
|
const Duration(milliseconds: 500),
|
||||||
() => filterBySearchBar(Document.fromDesc(value), context),
|
() => filterBySearchBar(Document.from(value), context),
|
||||||
),
|
),
|
||||||
cursorColor: theme.primaryText,
|
cursorColor: theme.primaryText,
|
||||||
showCursor: false,
|
showCursor: false,
|
||||||
|
@ -569,7 +569,7 @@ interface class Document extends Archive {
|
||||||
required this.updatedAt,
|
required this.updatedAt,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory Document.fromDesc(String desc) => Document(
|
factory Document.from(String desc) => Document(
|
||||||
id: 0,
|
id: 0,
|
||||||
description: desc,
|
description: desc,
|
||||||
type: '',
|
type: '',
|
||||||
|
|
|
@ -1,81 +1,83 @@
|
||||||
import 'package:flutter/material.dart';
|
part of 'widgets.dart';
|
||||||
|
|
||||||
class EnhancedSearchView extends StatelessWidget {
|
// class EnhancedSearchView<QueryType> extends StatelessWidget {
|
||||||
const EnhancedSearchView({
|
// const EnhancedSearchView({
|
||||||
super.key,
|
// super.key,
|
||||||
required this.filter,
|
// required this.filter,
|
||||||
});
|
// required this.cast,
|
||||||
|
// });
|
||||||
|
|
||||||
final void Function<T>(T query, BuildContext context) filter;
|
// final void Function(QueryType query) filter;
|
||||||
|
// final QueryType Function(String query) cast;
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
Widget build(BuildContext context) {
|
// Widget build(BuildContext context) {
|
||||||
final theme = FlutterFlowTheme.of(context);
|
// final theme = FlutterFlowTheme.of(context);
|
||||||
final locale = FFLocalizations.of(context);
|
// final locale = FFLocalizations.of(context);
|
||||||
TextEditingController controller = TextEditingController();
|
// TextEditingController controller = TextEditingController();
|
||||||
return TextFormField(
|
// return TextFormField(
|
||||||
controller: controller,
|
// controller: controller,
|
||||||
onChanged: (value) => EasyDebounce.debounce(
|
// onChanged: (value) => EasyDebounce.debounce(
|
||||||
'_model.keyTextFieldTextController',
|
// '_model.keyTextFieldTextController',
|
||||||
const Duration(milliseconds: 500),
|
// const Duration(milliseconds: 500),
|
||||||
() => filter.call(Document.fromDesc(value), context),
|
// () => filter.call(cast.call(value)),
|
||||||
),
|
// ),
|
||||||
cursorColor: theme.primaryText,
|
// cursorColor: theme.primaryText,
|
||||||
showCursor: false,
|
// showCursor: false,
|
||||||
cursorWidth: 2.0,
|
// cursorWidth: 2.0,
|
||||||
cursorRadius: Radius.circular(100),
|
// cursorRadius: Radius.circular(100),
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
color: theme.primaryText,
|
// color: theme.primaryText,
|
||||||
fontSize: 16.0,
|
// fontSize: 16.0,
|
||||||
decorationColor: Colors.amber,
|
// decorationColor: Colors.amber,
|
||||||
),
|
// ),
|
||||||
keyboardType: TextInputType.text,
|
// keyboardType: TextInputType.text,
|
||||||
textInputAction: TextInputAction.search,
|
// textInputAction: TextInputAction.search,
|
||||||
autocorrect: true,
|
// autocorrect: true,
|
||||||
textCapitalization: TextCapitalization.sentences,
|
// textCapitalization: TextCapitalization.sentences,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
prefixIcon: Icon(Icons.search, color: theme.primary),
|
// prefixIcon: Icon(Icons.search, color: theme.primary),
|
||||||
labelText: locale.getVariableText(
|
// labelText: locale.getVariableText(
|
||||||
ptText: 'Pesquisar',
|
// ptText: 'Pesquisar',
|
||||||
enText: 'Search',
|
// enText: 'Search',
|
||||||
),
|
// ),
|
||||||
labelStyle: TextStyle(
|
// labelStyle: TextStyle(
|
||||||
color: theme.primaryText,
|
// color: theme.primaryText,
|
||||||
fontSize: 16.0,
|
// fontSize: 16.0,
|
||||||
),
|
// ),
|
||||||
hintText: locale.getVariableText(
|
// hintText: locale.getVariableText(
|
||||||
ptText: 'Digite sua pesquisa',
|
// ptText: 'Digite sua pesquisa',
|
||||||
enText: 'Enter your search',
|
// enText: 'Enter your search',
|
||||||
),
|
// ),
|
||||||
hintStyle: TextStyle(
|
// hintStyle: TextStyle(
|
||||||
color: theme.accent2,
|
// color: theme.accent2,
|
||||||
fontSize: 14.0,
|
// fontSize: 14.0,
|
||||||
),
|
// ),
|
||||||
filled: true,
|
// filled: true,
|
||||||
fillColor: Colors.transparent,
|
// fillColor: Colors.transparent,
|
||||||
helperStyle: TextStyle(
|
// helperStyle: TextStyle(
|
||||||
color: theme.primaryText,
|
// color: theme.primaryText,
|
||||||
decorationColor: theme.primaryText,
|
// decorationColor: theme.primaryText,
|
||||||
),
|
// ),
|
||||||
focusColor: theme.primaryText,
|
// focusColor: theme.primaryText,
|
||||||
contentPadding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 15.0),
|
// contentPadding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 15.0),
|
||||||
enabledBorder: UnderlineInputBorder(
|
// enabledBorder: UnderlineInputBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(15.0)),
|
// borderRadius: BorderRadius.all(Radius.circular(15.0)),
|
||||||
borderSide: BorderSide(color: theme.primaryText),
|
// borderSide: BorderSide(color: theme.primaryText),
|
||||||
),
|
// ),
|
||||||
focusedBorder: UnderlineInputBorder(
|
// focusedBorder: UnderlineInputBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(15.0)),
|
// borderRadius: BorderRadius.all(Radius.circular(15.0)),
|
||||||
borderSide: BorderSide(color: theme.primaryText),
|
// borderSide: BorderSide(color: theme.primaryText),
|
||||||
),
|
// ),
|
||||||
errorBorder: UnderlineInputBorder(
|
// errorBorder: UnderlineInputBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(15.0)),
|
// borderRadius: BorderRadius.all(Radius.circular(15.0)),
|
||||||
borderSide: BorderSide(color: theme.primaryText),
|
// borderSide: BorderSide(color: theme.primaryText),
|
||||||
),
|
// ),
|
||||||
focusedErrorBorder: UnderlineInputBorder(
|
// focusedErrorBorder: UnderlineInputBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(15.0)),
|
// borderRadius: BorderRadius.all(Radius.circular(15.0)),
|
||||||
borderSide: BorderSide(color: theme.primaryText, width: 2.0),
|
// borderSide: BorderSide(color: theme.primaryText, width: 2.0),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
|
@ -2,7 +2,7 @@ part of 'widgets.dart';
|
||||||
|
|
||||||
// typedef PDFViewerKey = GlobalKey<SfPdfViewerState>;
|
// typedef PDFViewerKey = GlobalKey<SfPdfViewerState>;
|
||||||
typedef ReadViewController = PdfController;
|
typedef ReadViewController = PdfController;
|
||||||
typedef Document = PdfDocument;
|
typedef DocumentType = PdfDocument;
|
||||||
|
|
||||||
abstract interface class Viewer extends StatelessComponent {
|
abstract interface class Viewer extends StatelessComponent {
|
||||||
final String src;
|
final String src;
|
||||||
|
@ -37,7 +37,7 @@ class ReadView extends StatefulWidget {
|
||||||
class ReadViewState extends State<ReadView> {
|
class ReadViewState extends State<ReadView> {
|
||||||
Future<ReadViewController> _initializePdf() async {
|
Future<ReadViewController> _initializePdf() async {
|
||||||
final file = await downloadPdf(widget.url);
|
final file = await downloadPdf(widget.url);
|
||||||
final Future<Document> document = Document.openFile(file.path);
|
final Future<DocumentType> document = DocumentType.openFile(file.path);
|
||||||
return ReadViewController(document: document);
|
return ReadViewController(document: document);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
import 'dart:nativewrappers/_internal/vm/lib/ffi_allocation_patch.dart';
|
||||||
|
|
||||||
import 'package:auto_size_text/auto_size_text.dart';
|
import 'package:auto_size_text/auto_size_text.dart';
|
||||||
|
import 'package:easy_debounce/easy_debounce.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:hub/flutter_flow/index.dart';
|
import 'package:hub/flutter_flow/index.dart';
|
||||||
|
@ -27,6 +29,7 @@ part 'list_view.dart';
|
||||||
part 'carousel_view.dart';
|
part 'carousel_view.dart';
|
||||||
part 'read_view.dart';
|
part 'read_view.dart';
|
||||||
part 'enhanced_list_view.dart';
|
part 'enhanced_list_view.dart';
|
||||||
|
part 'enhanced_search_view.dart';
|
||||||
|
|
||||||
/// [Component]'s
|
/// [Component]'s
|
||||||
part 'text.dart';
|
part 'text.dart';
|
||||||
|
|
Loading…
Reference in New Issue