From 496e981daf8ddc4f8b16e01e66f4b541b82e4cca Mon Sep 17 00:00:00 2001 From: Joey Boerwinkel Date: Mon, 1 Jul 2024 11:08:06 +0200 Subject: [PATCH] chore: create example app structure --- apps/example/.gitignore | 54 +++++++++++++++++++++++++ apps/example/README.md | 1 + apps/example/analysis_options.yaml | 9 +++++ apps/example/lib/main.dart | 64 ++++++++++++++++++++++++++++++ apps/example/pubspec.yaml | 24 +++++++++++ apps/example/test/widget_test.dart | 14 +++++++ 6 files changed, 166 insertions(+) create mode 100644 apps/example/.gitignore create mode 100644 apps/example/README.md create mode 100644 apps/example/analysis_options.yaml create mode 100644 apps/example/lib/main.dart create mode 100644 apps/example/pubspec.yaml create mode 100644 apps/example/test/widget_test.dart diff --git a/apps/example/.gitignore b/apps/example/.gitignore new file mode 100644 index 0000000..9e04fed --- /dev/null +++ b/apps/example/.gitignore @@ -0,0 +1,54 @@ +# 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 +.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 + +# platforms should not be part of the example +android +ios +linux +macos +windows +web + +.metadata +pubspec.lock \ No newline at end of file diff --git a/apps/example/README.md b/apps/example/README.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/apps/example/README.md @@ -0,0 +1 @@ + diff --git a/apps/example/analysis_options.yaml b/apps/example/analysis_options.yaml new file mode 100644 index 0000000..31b4b51 --- /dev/null +++ b/apps/example/analysis_options.yaml @@ -0,0 +1,9 @@ +include: package:flutter_iconica_analysis/analysis_options.yaml + +# Possible to overwrite the rules from the package + +analyzer: + exclude: + +linter: + rules: diff --git a/apps/example/lib/main.dart b/apps/example/lib/main.dart new file mode 100644 index 0000000..b1d496c --- /dev/null +++ b/apps/example/lib/main.dart @@ -0,0 +1,64 @@ +import "package:flutter/material.dart"; + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) => 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({required this.title, super.key}); + final String title; + + @override + State createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + int _counter = 0; + + void _incrementCounter() { + setState(() { + _counter++; + }); + } + + @override + Widget build(BuildContext context) => Scaffold( + appBar: AppBar( + backgroundColor: Theme.of(context).colorScheme.inversePrimary, + title: Text(widget.title), + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + 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. + ); +} diff --git a/apps/example/pubspec.yaml b/apps/example/pubspec.yaml new file mode 100644 index 0000000..fd6a662 --- /dev/null +++ b/apps/example/pubspec.yaml @@ -0,0 +1,24 @@ +name: flutter_availability_example +description: "Flutter Availability Example App" +publish_to: "none" +version: 1.0.0+1 + +environment: + sdk: ">=3.4.3 <4.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_availability: + path: ../../packages/flutter_availability + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_iconica_analysis: + git: + url: https://github.com/Iconica-Development/flutter_iconica_analysis + ref: 7.0.0 + +flutter: + uses-material-design: true diff --git a/apps/example/test/widget_test.dart b/apps/example/test/widget_test.dart new file mode 100644 index 0000000..1f7b336 --- /dev/null +++ b/apps/example/test/widget_test.dart @@ -0,0 +1,14 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import "package:flutter_test/flutter_test.dart"; + +void main() { + testWidgets("Counter increments smoke test", (WidgetTester tester) async { + expect(true, true); + }); +}