Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/clean_framework/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Changelog
## 4.1.4
**Sep 1, 2026**
- Bumps dependencies to latest version.
- Adopts Dart primary constructors for applicable classes.
- Switches from `package:flutter/material.dart` to `package:material_ui/material_ui.dart`.

## 4.1.3
**Jan 12, 2026**
- Bump dependency to latest version.
Expand Down
2 changes: 1 addition & 1 deletion packages/clean_framework/example/lib/app/poke_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:clean_framework_example_rest/providers.dart';
import 'package:clean_framework_example_rest/routing.dart';
import 'package:clean_framework_example_rest/widgets/app_scope.dart';
import 'package:clean_framework_router/clean_framework_router.dart';
import 'package:flutter/material.dart';
import 'package:material_ui/material_ui.dart';

class PokeApp extends StatelessWidget {
const PokeApp({super.key});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class PokemonExternalInterface
case DioExceptionType.receiveTimeout:
case DioExceptionType.sendTimeout:
case DioExceptionType.cancel:
case DioExceptionType.transformTimeout:
return const PokemonFailureResponse(
type: PokemonFailureType.serverError,
);
Expand All @@ -42,20 +43,20 @@ class PokemonExternalInterface
final data = Map<String, Object?>.from(response.data as Map);
return switch (response.statusCode) {
401 => PokemonFailureResponse(
type: PokemonFailureType.unauthorized,
message: 'The request was not authorized.',
errorData: data,
),
type: PokemonFailureType.unauthorized,
message: 'The request was not authorized.',
errorData: data,
),
404 => PokemonFailureResponse(
type: PokemonFailureType.notFound,
message: 'The requested resource was not found.',
errorData: data,
),
type: PokemonFailureType.notFound,
message: 'The requested resource was not found.',
errorData: data,
),
_ => PokemonFailureResponse(
type: PokemonFailureType.unknown,
message: 'An unknown error occurred.',
errorData: data,
),
type: PokemonFailureType.unknown,
message: 'An unknown error occurred.',
errorData: data,
),
};
case DioExceptionType.badCertificate:
case DioExceptionType.connectionError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:clean_framework_example_rest/features/form/domain/form_domain_mo
import 'package:clean_framework_example_rest/features/form/domain/form_use_case.dart';
import 'package:clean_framework_example_rest/features/form/presentation/form_view_model.dart';
import 'package:clean_framework_example_rest/providers.dart';
import 'package:flutter/material.dart';
import 'package:material_ui/material_ui.dart';

class FormPresenter
extends Presenter<FormViewModel, FormDomainToUIModel, FormUseCase> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:clean_framework_example_rest/features/form/domain/form_entity.da
import 'package:clean_framework_example_rest/features/form/presentation/form_presenter.dart';
import 'package:clean_framework_example_rest/features/form/presentation/form_view_model.dart';
import 'package:clean_framework_example_rest/widgets/fields.dart';
import 'package:flutter/material.dart';
import 'package:material_ui/material_ui.dart';

