Skip to content

Commit

Permalink
home page is completed. Battery page is almost done.
Browse files Browse the repository at this point in the history
  • Loading branch information
sonerxdev committed Sep 28, 2021
1 parent c98bfb2 commit 5c3d0df
Show file tree
Hide file tree
Showing 16 changed files with 1,467 additions and 86 deletions.
14 changes: 14 additions & 0 deletions assets/images/door_lock.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions assets/images/door_unlock.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/person.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/scooter2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions lib/core/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const kPrimaryLightColor = Color(0xFFc0cfe2);
const fifthColor = Color(0Xff8D8EEC);
const thirdColor = Color(0Xff4C4AED);

const textColor = Color(0xff3c95fd);
const mainColor = Color(0xff131F2D);
const secondColor = Color(0xff5ABD8C);
const mainColor2 = Color(0xFF2A3442);
17 changes: 12 additions & 5 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import 'package:animation_library/smartCarApp/animation_classes.dart';
import 'package:animation_library/smartCarApp/bottom_nav_bar.dart';
import 'package:animation_library/smartCarApp/models/home_controller.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

void main() {
runApp(MyApp());
}
void main() => runApp(
MultiProvider(
providers: [
ChangeNotifierProvider(
create: (_) => HomeController(),
),
],
child: MyApp(),
),
);

class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
Expand Down
240 changes: 240 additions & 0 deletions lib/smartCarApp/battery_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
import 'package:animation_library/core/base_state.dart';
import 'package:animation_library/core/constants.dart';
import 'package:animation_library/smartCarApp/home_page.dart';
import 'package:animation_library/smartCarApp/models/home_controller.dart';
import 'package:animation_library/widgets/chart_1.dart';
import 'package:animation_library/widgets/chart_2.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';
import 'package:provider/provider.dart';

class BatteryPage extends StatefulWidget {
BatteryPage({Key? key}) : super(key: key);

@override
_BatteryPageState createState() => _BatteryPageState();
}

class _BatteryPageState extends State<BatteryPage> {
@override
Widget build(BuildContext context) {
final _homeController = Provider.of<HomeController>(context);
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.white,
elevation: 0.0,
leading: Padding(
padding: context.insetsAll(0.01),
child: Icon(
Icons.ev_station_outlined,
color: Colors.black,
size: 30.0,
),
),
centerTitle: true,
title: Text(
"Battery Status 86%",
style: GoogleFonts.yantramanav(
textStyle: TextStyle(
fontSize: 20,
color: Colors.black,
fontWeight: FontWeight.w500,
),
),
),
actions: [
Padding(
padding: context.insetsAll(0.025),
child: Icon(
Icons.connected_tv,
size: 30.0,
color: Colors.black,
),
)
],
),
body: SafeArea(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Stack(
children: [
AnimatedPositioned(
top: 70.0,
left: 300.0,
curve: Curves.linearToEaseOut,
duration: Duration(milliseconds: 400),
child: CircularPercentIndicator(
radius: 50.0,
animation: true,
backgroundColor: mainColor2,
lineWidth: 8.0,
animationDuration: 3000,
restartAnimation: true,
percent: 0.86,
curve: Curves.linearToEaseOut,
center: Text(
"86%",
style: GoogleFonts.yantramanav(
textStyle: TextStyle(
fontSize: 15,
color: Colors.black,
fontWeight: FontWeight.w500,
),
),
),
progressColor: secondColor,
),
),
Container(
height: context.dynamicHeight(0.35),
width: context.dynamicWidth(0.9),
child: BarChartSample1(),
),
Positioned(
left: 30,
bottom: 100,
child: AnimatedPadding(
padding: EdgeInsets.only(
left: _homeController.isScooterBig
? context.dynamicWidth(0.0)
: context.dynamicWidth(0.5),
),
curve: Curves.linearToEaseOut,
duration: Duration(milliseconds: 900),
child: Container(
height: context.dynamicHeight(0.25),
width: context.dynamicWidth(0.25),
child: Image.asset(
"assets/images/scooter.png",
),
),
),
),
],
),
SizedBox(height: context.dynamicHeight(0.01)),
Container(
height: context.dynamicHeight(0.4),
width: context.dynamicWidth(0.8),
child: LineChartSample2(),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: context.insetsAll(0.03),
decoration: boxDecoration(),
child: Column(
children: [
Text(
"Range",
style: GoogleFonts.yantramanav(
textStyle: TextStyle(
fontSize: 20,
color: Colors.white,
fontWeight: FontWeight.w400,
),
),
),
SizedBox(
height: context.dynamicHeight(0.03),
),
Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.end,
children: [
Column(
children: [
Text(
"Battery",
style: GoogleFonts.yantramanav(
textStyle: TextStyle(
fontSize: 17,
color: Colors.white,
fontWeight: FontWeight.w400,
),
),
),
Text(
"%86",
style: GoogleFonts.yantramanav(
textStyle: TextStyle(
fontSize: 23,
color: textColor,
fontWeight: FontWeight.bold,
),
),
),
],
),
SizedBox(
width: context.dynamicWidth(0.05),
),
Column(
children: [
Text(
"Distance",
style: GoogleFonts.yantramanav(
textStyle: TextStyle(
fontSize: 17,
color: Colors.white,
fontWeight: FontWeight.w400,
),
),
),
Text(
"28.3 km",
style: GoogleFonts.yantramanav(
textStyle: TextStyle(
fontSize: 23,
color: textColor,
fontWeight: FontWeight.bold,
),
),
),
],
),
SizedBox(
width: context.dynamicWidth(0.05),
),
Column(
children: [
Text(
"Duration",
style: GoogleFonts.yantramanav(
textStyle: TextStyle(
fontSize: 17,
color: Colors.white,
fontWeight: FontWeight.w400,
),
),
),
Text(
"2 hour",
style: GoogleFonts.yantramanav(
textStyle: TextStyle(
fontSize: 23,
color: textColor,
fontWeight: FontWeight.bold,
),
),
),
],
),
],
)
],
),
),
],
),
],
),
),
),
);
}
}

0 comments on commit 5c3d0df

Please sign in to comment.