lyq.me@qq.com 3 months ago
parent
commit
22a8c53550
8 changed files with 142 additions and 142 deletions
  1. 61 0
      .github/workflows/build.yml
  2. 10 10
      lib/actor.dart
  3. 10 10
      lib/home.dart
  4. 2 0
      lib/main.dart
  5. 11 10
      lib/top.dart
  6. 10 10
      lib/year.dart
  7. 38 38
      pubspec.lock
  8. 0 64
      pubspec.yaml

+ 61 - 0
.github/workflows/build.yml

@@ -0,0 +1,61 @@
+name: CI
+on:
+  push:
+    branches: [ master , main]
+  pull_request:
+    branches: [ master , main]
+jobs:
+  build:
+    strategy:
+      matrix:
+        os: [ubuntu-latest]
+    runs-on: ${{matrix.os}}
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Setup Java JDK
+        uses: actions/setup-java@v2
+        with:
+          distribution: 'adopt'
+          java-version: "8.x"
+
+      - name: Flutter action
+        uses: subosito/flutter-action@v1.5.3
+        with:
+          channel: "stable"
+          flutter-version: "2.5.2"
+
+      - name: Cache Dependencies
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.gradle/caches
+            ~/.gradle/wrapper
+            Pods
+          key: |
+            ${{runner.OS}}-gradle-caches-${{ hashFiles('pubspec.lock') }}
+            ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
+          restore-keys: |
+            ${{ runner.os }}-pods-
+            ${{ runner.os }}-gradle-
+
+      - name: Install Dependencies
+        if: steps.cache.outputs.cache-hit != 'true'
+        run: flutter pub get
+
+      - name: Build apk
+        if: ${{ runner.os == 'Linux' }}
+        run: flutter build apk --debug --no-sound-null-safety
+
+      # output some file:
+      - name: artifact
+        uses: actions/upload-artifact@v2
+        with:
+          name: ${{runner.OS}}-artifact
+          path: |
+            # build/app/outputs/flutter-apk/**/*.apk
+            build/app/outputs/flutter-apk/app.apk
+            build/ios/**/*.ipa
+            build/web/web-app.zip
+            build/windows/runner/Release/

+ 10 - 10
lib/actor.dart

