This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// decode | |
final json = json.decode(...); | |
final archive = KeyedArchive.unarchive(json); | |
final person = Person()..decode(archive); | |
//encode | |
final person = Person()..name = "Bob"; | |
final archive = KeyedArchive.archive(person); | |
final json = json.encode(archive); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person extends Coding { | |
String name; | |
@override | |
void decode(KeyedArchive object) { | |
// must call super | |
super.decode(object); | |
name = object.decode("name"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2024 Fredrick Allan Hrott. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
// | |
// Modified from original by codable BSD 2 clause | |
// license 2019. | |
import 'package:json_helpers/json_helpers/keyed_archive.dart'; | |
class ReferenceResolver { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2024 Fredrick Allan Hrott. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
// | |
// Modified from original by codable BSD 2 clause | |
// license 2019. | |
import 'dart:collection'; | |
import 'package:json_helpers/json_helpers/codable.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2024 Fredrick Allan Hrott. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
// | |
// Modified from original by codable BSD 2 clause | |
// license 2019. | |
import 'package:json_helpers/json_helpers/resolver.dart'; | |
abstract class Referencable { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2024 Fredrick Allan Hrott. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
// | |
// Modified from original by codable BSD 2 clause | |
// license 2019. | |
import 'dart:async' as async; | |
import 'dart:core' as core; | |
import 'dart:core' hide Map, String, int; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2024 Fredrick Allan Hrott. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
// | |
// Modified from original by codable BSD 2 clause | |
// license 2019. | |
import 'dart:collection'; | |
import 'package:json_helpers/json_helpers/cast.dart' as cast; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2024 Fredrick Allan Hrott. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
// | |
// Modified from original by codable BSD 2 clause | |
// license 2019. | |
import 'package:flutter/foundation.dart'; | |
import 'package:json_helpers/json_helpers/cast.dart' as cast; | |
import 'package:json_helpers/json_helpers/keyed_archive.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DarkTransition extends StatefulWidget { | |
const DarkTransition( | |
{required this.childBuilder, | |
Key? key, | |
this.offset = Offset.zero, | |
this.themeController, | |
this.radius, | |
this.duration = const Duration(milliseconds: 400), | |
this.isDark = false}) | |
: super(key: key); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ignore_for_file: cast_nullable_to_non_nullable | |
import 'package:easy_hive/easy_hive.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:theme_change_anim/src/domain/general_settings_extension.dart'; | |
import 'package:theme_change_anim/src/domain/settings_box_service.dart'; | |
import 'package:theme_change_anim/src/domain/settings_model.dart'; | |
class SettingsView extends StatefulWidget { | |
const SettingsView({super.key}); |