Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
514baac
Clean up statle documentation
jshep23 Apr 19, 2026
9332afa
added current validation state. added additive extension (nonbreaking).
jshep23 Apr 19, 2026
9a5ecbd
add docs to new current validation classes. fix docs in view model. e…
jshep23 Apr 19, 2026
26e88a0
add some docs around the _omitted internal variable. added unit tests
jshep23 Apr 19, 2026
92ac8e5
progress on integrating current validation with new current text cont…
jshep23 Apr 19, 2026
4305274
Add option to localize default validation errors
jshep23 Apr 19, 2026
984cc18
Add additional docs to the current text controller
jshep23 Apr 19, 2026
1e1b2f1
update core web files for example app
jshep23 Apr 19, 2026
3d8eb5c
Progress on new space themed example app. added logos. removed old ex…
jshep23 Apr 19, 2026
a37eaee
added flight forms page. redfactored app view model
jshep23 Apr 19, 2026
1972266
added launch missing, map and telemetry examples
jshep23 Apr 19, 2026
761882a
added widget tests
jshep23 Apr 19, 2026
f2b0b25
add third version branding
jshep23 Apr 19, 2026
601ffee
Move viewmodels out of widget pages
jshep23 Apr 19, 2026
798db59
clean up
jshep23 Apr 20, 2026
480b084
clean up
jshep23 Apr 20, 2026
8987f97
clean up
jshep23 Apr 20, 2026
a326e34
add code examples to example app. add link to third version website
jshep23 Apr 20, 2026
1eb402b
Restructure validation results to produce typed issues. This is to su…
jshep23 Apr 20, 2026
44b89e9
Update Readmes
jshep23 Apr 20, 2026
6aa8763
Change current validation to explicit opt in. Reduces footguns. Updat…
jshep23 Apr 20, 2026
12ffa0b
clean up example propery initialization
jshep23 Apr 20, 2026
aefd81f
Clean up validation registration. better support context based locali…
jshep23 Apr 20, 2026
49ab5ad
Remove unused mixin. Remove tests
jshep23 Apr 20, 2026
c8592bb
Tie validation execution to TextFormFields. Added convenience Current…
jshep23 Apr 20, 2026
34986eb
Added tests for text form field integration
jshep23 Apr 20, 2026
18de315
Update readme
jshep23 Apr 20, 2026
a628882
add convenience setter functions for various properties
jshep23 Apr 21, 2026
1225033
Rename factories on CurrentTextController for consistency
jshep23 Apr 21, 2026
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
285 changes: 246 additions & 39 deletions README.md

Large diffs are not rendered by default.

29 changes: 7 additions & 22 deletions example/.metadata
Original file line number Diff line number Diff line change
@@ -1,38 +1,23 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
# This file should be version controlled and should not be manually edited.

version:
revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
channel: stable
revision: "cc0734ac716fbb8b90f3f9db8020958b1553afa7"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
- platform: android
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
- platform: ios
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
- platform: linux
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
- platform: macos
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
create_revision: cc0734ac716fbb8b90f3f9db8020958b1553afa7
base_revision: cc0734ac716fbb8b90f3f9db8020958b1553afa7
- platform: web
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
- platform: windows
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
create_revision: cc0734ac716fbb8b90f3f9db8020958b1553afa7
base_revision: cc0734ac716fbb8b90f3f9db8020958b1553afa7

# User provided section

Expand Down
34 changes: 31 additions & 3 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,35 @@
# Current Counter Example
# Current Mission Control Example

This is a version of the classic Flutter Counter App example, implemented using Current.
This example is a multi-page mission-control showcase for Current. Instead of a simple counter app, it demonstrates how Current handles typed properties, shared app state, issue-based validation, text input binding, collection mutation, custom events, and instructional code snippets inside one responsive Flutter application.

## What The App Demonstrates

