Skip to content

Commit

Permalink
Merge pull request #197 from tyler-jewell/stable
Browse files Browse the repository at this point in the history
add new example app
  • Loading branch information
iampawan authored May 21, 2024
2 parents 7df3271 + 995e4f5 commit f5068f2
Show file tree
Hide file tree
Showing 200 changed files with 1,256 additions and 7,389 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/test-example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test Example App

on:
push:

jobs:
test:
runs-on: ubuntu-latest
concurrency:
group: 'test-example-app'

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- run: dart pub global activate melos
- run: cd example && melos all
9 changes: 8 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
{}
{
"cSpell.words": [
"autofocus",
"dartpad",
"Kumar",
"Pawan"
]
}
26 changes: 0 additions & 26 deletions example/.firebase/hosting.YnVpbGQvd2Vi.cache

This file was deleted.

5 changes: 0 additions & 5 deletions example/.firebaserc

This file was deleted.

45 changes: 0 additions & 45 deletions example/.gitignore

This file was deleted.

45 changes: 0 additions & 45 deletions example/.metadata

This file was deleted.

20 changes: 20 additions & 0 deletions example/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM dart:latest

ARG FLUTTER_CHANNEL=stable

ENV FLUTTER_GIT_URL=https://github.com/flutter/flutter.git
ENV FLUTTER_HOME=/flutter
ENV PATH="$PATH:$FLUTTER_HOME/bin"

# Clone and configure Flutter
RUN git clone $FLUTTER_GIT_URL $FLUTTER_HOME -b $FLUTTER_CHANNEL --depth 1 \
&& flutter config --enable-web

# activate melos
RUN dart pub global activate melos

WORKDIR /app

COPY . .

CMD ["bash", "-c"]
59 changes: 49 additions & 10 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,55 @@
# example
# VelocityX Example Application

A new Flutter project.
Welcome to the VelocityX example application. This application is designed to showcase the capabilities of the VelocityX library, a minimalist Flutter framework that helps you build applications rapidly. It uses VelocityX for state management (VxState), UI extensions, and more.

## Getting Started
## Application Overview

This project is a starting point for a Flutter application.
The application is a simple user management system. It uses `VxState` for state management, which allows us to manage the state of our application in a predictable way. The UI is built using various VelocityX extensions, which provide a wide range of pre-styled widgets and utility functions for building responsive layouts.

A few resources to get you started if this is your first Flutter project:
## Running the Application

- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
This project uses Melos to manage scripts for building, testing, and analyzing the code. Here are some of the scripts you can run:

- **Build**: To build the application, run the following command in your terminal:

```sh
melos run build
```

- **Analyze**: To analyze the dart code:

```sh
melos analyze
```

- **Format**: To format the code:

```sh
melos format
```

- **Build**: To run flutter tests (including goldens test):

```sh
melos test
```

- **Run all** To run all of these (think CI machine, [build, format, analyze, test]):

```sh
melos all
```

## Application Structure

The application is structured as follows:

- lib/main.dart: This is the entry point of the application.
- lib/data: This directory contains the data models and related code. For example, user.dart defines the User model.
- lib/mutations: This directory contains the mutations, which are functions that encapsulate changes to the state of the application. For example, get_user.dart defines a function for fetching a user.
- lib/pages: This directory contains the pages of the application. Each page is a separate widget. For example, home_page.dart defines the home page of the application.
- lib/stores: This directory contains the stores, which manage the state of the application.
- test: This directory contains the tests for the application.

We hope you find this example application useful as a starting point for your own VelocityX projects. Happy coding!

For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
29 changes: 12 additions & 17 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
include: package:flutter_lints/flutter.yaml
include: package:very_good_analysis/analysis_options.yaml

linter:
# In addition to the flutter_lints
rules:
- always_declare_return_types
- avoid_void_async
- cancel_subscriptions
- close_sinks
- directives_ordering
- flutter_style_todos
- package_api_docs
- test_types_in_equals
- throw_in_finally
- unawaited_futures
- unnecessary_statements
- unsafe_html
- use_super_parameters
analyzer:
exclude:
- "**/*.g.dart"
- "**/*.freezed.dart"
- "**/*.gr.dart"
- "**/*.icon.dart"
- "**/*.part.dart"
- "**/*.pbenum.dart"
- "**/*.pb.dart"
- "**/*.pbjson.dart"
- "**/*.pbgrpc.dart"
7 changes: 0 additions & 7 deletions example/android/.gitignore

This file was deleted.

63 changes: 0 additions & 63 deletions example/android/app/build.gradle

This file was deleted.

7 changes: 0 additions & 7 deletions example/android/app/src/debug/AndroidManifest.xml

This file was deleted.

Loading

0 comments on commit f5068f2

Please sign in to comment.