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