@@ -10,7 +10,7 @@ class Actor extends StatelessWidget {
 
   @override
   Widget build(BuildContext context) {
-    var text_style = new TextStyle(
+    var text_style = TextStyle(
       fontWeight: FontWeight.bold,
       fontSize: 20,
     );
@@ -26,34 +26,34 @@ class Actor extends StatelessWidget {
       ), //Appbar
       body: ListView(children: [
         for (var point = 0; point < movieData.length; point++)
-          new Container(
-              child: new Flex(
+          Container(
+              child: Flex(
                 direction: Axis.horizontal,
                 textDirection: TextDirection.ltr,
                 children: [
-                  new Expanded(
+                  Expanded(
                       flex: 1,
-                      child: new Container(
+                      child: Container(
                           child: Image.asset('assets/poster/' +
                               movieData[point]["actorimage"]),
                           margin: EdgeInsets.fromLTRB(0, 0, 10, 0))),
-                  new Expanded(
+                  Expanded(
                       flex: 1,
-                      child: new Column(
+                      child: Column(
                           crossAxisAlignment: CrossAxisAlignment.start,
                           children: [
-                            new Container(
+                            Container(
                                 child: Text(movieData[point]["actorname"],
                                     style: text_style),
                                 margin: EdgeInsets.fromLTRB(0, 0, 2, 2)),
-                            new Container(
+                            Container(
                               child: Text(
                                   'Movie:' + movieData[point]["movietitle"],
                                   style: TextStyle(
                                       fontSize: 18,
                                       fontStyle: FontStyle.italic)),
                             ),
-                            new Container(
+                            Container(
                               child: Row(
                                 children: [
                                   Text(

+ 10 - 10
lib/home.dart

@@ -10,7 +10,7 @@ class Home extends StatelessWidget {
 
   @override
   Widget build(BuildContext context) {
-    var text_style = new TextStyle(
+    var text_style = TextStyle(
       fontWeight: FontWeight.bold,
       fontSize: 20,
     );
@@ -26,27 +26,27 @@ class Home extends StatelessWidget {
       ), //Appbar
       body: ListView(children: [
         for (var point = 0; point < movieData.length; point++)
-          new Container(
-              child: new Flex(
+          Container(
+              child: (
                 direction: Axis.horizontal,
                 textDirection: TextDirection.ltr,
                 children: [
-                  new Expanded(
+                  Expanded(
                       flex: 1,
-                      child: new Container(
+                      child: Container(
                           child: Image.asset('assets/poster/' +
                               movieData[point]["postimages"]),
                           margin: EdgeInsets.fromLTRB(0, 0, 10, 0))),
-                  new Expanded(
+                  Expanded(
                       flex: 1,
-                      child: new Column(
+                      child: Column(
                           crossAxisAlignment: CrossAxisAlignment.start,
                           children: [
-                            new Container(
+                            Container(
                                 child: Text(movieData[point]["movietitle"],
                                     style: text_style),
                                 margin: EdgeInsets.fromLTRB(0, 0, 2, 2)),
-                            new Container(
+                            Container(
                               child: Row(
                                 children: [
                                   Text(
@@ -62,7 +62,7 @@ class Home extends StatelessWidget {
                                 ],
                               ),
                             ),
-                            new Container(
+                            Container(
                               child: Text(
                                   'Score' +
                                       movieData[point]["ratings"].toString() +

+ 2 - 0
lib/main.dart

@@ -8,6 +8,8 @@ import 'home.dart';
 void main() => runApp(MyApp());
 
 class MyApp extends StatelessWidget {
+  const MyApp({Key? key}) : super(key: key);
+
   // This widget is the root of your application.
   @override
   Widget build(BuildContext context) {

+ 11 - 10
lib/top.dart

@@ -10,7 +10,7 @@ class Top extends StatelessWidget {
 
   @override
   Widget build(BuildContext context) {
-    var text_style = new TextStyle(
+    var text_style = TextStyle(
       fontWeight: FontWeight.bold,
       fontSize: 20,
     );
@@ -27,29 +27,30 @@ class Top extends StatelessWidget {
       ), //Appbar
       body: ListView(children: [
         for (var point = 0; point < movieData.length; point++)
-          new Container(
-              child: new Flex(
+          Container(
+              child: Flex(
                 direction: Axis.horizontal,
                 textDirection: TextDirection.ltr,
                 children: [
-                  new Expanded(
+                  Expanded(
                       flex: 1,
-                      child: new Container(
+                      child: Container(
                           child: Image.asset('assets/poster/' +
                               movieData[point]["postimages"]),
                           margin: EdgeInsets.fromLTRB(0, 0, 10, 0))),
-                  new Expanded(
+                  Expanded(
                       flex: 1,
-                      child: new Column(
+                      child: Column(
                           crossAxisAlignment: CrossAxisAlignment.start,
                           children: [
-                            new Container(
+                            Container(
                                 child: Text(
-                                    movieData[point]["ratings"].toString() +"%:"+
+                                    movieData[point]["ratings"].toString() +
+                                        "%:" +
                                         movieData[point]["movietitle"],
                                     style: text_style),
                                 margin: EdgeInsets.fromLTRB(0, 0, 2, 2)),
-                            new Container(
+                            Container(
                               child: Row(
                                 children: [
                                   Text(

+ 10 - 10
lib/year.dart

@@ -10,7 +10,7 @@ class Year extends StatelessWidget {
 
   @override
   Widget build(BuildContext context) {
-    var text_style = new TextStyle(
+    var text_style = TextStyle(
       fontWeight: FontWeight.bold,
       fontSize: 20,
     );
@@ -27,27 +27,27 @@ class Year extends StatelessWidget {
       ), //Appbar
       body: ListView(children: [
         for (var point = 0; point < movieData.length; point++)
-          new Container(
-              child: new Flex(
+          Container(
+              child: Flex(
                 direction: Axis.horizontal,
                 textDirection: TextDirection.ltr,
                 children: [
-                  new Expanded(
+                  Expanded(
                       flex: 1,
-                      child: new Container(
+                      child: Container(
                           child: Image.asset('assets/poster/' +
                               movieData[point]["postimages"]),
                           margin: EdgeInsets.fromLTRB(0, 0, 10, 0))),
-                  new Expanded(
+                  Expanded(
                       flex: 1,
-                      child: new Column(
+                      child: Column(
                           crossAxisAlignment: CrossAxisAlignment.start,
                           children: [
-                            new Container(
+                            Container(
                                 child: Text(movieData[point]["movietitle"],
                                     style: text_style),
                                 margin: EdgeInsets.fromLTRB(0, 0, 2, 2)),
-                            new Container(
+                            Container(
                               child: Row(
                                 children: [
                                   Text(
@@ -63,7 +63,7 @@ class Year extends StatelessWidget {
                                 ],
                               ),
                             ),
-                            new Container(
+                            Container(
                               child: Text(
                                   'Score' +
                                       movieData[point]["ratings"].toString() +

+ 38 - 38
pubspec.lock

@@ -5,58 +5,58 @@ packages:
     dependency: transitive
     description:
       name: async
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
-    version: "2.8.1"
+    version: "2.8.2"
   boolean_selector:
     dependency: transitive
     description:
       name: boolean_selector
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
     version: "2.1.0"
   characters:
     dependency: transitive
     description:
       name: characters
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.1.0"
+    version: "1.2.0"
   charcode:
     dependency: transitive
     description:
       name: charcode
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
     version: "1.3.1"
   clock:
     dependency: transitive
     description:
       name: clock
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
     version: "1.1.0"
   collection:
     dependency: transitive
     description:
       name: collection
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.15.0"
+    version: "1.16.0"
   cupertino_icons:
     dependency: "direct main"
     description:
       name: cupertino_icons
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.0.3"
+    version: "1.0.4"
   fake_async:
     dependency: transitive
     description:
       name: fake_async
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.2.0"
+    version: "1.3.0"
   flutter:
     dependency: "direct main"
     description: flutter
@@ -66,7 +66,7 @@ packages:
     dependency: "direct dev"
     description:
       name: flutter_lints
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
     version: "1.0.4"
   flutter_test:
@@ -78,30 +78,37 @@ packages:
     dependency: transitive
     description:
       name: lints
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
     version: "1.0.1"
   matcher:
     dependency: transitive
     description:
       name: matcher
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "0.12.11"
+  material_color_utilities:
+    dependency: transitive
+    description:
+      name: material_color_utilities
+      url: "https://pub.dartlang.org"
     source: hosted
-    version: "0.12.10"
+    version: "0.1.4"
   meta:
     dependency: transitive
     description:
       name: meta
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
     version: "1.7.0"
   path:
     dependency: transitive
     description:
       name: path
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.8.0"
+    version: "1.8.1"
   sky_engine:
     dependency: transitive
     description: flutter
@@ -111,57 +118,50 @@ packages:
     dependency: transitive
     description:
       name: source_span
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.8.1"
+    version: "1.8.2"
   stack_trace:
     dependency: transitive
     description:
       name: stack_trace
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
     version: "1.10.0"
   stream_channel:
     dependency: transitive
     description:
       name: stream_channel
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
     version: "2.1.0"
   string_scanner:
     dependency: transitive
     description:
       name: string_scanner
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
     version: "1.1.0"
   term_glyph:
     dependency: transitive
     description:
       name: term_glyph
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
     version: "1.2.0"
   test_api:
     dependency: transitive
     description:
       name: test_api
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
-    version: "0.4.2"
-  typed_data:
-    dependency: transitive
-    description:
-      name: typed_data
-      url: "https://pub.flutter-io.cn"
-    source: hosted
-    version: "1.3.0"
+    version: "0.4.9"
   vector_math:
     dependency: transitive
     description:
       name: vector_math
-      url: "https://pub.flutter-io.cn"
+      url: "https://pub.dartlang.org"
     source: hosted
-    version: "2.1.0"
+    version: "2.1.2"
 sdks:
-  dart: ">=2.12.0 <3.0.0"
+  dart: ">=2.14.0 <3.0.0"

+ 0 - 64
pubspec.yaml

@@ -1,89 +1,25 @@
 name: project02marinzhang
 description: A new Flutter application.
-
-# The following line prevents the package from being accidentally published to
-# pub.dev using `flutter pub publish`. This is preferred for private packages.
 publish_to: 'none' # Remove this line if you wish to publish to pub.dev
-
-# The following defines the version and build number for your application.
-# A version number is three numbers separated by dots, like 1.2.43
-# followed by an optional build number separated by a +.
-# Both the version and the builder number may be overridden in flutter
-# build by specifying --build-name and --build-number, respectively.
-# In Android, build-name is used as versionName while build-number used as versionCode.
-# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
-# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
-# Read more about iOS versioning at
-# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
 version: 1.0.0+1
 
 environment:
   sdk: ">=2.12.0 <3.0.0"
 
-# Dependencies specify other packages that your package needs in order to work.
-# To automatically upgrade your package dependencies to the latest versions
-# consider running `flutter pub upgrade --major-versions`. Alternatively,
-# dependencies can be manually updated by changing the version numbers below to
-# the latest version available on pub.dev. To see which dependencies have newer
-# versions available, run `flutter pub outdated`.
 dependencies:
   flutter:
     sdk: flutter
-
-
-  # The following adds the Cupertino Icons font to your application.
-  # Use with the CupertinoIcons class for iOS style icons.
   cupertino_icons: ^1.0.3
 
 dev_dependencies:
   flutter_test:
     sdk: flutter
 
-  # The "flutter_lints" package below contains a set of recommended lints to
-  # encourage good coding practices. The lint set provided by the package is
-  # activated in the `analysis_options.yaml` file located at the root of your
-  # package. See that file for information about deactivating specific lint
-  # rules and activating additional ones.
   flutter_lints: ^1.0.0
 
-# For information on the generic Dart part of this file, see the
-# following page: https://dart.dev/tools/pub/pubspec
-
-# The following section is specific to Flutter.
 flutter:
-
-  # The following line ensures that the Material Icons font is
-  # included with your application, so that you can use the icons in
-  # the material Icons class.
   uses-material-design: true
-
-  # To add assets to your application, add an assets section, like this:
   assets:
    - assets/actorimages/
    - assets/poster/
 
-  # An image asset can refer to one or more resolution-specific "variants", see
-  # https://flutter.dev/assets-and-images/#resolution-aware.
-
-  # For details regarding adding assets from package dependencies, see
-  # https://flutter.dev/assets-and-images/#from-packages
-
-  # To add custom fonts to your application, add a fonts section here,
-  # in this "flutter" section. Each entry in this list should have a
-  # "family" key with the font family name, and a "fonts" key with a
-  # list giving the asset and other descriptors for the font. For
-  # example:
-  # fonts:
-  #   - family: Schyler
-  #     fonts:
-  #       - asset: fonts/Schyler-Regular.ttf
-  #       - asset: fonts/Schyler-Italic.ttf
-  #         style: italic
-  #   - family: Trajan Pro
-  #     fonts:
-  #       - asset: fonts/TrajanPro.ttf
-  #       - asset: fonts/TrajanPro_Bold.ttf
-  #         weight: 700
-  #
-  # For details regarding fonts from package dependencies,
-  # see https://flutter.dev/custom-fonts/#from-packages