diff --git a/.packages b/.packages index 0bffa68..fd034f5 100644 --- a/.packages +++ b/.packages @@ -1,24 +1,25 @@ -# Generated by pub on 2020-10-02 20:49:43.904476. -async:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/async-2.5.0-nullsafety.1/lib/ -boolean_selector:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0-nullsafety.1/lib/ -characters:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0-nullsafety.3/lib/ -charcode:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/charcode-1.2.0-nullsafety.1/lib/ -clock:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/clock-1.1.0-nullsafety.1/lib/ -collection:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0-nullsafety.3/lib/ -cupertino_icons:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-1.0.0/lib/ -fake_async:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/fake_async-1.2.0-nullsafety.1/lib/ -flutter:file:///Users/abhishek/development/flutter/packages/flutter/lib/ -flutter_test:file:///Users/abhishek/development/flutter/packages/flutter_test/lib/ -matcher:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10-nullsafety.1/lib/ -meta:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0-nullsafety.3/lib/ -path:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/path-1.8.0-nullsafety.1/lib/ -sky_engine:file:///Users/abhishek/development/flutter/bin/cache/pkg/sky_engine/lib/ -source_span:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/source_span-1.8.0-nullsafety.2/lib/ -stack_trace:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0-nullsafety.1/lib/ -stream_channel:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0-nullsafety.1/lib/ -string_scanner:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.0-nullsafety.1/lib/ -term_glyph:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.0-nullsafety.1/lib/ -test_api:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.19-nullsafety.2/lib/ -typed_data:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0-nullsafety.3/lib/ -vector_math:file:///Users/abhishek/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0-nullsafety.3/lib/ +# Generated by pub on 2020-10-03 07:47:27.980445. +async:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/async-2.4.1/lib/ +boolean_selector:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.0.0/lib/ +characters:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/characters-1.0.0/lib/ +charcode:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.1.3/lib/ +clock:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/clock-1.0.1/lib/ +collection:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/collection-1.14.13/lib/ +cupertino_icons:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/cupertino_icons-1.0.0/lib/ +custom_splash:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/custom_splash-0.0.2/lib/ +fake_async:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.1.0/lib/ +flutter:file:///C:/flutter/packages/flutter/lib/ +flutter_test:file:///C:/flutter/packages/flutter_test/lib/ +matcher:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.8/lib/ +meta:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.1.8/lib/ +path:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/path-1.7.0/lib/ +sky_engine:file:///C:/flutter/bin/cache/pkg/sky_engine/lib/ +source_span:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.7.0/lib/ +stack_trace:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.9.3/lib/ +stream_channel:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.0.0/lib/ +string_scanner:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.0.5/lib/ +term_glyph:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.1.0/lib/ +test_api:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.2.17/lib/ +typed_data:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.2.0/lib/ +vector_math:file:///C:/flutter/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.0.8/lib/ ecommerce_flutter:lib/ diff --git a/android/gradle.properties b/android/gradle.properties index 94adc3a..a673820 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,3 +1,4 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true +android.enableR8=true diff --git a/images/ecommerce_flutter.mp4 b/images/ecommerce_flutter.mp4 new file mode 100644 index 0000000..d10db5b Binary files /dev/null and b/images/ecommerce_flutter.mp4 differ diff --git a/images/fashion.png b/images/fashion.png new file mode 100644 index 0000000..f691eec Binary files /dev/null and b/images/fashion.png differ diff --git a/lib/main.dart b/lib/main.dart index 11655b6..81ba008 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,117 +1,111 @@ +import 'dart:async'; + +import 'package:ecommerce_flutter/pages/home/home_page.dart'; import 'package:flutter/material.dart'; void main() { - runApp(MyApp()); + + runApp(MaterialApp( + home: SplashScreen() + )); } -class MyApp extends StatelessWidget { - // This widget is the root of your application. +class SplashScreen extends StatefulWidget { @override - Widget build(BuildContext context) { - return MaterialApp( - title: 'Flutter Demo', - theme: ThemeData( - // This is the theme of your application. - // - // Try running your application with "flutter run". You'll see the - // application has a blue toolbar. Then, without quitting the app, try - // changing the primarySwatch below to Colors.green and then invoke - // "hot reload" (press "r" in the console where you ran "flutter run", - // or simply save your changes to "hot reload" in a Flutter IDE). - // Notice that the counter didn't reset back to zero; the application - // is not restarted. - primarySwatch: Colors.blue, - // This makes the visual density adapt to the platform that you run - // the app on. For desktop platforms, the controls will be smaller and - // closer together (more dense) than on mobile platforms. - visualDensity: VisualDensity.adaptivePlatformDensity, - ), - home: MyHomePage(title: 'Flutter Demo Home Page'), - ); - } + _SplashScreenState createState() => _SplashScreenState(); } -class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: 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. - - // This class is the configuration for the state. It holds the values (in this - // case the title) provided by the parent (in this case the App widget) and - // used by the build method of the State. Fields in a Widget subclass are - // always marked "final". - - final String title; +class _SplashScreenState extends State { + Timer _timer; + int _start = 5; @override - _MyHomePageState createState() => _MyHomePageState(); -} + void initState() { + super.initState(); + startTimer(); + } -class _MyHomePageState extends State { - int _counter = 0; + void startTimer() { + const oneSec = const Duration(seconds: 1); + _timer = new Timer.periodic( + oneSec, + (Timer timer) => setState( + () { + if (_start < 1) { + timer.cancel(); + Future.delayed(const Duration(milliseconds: 500), () { + return Navigator.pushReplacement(context, MaterialPageRoute(builder: (context)=> HomePage())); + }); + } else { + _start = _start - 1; + } + }, + ), + ); + } - void _incrementCounter() { - setState(() { - // This call to setState tells the Flutter framework that something has - // changed in this State, which causes it to rerun the build method below - // so that the display can reflect the updated values. If we changed - // _counter without calling setState(), then the build method would not be - // called again, and so nothing would appear to happen. - _counter++; - }); + @override + void dispose() { + _timer.cancel(); + super.dispose(); } @override - Widget build(BuildContext context) { - // This method is rerun every time setState is called, for instance as done - // by the _incrementCounter method above. - // - // The Flutter framework has been optimized to make rerunning build methods - // fast, so that you can just rebuild anything that needs updating rather - // than having to individually change instances of widgets. + Widget build(BuildContext context){ return Scaffold( - appBar: AppBar( - // Here we take the value from the MyHomePage object that was created by - // the App.build method, and use it to set our appbar title. - title: Text(widget.title), - ), - body: Center( - // Center is a layout widget. It takes a single child and positions it - // in the middle of the parent. - child: Column( - // Column is also a layout widget. It takes a list of children and - // arranges them vertically. By default, it sizes itself to fit its - // children horizontally, and tries to be as tall as its parent. - // - // Invoke "debug painting" (press "p" in the console, choose the - // "Toggle Debug Paint" action from the Flutter Inspector in Android - // Studio, or the "Toggle Debug Paint" command in Visual Studio Code) - // to see the wireframe for each widget. - // - // Column has various properties to control how it sizes itself and - // how it positions its children. Here we use mainAxisAlignment to - // center the children vertically; the main axis here is the vertical - // axis because Columns are vertical (the cross axis would be - // horizontal). - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - 'You have pushed the button this many times:', + body: Stack( + children: [ + Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topRight, + end: Alignment(2.2, 0.0), + colors: [ + Colors.grey.withOpacity(0.1), + Colors.orangeAccent, + ], + tileMode: TileMode.repeated, + ), ), - Text( - '$_counter', - style: Theme.of(context).textTheme.headline4, + + ), + Positioned( + top: 40, + left: 60, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text("E-commerce", + style: TextStyle(fontSize: 26, color: Colors.black54,),), + SizedBox(height: 10,), + Text("Your No.1 app for buying and selling", + style: TextStyle(fontSize: 18, color: Colors.black87,),), + ], + ), + ), + Positioned( + left: -20, + right: -30, + top: 100, + bottom: 80, + child: Container( + alignment: Alignment.center, + child: Image.asset("images/fashion.png") ), - ], - ), + ), + Visibility( + visible: _start < 1 ? true : false, + child: Container( + padding: EdgeInsets.only(bottom: 20), + alignment: Alignment.bottomCenter, + child: CircularProgressIndicator( + valueColor: new AlwaysStoppedAnimation( + Color.fromRGBO(58, 55, 86, 1.0)), + ), + ), + ), + ], ), - floatingActionButton: FloatingActionButton( - onPressed: _incrementCounter, - tooltip: 'Increment', - child: Icon(Icons.add), - ), // This trailing comma makes auto-formatting nicer for build methods. ); } -} +} \ No newline at end of file diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 534379f..676dfe3 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -7,3 +7,22 @@ Add bottom navigation bar with four tabs. And link with respective page. Add routes in main.dart */ + + +import 'package:flutter/material.dart'; + +class HomePage extends StatefulWidget { + @override + _HomePageState createState() => _HomePageState(); +} + +class _HomePageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text("Home Page"), + ), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index f628010..59ed64d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,58 +5,65 @@ packages: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.5.0-nullsafety.1" + version: "2.4.1" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.0.0" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.0.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.1.3" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.0.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.15.0-nullsafety.3" + version: "1.14.13" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" + custom_splash: + dependency: "direct main" + description: + name: custom_splash + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.0.2" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.1.0" flutter: dependency: "direct main" description: flutter @@ -71,23 +78,23 @@ packages: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "0.12.10-nullsafety.1" + version: "0.12.8" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.1.8" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.0-nullsafety.1" + version: "1.7.0" sky_engine: dependency: transitive description: flutter @@ -97,57 +104,57 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.7.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.9.3" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.0.5" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.1.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.19-nullsafety.2" + version: "0.2.17" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.2.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.0.8" sdks: - dart: ">=2.10.0-110 <2.11.0" + dart: ">=2.9.0-14.0.dev <3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 882f606..f834bd3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,7 +24,6 @@ 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.0 @@ -45,9 +44,8 @@ flutter: 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 + assets: + - images/fashion.png # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware.