Skip to content

Commit

Permalink
Update Flutter SDK and dependencies. Fix analyzer issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
gumbarros committed Jan 9, 2024
1 parent faa0a50 commit 3a745f1
Show file tree
Hide file tree
Showing 43 changed files with 431 additions and 471 deletions.
15 changes: 8 additions & 7 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ Future<void> ensureInitialized() async {
Future<void> main() async {
await ensureInitialized();

runApp(ProviderScope(child:EasyLocalization(
path: 'assets/translations',
assetLoader: YamlAssetLoader(),
fallbackLocale: const Locale("en", "US"),
supportedLocales: supportedLocales.map((l) => l.locale).toList(),
child: const Main())));
runApp(ProviderScope(
child: EasyLocalization(
path: 'assets/translations',
assetLoader: const YamlAssetLoader(),
fallbackLocale: const Locale("en", "US"),
supportedLocales: supportedLocales.map((l) => l.locale).toList(),
child: const Main())));
}

class Main extends StatelessWidget {
const Main({Key? key}) : super(key: key);
const Main({super.key});

@override
Widget build(BuildContext context) {
Expand Down
13 changes: 6 additions & 7 deletions lib/src/impl/brazil/cpf_cnpj/cpf_cnpj_generator_page.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import 'package:dev_widgets/src/impl/brazil/cpf_cnpj/cpf_cnpj_generation_mode.dart';
import 'package:dev_widgets/src/impl/brazil/cpf_cnpj/cpf_cnpj_providers.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/output_editor.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:yaru_widgets/yaru_widgets.dart';

class CpfCnpjGeneratorPage extends HookConsumerWidget {
final GenerationMode mode;

const CpfCnpjGeneratorPage({Key? key, required this.mode}) : super(key: key);
const CpfCnpjGeneratorPage({super.key, required this.mode});

@override
Widget build(BuildContext context, ref) {
Expand Down Expand Up @@ -100,11 +100,10 @@ class CpfCnpjGeneratorPage extends HookConsumerWidget {
usesCodeControllers: false,
actionButtons: [
ElevatedButton.icon(
icon: const Icon(Icons.clear),
label: Text(StringTranslateExtension("clear").tr()),
onPressed: () =>
ref.read(cpfCnpjGeneratorProvider.notifier).state = "",
),
icon: const Icon(Icons.clear),
label: Text(StringTranslateExtension("clear").tr()),
onPressed: () =>
ref.read(cpfCnpjGeneratorProvider.notifier).clear())
],
)),
],
Expand Down
6 changes: 5 additions & 1 deletion lib/src/impl/brazil/cpf_cnpj/cpf_cnpj_providers.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:brazil/brazil.dart';
import 'package:dev_widgets/src/impl/brazil/cpf_cnpj/cpf_cnpj_generation_mode.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:brazil/brazil.dart';

final isFormattedProvider = StateProvider<bool>((ref) => false);
final amountProvider = StateProvider<int>((ref) => 1);
Expand All @@ -26,6 +26,10 @@ class CpfCnpjGenerator extends Notifier<String> {

state = output;
}

clear() {
state = "";
}
}

final cpfCnpjGeneratorProvider =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import 'dart:convert';

import 'package:dev_widgets/src/impl/converters/json_to_class/programming_language.dart';
import 'package:json_to_dart/json_to_dart.dart';
import 'package:dev_widgets/src/impl/helpers.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:json_dart_generator/json_dart_generator.dart';

abstract class _JsonToClassProvider {
String convert(String className, String jsonData);
Expand All @@ -11,9 +12,9 @@ abstract class _JsonToClassProvider {
class _JsonToDartConverter implements _JsonToClassProvider {
@override
String convert(String className, String jsonData) {
var generator = ModelGenerator(className);
var generator = DartCodeGenerator(rootClassName: className);

return generator.generateDartClasses(jsonData).code;
return generator.generate(jsonData);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import 'package:dev_widgets/src/impl/converters/json_to_class/programming_langua
import 'package:dev_widgets/src/impl/helpers.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/code_controller_hook.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/io_editor.dart';
import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:highlight/languages/dart.dart';
import 'package:highlight/languages/json.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:yaru_widgets/yaru_widgets.dart';

class JsonToClassConverterPage extends HookConsumerWidget {
const JsonToClassConverterPage({Key? key}) : super(key: key);
const JsonToClassConverterPage({super.key});

@override
Widget build(BuildContext context, ref) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ bool _isMap(value) {

DataType _getFieldType(dynamic value) {
switch (value.runtimeType) {
case int:
case const (int):
return DataType.integer;
case bool:
case const (bool):
return DataType.bit;
case num:
case double:
case const (num):
case const (double):
return DataType.number;
default:
if (DateTime.tryParse(value.toString()) != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:convert';

import 'package:dev_widgets/src/impl/converters/json_to_sql/helpers/table_fields_mapper.dart';
import 'package:dev_widgets/src/impl/converters/json_to_sql/json_to_sql_converter_providers.dart';
import 'package:dev_widgets/src/impl/helpers.dart';
Expand All @@ -8,7 +9,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

class JsonToSqlConverterInput extends HookConsumerWidget {
const JsonToSqlConverterInput({Key? key}) : super(key: key);
const JsonToSqlConverterInput({super.key});

@override
Widget build(BuildContext context, ref) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const exampleJson = """[
]""";

class JsonToSqlConverterOptions extends ConsumerWidget {
const JsonToSqlConverterOptions({Key? key}) : super(key: key);
const JsonToSqlConverterOptions({super.key});

@override
Widget build(BuildContext context, ref) {
Expand All @@ -51,9 +51,8 @@ class JsonToSqlConverterOptions extends ConsumerWidget {

class _Fields extends ConsumerWidget {
const _Fields({
Key? key,
required this.fields,
}) : super(key: key);
});

final List<TableField> fields;

Expand Down Expand Up @@ -165,9 +164,7 @@ class _Fields extends ConsumerWidget {
}

class _Configuration extends ConsumerWidget {
const _Configuration({
Key? key,
}) : super(key: key);
const _Configuration();

@override
Widget build(BuildContext context, ref) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

class JsonToSqlConverterOutput extends HookConsumerWidget {
const JsonToSqlConverterOutput({Key? key}) : super(key: key);
const JsonToSqlConverterOutput({super.key});

@override
Widget build(BuildContext context, ref) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import 'package:dev_widgets/src/impl/converters/json_to_sql/json_to_sql_converte
import 'package:dev_widgets/src/impl/converters/json_to_sql/page/json_to_sql_converter_input.dart';
import 'package:dev_widgets/src/impl/converters/json_to_sql/page/json_to_sql_converter_options.dart';
import 'package:dev_widgets/src/impl/converters/json_to_sql/page/json_to_sql_converter_output.dart';
import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:yaru_widgets/yaru_widgets.dart';

class JsonToSqlConverterPage extends ConsumerWidget {
const JsonToSqlConverterPage({Key? key}) : super(key: key);
const JsonToSqlConverterPage({super.key});

@override
Widget build(BuildContext context, ref) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:dev_widgets/src/impl/converters/json_yaml/json_yaml_converter_providers.dart';
import 'package:dev_widgets/src/impl/converters/json_yaml/json_yaml_conversion_type.dart';
import 'package:dev_widgets/src/impl/converters/json_yaml/json_yaml_converter_providers.dart';
import 'package:dev_widgets/src/impl/formatters/indentation.dart';
import 'package:dev_widgets/src/impl/helpers.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/code_controller_hook.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/io_editor.dart';
import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:highlight/languages/json.dart';
import 'package:highlight/languages/yaml.dart';
Expand All @@ -14,7 +14,7 @@ import 'package:json2yaml/json2yaml.dart';
import 'package:yaru_widgets/yaru_widgets.dart';

class JsonYamlConverterPage extends HookConsumerWidget {
const JsonYamlConverterPage({Key? key}) : super(key: key);
const JsonYamlConverterPage({super.key});

@override
Widget build(BuildContext context, ref) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/impl/described_enum.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
abstract class DescribedEnum extends Enum {
abstract class DescribedEnum implements Enum {
final String description;

DescribedEnum(this.description);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import 'dart:convert';

import 'package:dev_widgets/src/impl/encoders/base64_image/base64_image_encoder_providers.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/io_editor.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/io_toolbar.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/output_editor.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';

import 'package:easy_localization/easy_localization.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:screenshot/screenshot.dart';

class Base64ImageEncoderPage extends HookConsumerWidget {
const Base64ImageEncoderPage({Key? key}) : super(key: key);
const Base64ImageEncoderPage({super.key});

@override
Widget build(BuildContext context, ref) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import 'package:dev_widgets/src/impl/encoders/base64_text/base64_text_encoder_pr
import 'package:dev_widgets/src/impl/encoders/encode_conversion_mode.dart';
import 'package:dev_widgets/src/impl/helpers.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/io_editor.dart';
import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:yaru_widgets/yaru_widgets.dart';

class Base64TextEncoderPage extends HookConsumerWidget {
const Base64TextEncoderPage({Key? key}) : super(key: key);
const Base64TextEncoderPage({super.key});

@override
Widget build(BuildContext context, ref) {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/impl/encoders/html/html_encoder_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import 'package:dev_widgets/src/impl/encoders/html/html_encoder_providers.dart';
import 'package:dev_widgets/src/impl/helpers.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/code_controller_hook.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/io_editor.dart';
import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:highlight/languages/xml.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:yaru_widgets/yaru_widgets.dart';

class HtmlEncoderPage extends HookConsumerWidget {
const HtmlEncoderPage({Key? key}) : super(key: key);
const HtmlEncoderPage({super.key});

@override
Widget build(BuildContext context, ref) {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/impl/encoders/url/url_encoder_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import 'package:dev_widgets/src/impl/encoders/encode_conversion_mode.dart';
import 'package:dev_widgets/src/impl/encoders/url/url_encoder_providers.dart';
import 'package:dev_widgets/src/impl/helpers.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/io_editor.dart';
import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:yaru_widgets/yaru_widgets.dart';

class UrlEncoderPage extends HookConsumerWidget {
const UrlEncoderPage({Key? key}) : super(key: key);
const UrlEncoderPage({super.key});

@override
Widget build(BuildContext context, ref) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import 'package:dev_widgets/src/impl/formatters/json_formatter/json_formatter_pr
import 'package:dev_widgets/src/impl/helpers.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/code_controller_hook.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/io_editor.dart';
import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:highlight/languages/json.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:yaru_widgets/yaru_widgets.dart';
import 'package:highlight/languages/json.dart';

class JsonFormatterPage extends HookConsumerWidget {
const JsonFormatterPage({Key? key}) : super(key: key);
const JsonFormatterPage({super.key});

@override
Widget build(BuildContext context, ref) {
Expand Down
6 changes: 3 additions & 3 deletions lib/src/impl/formatters/sql_formatter/sql_formatter_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import 'package:dev_widgets/src/impl/formatters/sql_formatter/sql_formatter_prov
import 'package:dev_widgets/src/impl/helpers.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/code_controller_hook.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/io_editor.dart';
import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:highlight/languages/sql.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:yaru_widgets/yaru_widgets.dart';
import 'package:highlight/languages/sql.dart';

class SqlFormatterPage extends HookConsumerWidget {
const SqlFormatterPage({Key? key}) : super(key: key);
const SqlFormatterPage({super.key});

@override
Widget build(BuildContext context, ref) {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/impl/formatters/xml_formatter/xml_formatter_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import 'package:dev_widgets/src/impl/formatters/xml_formatter/xml_formatter_prov
import 'package:dev_widgets/src/impl/helpers.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/code_controller_hook.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/io_editor.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:highlight/languages/xml.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:yaru_widgets/yaru_widgets.dart';

class XmlFormatterPage extends HookConsumerWidget {
const XmlFormatterPage({Key? key}) : super(key: key);
const XmlFormatterPage({super.key});

@override
Widget build(BuildContext context, ref) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import 'package:dev_widgets/src/impl/formatters/yaml_formatter/yaml_formatter_pr
import 'package:dev_widgets/src/impl/helpers.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/code_controller_hook.dart';
import 'package:dev_widgets/src/impl/widgets/io_editor/io_editor.dart';
import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:highlight/languages/yaml.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:json2yaml/json2yaml.dart';
import 'package:yaru_widgets/yaru_widgets.dart';

class YamlFormatterPage extends HookConsumerWidget {
const YamlFormatterPage({Key? key}) : super(key: key);
const YamlFormatterPage({super.key});

@override
Widget build(BuildContext context, ref) {
Expand Down
Loading

0 comments on commit 3a745f1

Please sign in to comment.