diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..44106eb --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,27 @@ +name: android workflow +on: +# schedule: +# - cron: "10 16 * * *" + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: '11' + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + - run: flutter pub get + - run: flutter test + - run: flutter build apk + - run: flutter build appbundle diff --git a/.github/workflows/iOS.yml b/.github/workflows/iOS.yml new file mode 100644 index 0000000..e577b69 --- /dev/null +++ b/.github/workflows/iOS.yml @@ -0,0 +1,23 @@ +name: iOS workflow +on: +# schedule: +# - cron: "10 16 * * *" + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + architecture: x64 + - run: flutter pub get + - run: flutter test + - run: flutter build ios --release --no-codesign diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..ef611ba --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: +- repo: https://github.com/dluksza/flutter-analyze-pre-commit + rev: "master" + hooks: + - id: flutter-analyze + args: [lib/*] diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 3eba23e..b1d24cf 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ - + + + + + com.apple.developer.associated-domains + + tpl.ca + + com.apple.developer.authentication-services.autofill-credential-provider + + keychain-access-groups + + $(AppIdentifierPrefix)com.sangshuduo.unofficialtpl + + + diff --git a/lib/main.dart b/lib/main.dart index e834dbe..aade982 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -33,12 +33,13 @@ class MyApp extends StatelessWidget { colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), useMaterial3: true, ), - home: UnofficialTPLca(), + home: const UnofficialTPLca(), ); } } class UnofficialTPLca extends StatefulWidget { + const UnofficialTPLca({super.key}); // This widget is the home page of your application. It is stateful, meaning // that it has a State object (defined below) that contains fields that affect // how it looks. @@ -51,7 +52,7 @@ class UnofficialTPLca extends StatefulWidget { final String title = 'Unofficial tpl.ca app'; @override - _UnofficialTPLcaState createState() => _UnofficialTPLcaState(); + State createState() => _UnofficialTPLcaState(); } class _UnofficialTPLcaState extends State { @@ -69,7 +70,7 @@ class _UnofficialTPLcaState extends State { appBar: AppBar( title: Text(widget.title), ), - body: WebView( + body: const WebView( initialUrl: 'https://tpl.ca', javascriptMode: JavascriptMode.unrestricted,), ); diff --git a/pubspec.yaml b/pubspec.yaml index 4adacdd..8cf9640 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+1 +version: 1.0.1+1 environment: sdk: '>=3.4.3 <4.0.0' diff --git a/test/widget_test.dart b/test/widget_test.dart index 0ce968d..463d9a9 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -5,7 +5,6 @@ // 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/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:unofficial_tpl/main.dart'; @@ -15,16 +14,5 @@ void main() { // Build our app and trigger a frame. await tester.pumpWidget(const MyApp()); - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); }); }