This file contains hidden or 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 2025 Fredrick Allan Grott. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
import 'package:lifecycle/lifecycle.dart'; | |
import 'package:userinterface/core/lifecycle/app_lifecycle_globals.dart'; | |
/// Subscribes lifecycle events for normal widgets. | |
/// This is used to wrap the scaffold of the app so that |
This file contains hidden or 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 2025 Fredrick Allan Grott. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
import 'dart:ui'; | |
/// Used with the AppLifecycleMixin scaffold wrapper | |
/// and in MediaQuery extensions I use this to get the devicePixelRatio | |
/// and size as the size will represent the physical size in foldables and | |
/// big screens where multiple windows may exist. |
This file contains hidden or 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:fast_immutable_collections/fast_immutab le_collections.dart'; | |
class Students with FromISetMixin<Student, Students> { | |
final ISet<Student> _students; | |
Students([Iterable<Student> students]) : _students = ISet(students); | |
Students newInstance(ISet<Student> iset) => Students(iset); | |
ISet<Student> get iter => _students; |
This file contains hidden or 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 Student implements Comparable<Student> { | |
final String name; | |
const Student(this.name); | |
String toString() => "Student: $name"; | |
bool operator ==(Object other) => | |
identical(this, other) || | |
other is Student && |
This file contains hidden or 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:fast_immutable_collections/fast_immutable_collections.dart'; | |
class Employees with FromIListMixin<Person. Employees> { | |
final Ilist<Person> _employees; | |
Employees([Iterable<Person> employees]) : _employees = IList(employees); | |
Employees newInstance(IList<Person> iList) => Employees(iList); |
This file contains hidden or 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 implements Comparable<Person>{ | |
final String name; | |
Person(this.name); | |
String toString() => name; | |
bool operator ==(Object other) => identical(this, other) || other is Person; | |
int get hashCode => name.hasCode; |
This file contains hidden or 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
PersonFixture.factory.makeSingle(); | |
PersonFixture.factory().empty("George").make(); | |
PersonJSONFixture.factory().makeJsonObject(); | |
PersonJSONFixture.factory().empty("George").makeJsonObject(); |
This file contains hidden or 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:data_fixture_dart/data_fixture_dart.dart'; | |
import 'person.dart'; | |
extension PersonFixture on Person { | |
static _PersonFixtureFactory factory() => _PersonFixtureFactory(); | |
} | |
class _PersonFixtureFactory extends FixtureFactory<person>{ | |
@override | |
FixtureDefinition<Person> defintion() => define( |
This file contains hidden or 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:json_annotation/json_annotation.dart'; | |
import 'package:equatable/equatable.dart'; | |
import 'package:uuid/uuid.dart'; | |
import 'data_id_mixin.dart'; | |
part 'person.g.dart'; | |
@immutable | |
@JsonSerializable() | |
class Person with DataIdMixin, EquatableMixin { |
This file contains hidden or 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
mixin DataIdMixin { | |
late String id; | |
} |