Skip to content

Commit

Permalink
feat() add sample flutter app
Browse files Browse the repository at this point in the history
  • Loading branch information
develite98 committed Nov 1, 2023
1 parent 53e6449 commit c0d4c77
Show file tree
Hide file tree
Showing 19 changed files with 1,101 additions and 7 deletions.
44 changes: 44 additions & 0 deletions apps/mix-flutt/.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
30 changes: 30 additions & 0 deletions apps/mix-flutt/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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: "d211f42860350d914a5ad8102f9ec32764dc6d06"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
- platform: web
create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06

# 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'
19 changes: 19 additions & 0 deletions apps/mix-flutt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# mix_flutt

cms app

## Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)

For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

How to install flutter
https://topdev.vn/blog/huong-dan-cai-dat-flutter
28 changes: 28 additions & 0 deletions apps/mix-flutt/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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.dev/lints.
#
# 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

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
69 changes: 69 additions & 0 deletions apps/mix-flutt/lib/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import 'package:flutter/material.dart';

void main() {
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({super.key});

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}

class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});

final String title;

@override
State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;

void _incrementCounter() {
setState(() {
_counter++;
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headlineMedium,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}
86 changes: 86 additions & 0 deletions apps/mix-flutt/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"name": "mix-flutt",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/mix-flutt/src",
"projectType": "application",
"targets": {
"analyze": {
"executor": "nx:run-commands",
"options": {
"command": "flutter analyze",
"cwd": "apps/mix-flutt"
}
},
"clean": {
"executor": "nx:run-commands",
"options": {
"command": "flutter clean",
"cwd": "apps/mix-flutt"
}
},
"format": {
"executor": "nx:run-commands",
"options": {
"command": "dart format apps/mix-flutt/*",
"cwd": "apps/mix-flutt"
}
},
"test": {
"executor": "nx:run-commands",
"options": {
"command": "flutter test",
"cwd": "apps/mix-flutt"
}
},
"doctor": {
"executor": "nx:run-commands",
"options": {
"command": "flutter doctor",
"cwd": "apps/mix-flutt"
}
},
"assemble": {
"executor": "nx:run-commands",
"options": {
"command": "flutter assemble",
"cwd": "apps/mix-flutt"
}
},
"attach": {
"executor": "nx:run-commands",
"options": {
"command": "flutter attach",
"cwd": "apps/mix-flutt"
}
},
"drive": {
"executor": "nx:run-commands",
"options": {
"command": "flutter drive",
"cwd": "apps/mix-flutt"
}
},
"gen-l10n": {
"executor": "nx:run-commands",
"options": {
"command": "flutter gen-l10n",
"cwd": "apps/mix-flutt"
}
},
"install": {
"executor": "nx:run-commands",
"options": {
"command": "flutter install",
"cwd": "apps/mix-flutt"
}
},
"run": {
"executor": "nx:run-commands",
"options": {
"command": "flutter run",
"cwd": "apps/mix-flutt"
}
}
},
"tags": []
}
Loading

0 comments on commit c0d4c77

Please sign in to comment.