Skip to content

Commit

Permalink
chore: previous code
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Bühler committed Mar 12, 2023
1 parent 54418e6 commit 924735f
Show file tree
Hide file tree
Showing 160 changed files with 5,988 additions and 57 deletions.
95 changes: 69 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,34 +1,77 @@
# See https://www.dartlang.org/guides/libraries/private-files
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Files and directories created by pub
# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
build/

pubspec.lock

# Generated Dart Files
*.g.dart
# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java

# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/
# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Flutter.podspec
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

# Avoid committing generated Javascript files:
*.dart.js
*.info.json # Produced by the --dump-info flag.
*.js # When generated by dart2js. Don't specify *.js if your
# project includes source files written in JavaScript.
*.js_
*.js.deps
*.js.map

# OS Files
.DS_Store
Thumbs.db

# IDEs
.idea/
*.iml
.vscode/
.vs/
# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
pubspec.lock
10 changes: 10 additions & 0 deletions .metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 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 and should not be manually edited.

version:
revision: f139b11009aeb8ed2a3a3aa8b0066e482709dde3
channel: stable

project_type: package
65 changes: 65 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
## 0.2.3
- Completes the revert to the `HookViewModelWidget` to remove breaking changes
- Reverts breaking change and instead deprecates the `HookViewModelWidget`
- Replaced HookViewModelWidget with StackedHookView
- Updated example app
- Updated README
- HookViewModelWidget -> StackedHookView

## 0.2.2

- Updated flutter_hooks to 0.18.2+1

## 0.2.1+2

- Updates Example's kotlin version to 1.4.10
- Updates Example's Android Embedding to Version 2

## 0.2.1+1

- Upgraded the dependency on `provider` to 6.0.0

## 0.2.1

- `flutter_hooks`: ^0.16.0 -> ^0.17.0

## 0.1.4

- `flutter_hooks`: ^0.15.0 -> ^0.16.0
- `provider`: ^4.3.1 -> ^5.0.0

## 0.1.3+2

- Update flutter_hooks 0.15.0

## 0.1.3+1

- Update flutter_hooks

## 0.1.3

- Update flutter_hooks and provider

## 0.1.2

- Hook widget has a const constructor

## 0.1.1+3

- Changelog style updates

## 0.1.1+2

- Added key to HookViewModelWidget constructor

## 0.1.1+1

- Updates webpage for package

## 0.1.1

- Export Hooks file

## 0.1.0

- Adds HookViewModelWidget
82 changes: 51 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,51 @@
# New Package for Stacked

Created from the `package-template`.

After creating the repository, proceed with the following instructions:

- Update the repository settings to adhere to the conventions:
- General:
- No Wikis
- No Issues
- No Sponsorships
- Preserve this repository
- No Discussions
- No Projects
- Don't allow merge commits
- Allow squash merging with default commit message set to "Default to pull request title and commit details"
- Don't allow rebase merging
- Always suggest updating pull requests
- Allow auto-merge
- Automatically delete head branches
- Branch protection rule (`main`):
- Require a pull request before merging
- Dismiss stale pull request approvals when new commits are pushed
- Allow specified actors to bypass required pull requests -> `Dane Mackier` (or whoever is the current owner of the personal access token in the organization secrets `REPO_DEPLOYMENT_TOKEN`)
- Require status checks to pass before merging
- Require branches to be up to date before merging
- Add status check `Linting and Testing` (to select this, the workflow must have been run at least once. This can be done manually since the workflow has "workflow_dispatch" as a trigger)
- Require conversation resolution before merging
- Require linear history
- Create the flutter package with `flutter create -t package --project-name NAME .`
- Update the content in the `README` file.
# Stacked Hooks

This package contains widgets that allow you to use the Flutter Hooks package with the `StackedView` in the Stacked architecture.

## StackedHookView

The `StackedView` is an implementation of a widget class that returns a value provided by `Provider` as a parameter in the build function of the widget. This allows for easier consumption and use of ViewModel without boilerplate. The `StackedHookView` allows you to use this widget and make use of Flutter Hooks inside the build function. This is very useful when you want to use `TextEditing` controllers and you're implementing this architecture.

```dart
// View that creates and provides the viewmodel
class StackedHookViewExample extends StackedView<HomeViewModel> {
const StackedHookViewExample({Key key}) : super(key: key);
@override
Widget builder(BuildContext context, HomeViewModel model, Widget? child) {
return Scaffold(
body: Center(child: _HookForm()),
);
}
@override
HomeViewModel modelBuilder(BuildContext context) {
return HomeViewModel();
}
}
// Form that makes use of the ViewModel provided above but also makes use of hooks
class _HookForm extends StackedHookView<HomeViewModel> {
@override
Widget buildStackedView(BuildContext context, HomeViewModel model) {
final title = useTextEditingController();
return Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(model.title),
TextField(controller: title, onChanged: model.updateTitle),
],
);
}
}
// ViewModel
class HomeViewModel extends BaseViewModel {
String title = 'default';
void updateTitle(String value) {
title = value;
notifyListeners();
}
}
```
33 changes: 33 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
analyzer:
# exclude the .dialog.dart generated files cause they require
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

exclude:
- example/**
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
44 changes: 44 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
45 changes: 45 additions & 0 deletions example/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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.

version:
revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
channel: stable

project_type: app

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

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
Loading

0 comments on commit 924735f

Please sign in to comment.