From 88d3767498530aee6ff5a6eb8a0159585ac11538 Mon Sep 17 00:00:00 2001 From: Sailesh Dahal Date: Sat, 18 Jul 2020 09:06:55 +0545 Subject: [PATCH] CHANGELOG - MIGRATED TO ANDROIDX - ADDED LINTING AND LINTED CODE --- .gitignore | 43 ++++ .metadata | 10 + analysis_options.yaml | 14 ++ android/.gitignore | 7 + android/app/build.gradle | 14 +- android/app/src/debug/AndroidManifest.xml | 7 + android/app/src/main/AndroidManifest.xml | 38 ++-- .../tinderswipecards/MainActivity.java | 13 -- .../example/tinderswipecards/MainActivity.kt | 6 + android/app/src/main/res/values/styles.xml | 10 + android/app/src/profile/AndroidManifest.xml | 7 + android/build.gradle | 4 +- android/gradle.properties | 3 + .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/settings.gradle | 22 +- ios/.gitignore | 32 +++ .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/WorkspaceSettings.xcsettings | 8 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/WorkspaceSettings.xcsettings | 8 + ios/Runner/AppDelegate.swift | 13 ++ ios/Runner/Runner-Bridging-Header.h | 1 + lib/CardDetails.dart | 53 ++--- lib/PlanetCard.dart | 12 +- lib/main.dart | 34 ++- pubspec.lock | 195 ++++++++++++++++++ pubspec.yaml | 11 +- 27 files changed, 466 insertions(+), 117 deletions(-) create mode 100644 .gitignore create mode 100644 .metadata create mode 100644 analysis_options.yaml create mode 100644 android/.gitignore create mode 100644 android/app/src/debug/AndroidManifest.xml delete mode 100644 android/app/src/main/java/com/example/tinderswipecards/MainActivity.java create mode 100644 android/app/src/main/kotlin/com/example/tinderswipecards/MainActivity.kt create mode 100644 android/app/src/profile/AndroidManifest.xml create mode 100644 ios/.gitignore create mode 100644 ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 ios/Runner/AppDelegate.swift create mode 100644 ios/Runner/Runner-Bridging-Header.h create mode 100644 pubspec.lock diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ba9c33 --- /dev/null +++ b/.gitignore @@ -0,0 +1,43 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# 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/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Exceptions to above rules. +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/.metadata b/.metadata new file mode 100644 index 0000000..ade6bc9 --- /dev/null +++ b/.metadata @@ -0,0 +1,10 @@ +# 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: 8af6b2f038c1172e61d418869363a28dffec3cb4 + channel: stable + +project_type: app diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..6bb7dc4 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,14 @@ +include: package:lint/analysis_options.yaml + +analyzer: + errors: + missing_required_param: error + missing_return: error + must_be_immutable: error + sort_unnamed_constructors_first: ignore + parameter_assignments: error + argument_type_not_assignable: ignore + file_names: ignore +linter: + rules: + parameter_assignments: true diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..bc2100d --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,7 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java diff --git a/android/app/build.gradle b/android/app/build.gradle index 1773975..d7fd56d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -22,10 +22,15 @@ if (flutterVersionName == null) { } apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 27 + compileSdkVersion 28 + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } lintOptions { disable 'InvalidPackage' @@ -35,10 +40,9 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.tinderswipecards" minSdkVersion 16 - targetSdkVersion 27 + targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { @@ -55,7 +59,5 @@ flutter { } dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..108ea9e --- /dev/null +++ b/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index bf7f51a..73c2943 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,12 +1,5 @@ - - - - - + + android:name="io.flutter.embedding.android.NormalTheme" + android:resource="@style/NormalTheme" + /> + + + + diff --git a/android/app/src/main/java/com/example/tinderswipecards/MainActivity.java b/android/app/src/main/java/com/example/tinderswipecards/MainActivity.java deleted file mode 100644 index 4cc5577..0000000 --- a/android/app/src/main/java/com/example/tinderswipecards/MainActivity.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.example.tinderswipecards; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/android/app/src/main/kotlin/com/example/tinderswipecards/MainActivity.kt b/android/app/src/main/kotlin/com/example/tinderswipecards/MainActivity.kt new file mode 100644 index 0000000..3b939d8 --- /dev/null +++ b/android/app/src/main/kotlin/com/example/tinderswipecards/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.tinderswipecards + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index 00fa441..1f83a33 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -1,8 +1,18 @@ + + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..108ea9e --- /dev/null +++ b/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/build.gradle b/android/build.gradle index bb8a303..3100ad2 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,11 +1,13 @@ buildscript { + ext.kotlin_version = '1.3.50' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:3.5.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/android/gradle.properties b/android/gradle.properties index 8bd86f6..38c8d45 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1 +1,4 @@ org.gradle.jvmargs=-Xmx1536M +android.enableR8=true +android.useAndroidX=true +android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 2819f02..296b146 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip diff --git a/android/settings.gradle b/android/settings.gradle index 5a2f14f..d3b6a40 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,15 +1,15 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + include ':app' -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..e96ef60 --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,32 @@ +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..70693e4 --- /dev/null +++ b/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/lib/CardDetails.dart b/lib/CardDetails.dart index 6288a78..8d25c0e 100644 --- a/lib/CardDetails.dart +++ b/lib/CardDetails.dart @@ -1,38 +1,28 @@ import 'package:flutter/material.dart'; class CardDetails extends StatefulWidget { - int index; - String imageAddress; - String placeDetails; + final int index; + final String imageAddress; - CardDetails(this.imageAddress, this.index); + const CardDetails(this.imageAddress, this.index); @override - State createState() { - // TODO: implement createState - return CardDetailsState(imageAddress, index); - } + CardDetailsState createState() => CardDetailsState(); } class CardDetailsState extends State { - int index; - String imageAddress; String placeDetails; - CardDetailsState(this.imageAddress, this.index); - @override void initState() { super.initState(); setState(() { - getData(index); + placeDetails = getData(widget.index); }); } @override Widget build(BuildContext context) { - // TODO: implement build - var data = index.toString(); - print(index); + // TODO: implement build1ad return MaterialApp( home: Scaffold( body: ListView( @@ -44,16 +34,16 @@ class CardDetailsState extends State { width: double.infinity, ), Container( - padding: EdgeInsets.all(10.0), + padding: const EdgeInsets.all(10.0), height: 500.0, width: double.infinity, decoration: BoxDecoration( - borderRadius: BorderRadius.only( + borderRadius: const BorderRadius.only( bottomLeft: Radius.circular(20.0), bottomRight: Radius.circular(20.0), ), image: DecorationImage( - image: NetworkImage(imageAddress), + image: NetworkImage(widget.imageAddress), fit: BoxFit.fill, )), ), @@ -66,10 +56,10 @@ class CardDetailsState extends State { borderRadius: BorderRadius.circular(20.0), child: Container( height: 380.0, - decoration: BoxDecoration( + decoration: const BoxDecoration( //borderRadius: BorderRadius.circular(20.0) ), - padding: EdgeInsets.only( + padding: const EdgeInsets.only( left: 20.0, right: 10.0, top: 20.0, @@ -77,7 +67,7 @@ class CardDetailsState extends State { child: Text( placeDetails, textAlign: TextAlign.left, - style: TextStyle( + style: const TextStyle( fontSize: 20.0, fontStyle: FontStyle.italic), ), ), @@ -91,32 +81,29 @@ class CardDetailsState extends State { ); } - getData(value) { + String getData(int value) { switch (value) { case 0: - placeDetails = - 'Mussoorie, located around an hour from Derahdun in Uttarakhand, is a popular weekend destination for north Indians, as well as honeymooners. One of the reasons for Mussoories popularity is that it has a lot of facilities developed especially for tourists. Take a cable car to Gun Hill, enjoy a beautiful nature walk along Camels Back Road, have a picnic at Kempty Falls, or ride a horse up to Lal Tibba (the highest peak in Mussoorie). Mussoorie also offers a superb view of the Himalayas.'; + return 'Mussoorie, located around an hour from Derahdun in Uttarakhand, is a popular weekend destination for north Indians, as well as honeymooners. One of the reasons for Mussoories popularity is that it has a lot of facilities developed especially for tourists. Take a cable car to Gun Hill, enjoy a beautiful nature walk along Camels Back Road, have a picnic at Kempty Falls, or ride a horse up to Lal Tibba (the highest peak in Mussoorie). Mussoorie also offers a superb view of the Himalayas.'; break; case 1: - placeDetails = - "Manali, in Himachal Pradesh, is one of the top adventure travel destinations in India.Manali, with its soothing backdrop of the Himalayas, offers a blend of tranquility and adventure that makes it one of northern India's most popular destinations. Although it's a popular place to go off on treks, you can do as little or as much as you want there. Located in the Kullu Valley of Himachal Pradesh, it's bordered by cool pine forest and the raging Beas River, which give it a special energy."; + return "Manali, in Himachal Pradesh, is one of the top adventure travel destinations in India.Manali, with its soothing backdrop of the Himalayas, offers a blend of tranquility and adventure that makes it one of northern India's most popular destinations. Although it's a popular place to go off on treks, you can do as little or as much as you want there. Located in the Kullu Valley of Himachal Pradesh, it's bordered by cool pine forest and the raging Beas River, which give it a special energy."; break; case 2: - placeDetails = - "Sikkim's capital, Gangtok, sits along a cloudy mountain ridge about 5,500 feet above sea level. Sikkim only became part of India in 1975. Before that, it was a small independent Buddhist kingdom with its own monarchy after the end of British rule. Gangtok is a popular base for travel throughout the state, particularly with trekkers. It's a well-organized and clean city with strict littering, traffic and tobacco laws. Attractions include monasteries, viewpoints, a cable car, and a zoo that houses rare animals rescued from traders and poachers."; + return "Sikkim's capital, Gangtok, sits along a cloudy mountain ridge about 5,500 feet above sea level. Sikkim only became part of India in 1975. Before that, it was a small independent Buddhist kingdom with its own monarchy after the end of British rule. Gangtok is a popular base for travel throughout the state, particularly with trekkers. It's a well-organized and clean city with strict littering, traffic and tobacco laws. Attractions include monasteries, viewpoints, a cable car, and a zoo that houses rare animals rescued from traders and poachers."; break; case 3: - placeDetails = - "Darjeeling is also famous for its lush tea gardens. In addition, it's blessed with a stunning view of Mount Kanchenjunga, the world's third highest peak. Some of Darjeeling's most popular attractions include historic toy train, monasteries, botanical gardens, a zoo, and the Darjeeling-Rangeet Valley Passenger Ropeway (the longest aerial tramway in Asia). Darjeeling is a great place to walk around and explore the tea estates, villages, and markets. "; + return "Darjeeling is also famous for its lush tea gardens. In addition, it's blessed with a stunning view of Mount Kanchenjunga, the world's third highest peak. Some of Darjeeling's most popular attractions include historic toy train, monasteries, botanical gardens, a zoo, and the Darjeeling-Rangeet Valley Passenger Ropeway (the longest aerial tramway in Asia). Darjeeling is a great place to walk around and explore the tea estates, villages, and markets. "; break; case 4: - placeDetails = - "The hill station of Nainital, in the Kumaon region of Uttarakhand, was a popular summer retreat for the British during the time they ruled India. It features the serene, emerald-colored Naini Lake and an action-filled strip called The Mall, lined with restaurants, shops, hotels, and markets. Enjoy one of the many forest walks, explore the surrounding area on horseback, or relax on a boat in the lake."; + return "The hill station of Nainital, in the Kumaon region of Uttarakhand, was a popular summer retreat for the British during the time they ruled India. It features the serene, emerald-colored Naini Lake and an action-filled strip called The Mall, lined with restaurants, shops, hotels, and markets. Enjoy one of the many forest walks, explore the surrounding area on horseback, or relax on a boat in the lake."; break; + default: + return ""; } } } diff --git a/lib/PlanetCard.dart b/lib/PlanetCard.dart index f83c59d..c8505f0 100644 --- a/lib/PlanetCard.dart +++ b/lib/PlanetCard.dart @@ -1,11 +1,7 @@ class PlanetCard { - String cardTitle; - String cardImage; - double topMargin; + final String cardTitle; + final String cardImage; + final double topMargin; - PlanetCard(String title, String imagePath, double marginTop) { - cardTitle = title; - cardImage = imagePath; - topMargin = marginTop; - } + PlanetCard(this.cardTitle, this.cardImage, this.topMargin); } diff --git a/lib/main.dart b/lib/main.dart index 3abc491..dfb2d78 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'PlanetCard.dart'; -import 'CardDetails.dart'; +import 'package:tinder_swipe_cards/CardDetails.dart'; +import 'package:tinder_swipe_cards/PlanetCard.dart'; void main() { runApp(MyApp()); @@ -10,14 +10,7 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { // TODO: implement build - return MaterialApp( - debugShowCheckedModeBanner: false, - routes: { - '/cardDetails': (BuildContext context) { - // return new CardDetails(); - } - }, - home: HomePage()); + return MaterialApp(debugShowCheckedModeBanner: false, home: HomePage()); } } @@ -30,9 +23,9 @@ class HomePage extends StatefulWidget { } class HomePageState extends State { - List cardList = new List(); + List cardList = []; - void removeCards(index) { + void removeCards(int index) { setState(() { cardList.removeAt(index); }); @@ -50,7 +43,7 @@ class HomePageState extends State { // TODO: implement build return Scaffold( appBar: AppBar( - title: Text("Tinder App"), + title: const Text("Tinder App"), backgroundColor: Colors.purple, ), body: Stack(alignment: Alignment.center, children: cardList), @@ -58,7 +51,7 @@ class HomePageState extends State { } List _generateCards() { - List planetCard = new List(); + final List planetCard = []; planetCard.add( PlanetCard( "Mussorie", @@ -85,7 +78,7 @@ class HomePageState extends State { "http://amazingindiablog.in/wp-content/uploads/2015/06/P5035083.jpg", 110.0), ); - List cardList = new List(); + final List cardList = []; for (int x = 0; x < 5; x++) { cardList.add( @@ -97,9 +90,7 @@ class HomePageState extends State { }, childWhenDragging: Container(), feedback: GestureDetector( - onTap: () { - print("Hello All"); - }, + onTap: () {}, child: Card( elevation: 8.0, shape: RoundedRectangleBorder( @@ -118,7 +109,7 @@ class HomePageState extends State { ), ), Container( - padding: EdgeInsets.only(top: 10.0, bottom: 10.0), + padding: const EdgeInsets.only(top: 10.0, bottom: 10.0), child: Text( planetCard[x].cardTitle, style: TextStyle( @@ -148,7 +139,7 @@ class HomePageState extends State { children: [ Container( decoration: BoxDecoration( - borderRadius: BorderRadius.only( + borderRadius: const BorderRadius.only( topLeft: Radius.circular(20.0), topRight: Radius.circular(20.0)), image: DecorationImage( @@ -159,7 +150,8 @@ class HomePageState extends State { width: 320.0, ), Container( - padding: EdgeInsets.only(top: 10.0, bottom: 10.0), + padding: + const EdgeInsets.only(top: 10.0, bottom: 10.0), child: Text( planetCard[x].cardTitle, style: TextStyle( diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..ab47228 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,195 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.13" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.0" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.3" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.14.12" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.4" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.12" + lint: + dependency: "direct dev" + description: + name: lint + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.6" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.8" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.4" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" + quiver: + dependency: transitive + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.3" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.15" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.8" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "3.6.1" +sdks: + dart: ">=2.8.0-dev.16.0 <3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index edb4eb9..ec7c239 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ description: A new Flutter project. # 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. +# build by specifying --build-name and --build-number, respectively. # Read more about versioning at semver.org. version: 1.0.0+1 @@ -14,7 +14,7 @@ environment: dependencies: flutter: - sdk: flutter + sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. @@ -23,30 +23,25 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - + lint: ^1.2.0 # For information on the generic Dart part of this file, see the # following page: https://www.dartlang.org/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: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg - # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.io/assets-and-images/#resolution-aware. - # For details regarding adding assets from package dependencies, see # https://flutter.io/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