class FormUI extends UI<FormViewModel> {
FormUI({super.key});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:clean_framework_example_rest/features/home/domain/home_entity.da
import 'package:clean_framework_example_rest/features/home/domain/home_use_case.dart';
import 'package:clean_framework_example_rest/features/home/presentation/home_view_model.dart';
import 'package:clean_framework_example_rest/providers.dart';
import 'package:flutter/material.dart';
import 'package:material_ui/material_ui.dart';

class HomePresenter
extends Presenter<HomeViewModel, HomeDomainToUIModel, HomeUseCase> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:clean_framework_example_rest/routing/routes.dart';
import 'package:clean_framework_example_rest/widgets/pokemon_card.dart';
import 'package:clean_framework_example_rest/widgets/pokemon_search_field.dart';
import 'package:clean_framework_router/clean_framework_router.dart';
import 'package:flutter/material.dart';
import 'package:material_ui/material_ui.dart';

class HomeUI extends UI<HomeViewModel> {
HomeUI({super.key});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import 'package:clean_framework_example_rest/features/profile/domain/profile_dom
import 'package:clean_framework_example_rest/features/profile/domain/profile_use_case.dart';
import 'package:clean_framework_example_rest/features/profile/presentation/profile_view_model.dart';
import 'package:clean_framework_example_rest/providers.dart';
import 'package:flutter/material.dart';
import 'package:material_ui/material_ui.dart';

class ProfilePresenter extends Presenter<ProfileViewModel,
ProfileDomainToUIModel, ProfileUseCase> {
class ProfilePresenter
extends
Presenter<ProfileViewModel, ProfileDomainToUIModel, ProfileUseCase> {
ProfilePresenter({
required super.builder,
required String name,
Expand All @@ -27,8 +28,9 @@ class ProfilePresenter extends Presenter<ProfileViewModel,
ProfileDomainToUIModel domainModel,
) {
return ProfileViewModel(
pokemonTypes:
domainModel.types.map(PokemonType.new).toList(growable: false),
pokemonTypes: domainModel.types
.map(PokemonType.new)
.toList(growable: false),
description: domainModel.description,
height: '📏 ${domainModel.height} m',
weight: '⚖️ ${domainModel.weight} kg',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:clean_framework_example_rest/features/profile/domain/profile_dom
import 'package:clean_framework_example_rest/features/profile/presentation/profile_presenter.dart';
import 'package:clean_framework_example_rest/features/profile/presentation/profile_view_model.dart';
import 'package:clean_framework_example_rest/widgets/spotlight.dart';
import 'package:flutter/material.dart';
import 'package:material_ui/material_ui.dart';

class ProfileUI extends UI<ProfileViewModel> {
ProfileUI({
Expand Down Expand Up @@ -227,8 +227,8 @@ class _PokeTypeChip extends StatelessWidget {
Text(
type.name,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
color: type.color,
),
color: type.color,
),
),
],
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:clean_framework/clean_framework.dart';
import 'package:clean_framework_example_rest/features/profile/domain/profile_domain_models.dart';
import 'package:flutter/material.dart';
import 'package:material_ui/material_ui.dart';

class ProfileViewModel extends ViewModel {
const ProfileViewModel({
Expand All @@ -23,8 +23,8 @@ class ProfileViewModel extends ViewModel {

class PokemonType {
PokemonType(this.name)
: color = _pokemonTypeColors[name] ?? Colors.white,
emoji = _pokemonTypeEmojis[name] ?? '';
: color = _pokemonTypeColors[name] ?? Colors.white,
emoji = _pokemonTypeEmojis[name] ?? '';

final String name;
final String emoji;
Expand Down
2 changes: 1 addition & 1 deletion packages/clean_framework/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:clean_framework_example_rest/app/poke_app.dart';
import 'package:flutter/material.dart';
import 'package:material_ui/material_ui.dart';

void main() {
runApp(const PokeApp());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:flutter/material.dart';
import 'package:material_ui/material_ui.dart';
import 'package:uniform/uniform.dart';

class CheckboxInputField extends StatelessWidget {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:flutter/material.dart';
import 'package:material_ui/material_ui.dart';
import 'package:uniform/uniform.dart';

class DropdownInputField<T extends Object> extends StatelessWidget {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:clean_framework/clean_framework.dart';
import 'package:flutter/material.dart';
import 'package:material_ui/material_ui.dart';

class FormButton extends StatelessWidget {
const FormButton({required this.onPressed, required this.child, super.key});
Expand All @@ -11,7 +11,8 @@ class FormButton extends StatelessWidget {
Widget build(BuildContext context) {
return UniformBuilder(
builder: (context, controller, _) {
final isEnabled = controller.contains({InputFormState.touched}) &&
final isEnabled =
controller.contains({InputFormState.touched}) &&
!controller.isSubmitted;

return FilledButton(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:flutter/material.dart';
import 'package:material_ui/material_ui.dart';
import 'package:uniform/uniform.dart';

class TextInputField extends StatelessWidget {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:clean_framework_example_rest/widgets/svg_palette_card.dart';
import 'package:flutter/material.dart';
import 'package:material_ui/material_ui.dart';

class PokemonCard extends StatelessWidget {
const PokemonCard({
Expand Down Expand Up @@ -33,9 +33,7 @@ class PokemonCard extends StatelessWidget {
alignment: Alignment.topLeft,
child: Text(
name,
style: Theme.of(context)
.textTheme
.titleMedium!
style: Theme.of(context).textTheme.titleMedium!
.copyWith(fontWeight: FontWeight.w300),
),
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:flutter/material.dart';
import 'package:material_ui/material_ui.dart';

class PokemonSearchField extends StatelessWidget
implements PreferredSizeWidget {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'dart:async';
import 'dart:math';

import 'package:clean_framework_example_rest/widgets/app_scope.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:material_ui/material_ui.dart';
import 'package:palette_generator/palette_generator.dart';

class Spotlight extends StatefulWidget {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import 'dart:async';
import 'dart:developer';

import 'package:clean_framework_example_rest/widgets/app_scope.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:material_ui/material_ui.dart';
import 'package:palette_generator/palette_generator.dart';

class SvgPaletteCard extends StatefulWidget {
Expand Down Expand Up @@ -116,7 +116,8 @@ class _SvgPaletteCardState extends State<SvgPaletteCard> {
final palette = await AppScope.paletteGeneratorOf(context, image);

if (!mounted) return;
_color = widget.backgroundColorBuilder?.call(context, palette) ??
_color =
widget.backgroundColorBuilder?.call(context, palette) ??
palette.dominantColor?.color;

setState(() {});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
jni
)

set(PLUGIN_BUNDLED_LIBRARIES)
Expand Down
3 changes: 2 additions & 1 deletion packages/clean_framework/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ publish_to: none
version: 2.0.3+3

environment:
sdk: '>=3.8.0 <4.0.0'
sdk: ">=3.13.0 <4.0.0"

resolution: workspace

Expand All @@ -17,6 +17,7 @@ dependencies:
sdk: flutter
flutter_cache_manager: ^3.4.1
flutter_svg: ^2.0.10+1
material_ui: ^1.1.0
palette_generator: ^0.3.3+4
uniform: ^2.0.6

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import 'package:clean_framework_example_rest/widgets/app_scope.dart';
import 'package:clean_framework_example_rest/widgets/pokemon_card.dart';
import 'package:clean_framework_router/clean_framework_router.dart';
import 'package:clean_framework_test/clean_framework_test.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:material_ui/material_ui.dart';
import 'package:palette_generator/palette_generator.dart';

import '../../../helpers/test_cache_manager.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import 'package:clean_framework_example_rest/features/profile/presentation/profi
import 'package:clean_framework_example_rest/features/profile/presentation/profile_view_model.dart';
import 'package:clean_framework_example_rest/widgets/app_scope.dart';
import 'package:clean_framework_test/clean_framework_test.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:material_ui/material_ui.dart';
import 'package:palette_generator/palette_generator.dart';

import '../../../helpers/test_cache_manager.dart';
Expand Down
8 changes: 3 additions & 5 deletions packages/clean_framework/example/test/flow_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import 'package:clean_framework_example_rest/providers.dart';
import 'package:clean_framework_example_rest/routing.dart';
import 'package:clean_framework_example_rest/widgets/app_scope.dart';
import 'package:clean_framework_router/clean_framework_router.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:material_ui/material_ui.dart';

void main() {
testWidgets('Flow Test', (tester) async {
Expand Down Expand Up @@ -75,8 +75,7 @@ class PokemonExternalInterfaceFake extends PokemonExternalInterface {
data: {
'flavor_text_entries': [
{
'flavor_text':
'It keeps its tail\nraised to monitor\nits surroundings.\fIf you yank its\ntail, it will try\nto bite you.',
'flavor_text': 'It keeps its tail\nraised to monitor\nits surroundings.\fIf you yank its\ntail, it will try\nto bite you.',
'language': {
'name': 'en',
'url': 'https://pokeapi.co/api/v2/language/9/',
Expand All @@ -87,8 +86,7 @@ class PokemonExternalInterfaceFake extends PokemonExternalInterface {
},
},
{
'flavor_text':
'This intelligent\nPOKéMON roasts\nhard BERRIES with\felectricity to\nmake them tender\nenough to eat.',
'flavor_text': 'This intelligent\nPOKéMON roasts\nhard BERRIES with\felectricity to\nmake them tender\nenough to eat.',
'language': {
'name': 'en',
'url': 'https://pokeapi.co/api/v2/language/9/',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'dart:async';

import 'package:clean_framework_example_rest/widgets/app_scope.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:material_ui/material_ui.dart';
import 'package:palette_generator/palette_generator.dart';

import '../helpers/test_cache_manager.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:clean_framework_example_rest/widgets/app_scope.dart';
import 'package:clean_framework_example_rest/widgets/pokemon_card.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:material_ui/material_ui.dart';
import 'package:palette_generator/palette_generator.dart';

import '../helpers/test_cache_manager.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:clean_framework_example_rest/widgets/app_scope.dart';
import 'package:clean_framework_example_rest/widgets/svg_palette_card.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:material_ui/material_ui.dart';
import 'package:palette_generator/palette_generator.dart';

import '../helpers/test_cache_manager.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
jni
)

set(PLUGIN_BUNDLED_LIBRARIES)
Expand Down
5 changes: 2 additions & 3 deletions packages/clean_framework/lib/src/app_providers_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ class AppProvidersContainer extends StatelessWidget {
required this.child,
super.key,
ProvidersContext? providersContext,
ContainerBuildCallback? onBuild,
}) : _providersContext = providersContext ?? ProvidersContext(),
_onBuild = onBuild;
this._onBuild,
}) : _providersContext = providersContext ?? ProvidersContext();

/// The widget below this widget in the tree.
final Widget child;
Expand Down
Loading
Loading