Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:equatable/equatable.dart';
- import 'package:flutter/material.dart';
- import 'package:hydrated_bloc/hydrated_bloc.dart';
- part 'content_sizing_cubit_state.dart';
- class ContentSizingCubit extends HydratedCubit<double> {
- ContentSizingCubit() : super(12.0);
- double textSize = 12.0;
- void incrementTextsize() {
- debugPrint('incrementTextSize : true');
- if (textSize >= 10 && textSize < 18) {
- textSize++;
- }
- emit(textSize);
- }
- void decrementTextsize() {
- debugPrint('decrementTextSize : true');
- if (textSize > 10 && textSize <= 18) {
- textSize--;
- }
- emit(textSize);
- }
- @override
- double? fromJson(Map<String, dynamic> json) {
- // TODO: implement fromJson
- return textSize;
- }
- @override
- Map<String, dynamic>? toJson(double textSize) {
- // TODO: implement toJson
- return {'textSize': textSize};
- }
- }
Add Comment
Please, Sign In to add comment