fish 3 months ago
parent
commit
bbd4f3eff2
4 changed files with 22 additions and 22 deletions
  1. 3 3
      android/app/build.gradle
  2. 2 2
      android/build.gradle
  3. 13 13
      lib/home.dart
  4. 4 4
      pubspec.yaml

+ 3 - 3
android/app/build.gradle

@@ -25,7 +25,7 @@ apply plugin: 'com.android.application'
 apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
 
 android {
-    compileSdkVersion 30
+    compileSdkVersion 33
 
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_8
@@ -35,8 +35,8 @@ android {
     defaultConfig {
         // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
         applicationId "me.yoqi.flutter.flutter_app3"
-        minSdkVersion 16
-        targetSdkVersion 30
+        minSdkVersion 21
+        targetSdkVersion 33
         versionCode flutterVersionCode.toInteger()
         versionName flutterVersionName
     }

+ 2 - 2
android/build.gradle

@@ -5,7 +5,7 @@ buildscript {
     }
 
     dependencies {
-        classpath 'com.android.tools.build:gradle:4.1.0'
+        classpath 'com.android.tools.build:gradle:7.2.2'
     }
 }
 
@@ -22,6 +22,6 @@ subprojects {
     project.evaluationDependsOn(':app')
 }
 
-task clean(type: Delete) {
+tasks.register("clean", Delete) {
     delete rootProject.buildDir
 }

+ 13 - 13
lib/home.dart

@@ -10,7 +10,7 @@ class Home extends StatelessWidget {
 
   @override
   Widget build(BuildContext context) {
-    var text_style = TextStyle(
+    var text_style = const TextStyle(
       fontWeight: FontWeight.bold,
       fontSize: 20,
     );
@@ -18,7 +18,7 @@ class Home extends StatelessWidget {
     return Scaffold(
       appBar: AppBar(
         // The title text which will be shown on the action bar
-        title: Center(child: Text("Wes Anderson")),
+        title: const Center(child: Text("Wes Anderson")),
       ),
       drawer: Container(
         color: Colors.grey,
@@ -27,36 +27,37 @@ class Home extends StatelessWidget {
       body: ListView(children: [
         for (var point = 0; point < movieData.length; point++)
           Container(
-              child: (
-                direction: Axis.horizontal,
+              margin: const EdgeInsets.fromLTRB(0, 0, 0, 10),
+              child: Row(
+                // direction: Axis.horizontal,
                 textDirection: TextDirection.ltr,
                 children: [
                   Expanded(
                       flex: 1,
                       child: Container(
+                          margin: const EdgeInsets.fromLTRB(0, 0, 10, 0),
                           child: Image.asset('assets/poster/' +
-                              movieData[point]["postimages"]),
-                          margin: EdgeInsets.fromLTRB(0, 0, 10, 0))),
+                              movieData[point]["postimages"]))),
                   Expanded(
                       flex: 1,
                       child: Column(
                           crossAxisAlignment: CrossAxisAlignment.start,
                           children: [
                             Container(
+                                margin: const EdgeInsets.fromLTRB(0, 0, 2, 2),
                                 child: Text(movieData[point]["movietitle"],
-                                    style: text_style),
-                                margin: EdgeInsets.fromLTRB(0, 0, 2, 2)),
+                                    style: text_style)),
                             Container(
                               child: Row(
                                 children: [
-                                  Text(
+                                  const Text(
                                     "Release Date",
                                     style: TextStyle(
                                       fontSize: 18,
                                     ),
                                   ),
                                   Text(movieData[point]["releasedate"],
-                                      style: TextStyle(
+                                      style: const TextStyle(
                                           fontSize: 18,
                                           fontStyle: FontStyle.italic)),
                                 ],
@@ -67,14 +68,13 @@ class Home extends StatelessWidget {
                                   'Score' +
                                       movieData[point]["ratings"].toString() +
                                       "%",
-                                  style: TextStyle(
+                                  style: const TextStyle(
                                     fontSize: 18,
                                   )),
                             )
                           ]))
                 ],
-              ),
-              margin: EdgeInsets.fromLTRB(0, 0, 0, 10))
+              ))
       ]),
     ); //Scaffold
   } //build

+ 4 - 4
pubspec.yaml

@@ -1,21 +1,21 @@
 name: project02marinzhang
 description: A new Flutter application.
 publish_to: 'none' # Remove this line if you wish to publish to pub.dev
-version: 1.0.0+1
+version: 1.0.1+1
 
 environment:
-  sdk: ">=2.12.0 <3.0.0"
+  sdk: ">=2.19.2 <3.0.0"
 
 dependencies:
   flutter:
     sdk: flutter
-  cupertino_icons: ^1.0.3
+  cupertino_icons: ^1.0.5
 
 dev_dependencies:
   flutter_test:
     sdk: flutter
 
-  flutter_lints: ^1.0.0
+  flutter_lints: ^3.0.1
 
 flutter:
   uses-material-design: true