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
import 'package:flutter/material.dart'; | |
import 'package:flutter_localizations/flutter_localizations.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
import 'package:localization_wo_context/generated/l10n.dart'; | |
import 'package:localization_wo_context/generated/l10n.dart'; | |
import 'package:localization_wo_context/generated/l10n.dart'; | |
late final appNavKey; | |
void main() { |
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
import 'package:flutter/material.dart'; | |
final navigatorKey = GlobalKey<NavigatorState>(); | |
// navigatorKey is parameter which goes in the MaterialApp | |
// navigagtorKey parameter slot. Then we can do |
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 Container extends Coding { | |
List<String> things; | |
@override | |
Map<String, cast.Cast<dynamic>> get castMap => { | |
"things": cast.List(cast.String) | |
}; | |
@override |
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 Team extends Coding { | |
List<Person> members; | |
Person manager; | |
@override | |
void decode(KeyedArchive object) { | |
super.decode(object); // must call super | |
members = object.decodeObjects("members", () => Person()); |
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; |
NewerOlder