- Mission Overview: a guided summary of the main Current capabilities surfaced by the app.
- Telemetry Lab: typed `CurrentProperty` values, dirty tracking, reset behavior, and batched updates.
- Flight Forms: `CurrentTextController`, `CurrentFieldValidation`, `CurrentValidationGroup`, and issue-based validation rules.
- Star Map Collections: reactive `CurrentListProperty` and `CurrentMapProperty` workflows.
- Launch Events: custom `CurrentStateChanged` events, busy state listeners, and `doAsync` task handling.
- Code Examples: smaller reference snippets that mirror the live demos.

## Running The Example

Simply run `flutter pub get` then `flutter run` from the example folder. This example will work on all platforms.
From the `example` folder:

```bash
flutter pub get
flutter run
```

The example is configured for Android, iOS, macOS, Linux, Windows, and web. You can target a specific device the same way you would with any Flutter app, for example `flutter run -d macos` or `flutter run -d chrome`.

## Where To Start

- Open Flight Forms if you want to see the current validation and text-controller APIs in action.
- Open Telemetry Lab if you want a compact tour of the primitive property types and reset semantics.
- Open Launch Events if you want to inspect busy-state handling and custom event listeners.
- Open Code Examples if you want short snippets before reading the package README.

## Related Documentation

- Package overview and API usage: [../README.md](../README.md)
- API reference: https://pub.dev/documentation/current/latest/
Binary file added example/assets/images/CurrentLogoFull.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/assets/images/CurrentLogoMD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/assets/images/ThirdVersionLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions example/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions example/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
43 changes: 43 additions & 0 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '13.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
9 changes: 0 additions & 9 deletions example/lib/answer_to_life_found_event.dart

This file was deleted.

51 changes: 38 additions & 13 deletions example/lib/application_view_model.dart
Original file line number Diff line number Diff line change
@@ -1,26 +1,51 @@
import 'package:current/current.dart';
import 'package:flutter/material.dart';
import 'dart:math' as math;
import 'package:current_counter_example/components/mission_section.dart';

class ApplicationViewModel extends CurrentViewModel {
final backgroundColor = CurrentProperty(Colors.white);
final selectedSectionIndex = CurrentProperty.integer(
initialValue: 0,
propertyName: 'selectedSection',
);

final CurrentStringProperty title;
final starfieldEnabled = CurrentProperty.boolean(
initialValue: true,
propertyName: 'starfieldEnabled',
);

ApplicationViewModel(this.title);
final missionStatus = CurrentProperty.string(
initialValue: 'All systems nominal. Current is tracking every signal.',
propertyName: 'missionStatus',
);

@override
Iterable<CurrentProperty> get currentProps => [backgroundColor, title];
Iterable<CurrentProperty> get currentProps => [
selectedSectionIndex,
starfieldEnabled,
missionStatus,
];

void changeBackgroundColor(Color color) => backgroundColor(color);
MissionSection get selectedSection =>
MissionSection.values[selectedSectionIndex.value];

void randomizeBackgroundColor() {
final color = Color((math.Random().nextDouble() * 0xFFFFFF).toInt())
.withValues(alpha: 1);
backgroundColor(color);
void selectSection(MissionSection section) {
selectedSectionIndex.value = section.index;
missionStatus.value = switch (section) {
MissionSection.overview =>
'Mission control online. Review every Current capability at a glance.',
MissionSection.telemetry =>
'Telemetry is streaming through typed CurrentProperty values.',
MissionSection.flightForms =>
'Launch approval is running through CurrentTextController and validation.',
MissionSection.starMap =>
'Orbital inventory is reacting through list and map properties.',
MissionSection.launchEvents =>
'Mission event handlers are listening for milestones, busy states, and anomalies.',
MissionSection.codeExamples =>
'Reference snippets are online to show how Current features fit together in code.',
};
}

void reset() {
backgroundColor.reset();
void toggleStarfield() {
starfieldEnabled.value = !starfieldEnabled.value;
}
}
Loading