create user interface for login screen
parent
490618e75b
commit
20707745bb
|
@ -1,115 +1,49 @@
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:device_preview/device_preview.dart';
|
||||||
|
import './utils/router.dart';
|
||||||
|
import './utils/global.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// void main() => runApp(
|
||||||
|
// DevicePreview(
|
||||||
|
// enabled: !kReleaseMode,
|
||||||
|
// builder: (context) => const MyApp(), // Wrap your app
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
const MyApp({super.key});
|
const MyApp({super.key});
|
||||||
|
|
||||||
// This widget is the root of your application.
|
// This widget is the root of your application.
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
final mediaQueryData =
|
||||||
title: 'Flutter Demo',
|
MediaQueryData.fromWindow(WidgetsBinding.instance.window);
|
||||||
|
screenWidth = mediaQueryData.size.width;
|
||||||
|
screenHeight = mediaQueryData.size.height;
|
||||||
|
blockSizeHorizontal = screenWidth / 100;
|
||||||
|
blockSizeVertical = screenHeight / 100;
|
||||||
|
safeAreaHorizontal =
|
||||||
|
mediaQueryData.padding.left + mediaQueryData.padding.right;
|
||||||
|
safeAreaVertical =
|
||||||
|
mediaQueryData.padding.top + mediaQueryData.padding.bottom;
|
||||||
|
safeBlockHorizontal = (screenWidth - safeAreaHorizontal) / 100;
|
||||||
|
safeBlockVertical = (screenHeight - safeAreaVertical) / 100;
|
||||||
|
return MaterialApp.router(
|
||||||
|
// useInheritedMediaQuery: true,
|
||||||
|
// locale: DevicePreview.locale(context),
|
||||||
|
// builder: DevicePreview.appBuilder,
|
||||||
|
routeInformationParser: goRouter.routeInformationParser,
|
||||||
|
routerDelegate: goRouter.routerDelegate,
|
||||||
|
title: 'uniT2 - Universal Tracker and Tracer',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
// This is the theme of your application.
|
fontFamily: 'LexendDeca',
|
||||||
//
|
|
||||||
// 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,
|
|
||||||
),
|
),
|
||||||
home: const MyHomePage(title: 'Flutter Demo Home Page'),
|
debugShowCheckedModeBanner: false,
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class MyHomePage extends StatefulWidget {
|
|
||||||
const MyHomePage({super.key, required this.title});
|
|
||||||
|
|
||||||
// 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;
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<MyHomePage> createState() => _MyHomePageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MyHomePageState extends State<MyHomePage> {
|
|
||||||
int _counter = 0;
|
|
||||||
|
|
||||||
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
|
|
||||||
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.
|
|
||||||
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: <Widget>[
|
|
||||||
const Text(
|
|
||||||
'You have pushed the button this many times:',
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'$_counter',
|
|
||||||
style: Theme.of(context).textTheme.headline4,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
floatingActionButton: FloatingActionButton(
|
|
||||||
onPressed: _incrementCounter,
|
|
||||||
tooltip: 'Increment',
|
|
||||||
child: const Icon(Icons.add),
|
|
||||||
), // This trailing comma makes auto-formatting nicer for build methods.
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
import 'package:flutter/src/widgets/container.dart';
|
||||||
|
import 'package:flutter/src/widgets/framework.dart';
|
||||||
|
|
||||||
|
class ModuleScreen extends StatefulWidget {
|
||||||
|
const ModuleScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<ModuleScreen> createState() => _ModuleScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ModuleScreenState extends State<ModuleScreen> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../../../utils/global.dart';
|
||||||
|
|
||||||
|
class LoginViaQr extends StatelessWidget {
|
||||||
|
final String text;
|
||||||
|
const LoginViaQr({Key? key,@required required this.text}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SizedBox(
|
||||||
|
height: blockSizeVertical * 3,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const SizedBox(
|
||||||
|
width: 30,
|
||||||
|
child: Divider(
|
||||||
|
color: Colors.grey,
|
||||||
|
height: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// LOGIN VIA QR CODE
|
||||||
|
Text(
|
||||||
|
text,
|
||||||
|
style: const TextStyle(fontSize: 12),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 30,
|
||||||
|
child: Divider(
|
||||||
|
color: Colors.grey,
|
||||||
|
height: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
|
|
||||||
|
Future<bool> pressAgainToExit() async {
|
||||||
|
DateTime? currentBackPressTime;
|
||||||
|
DateTime now = DateTime.now();
|
||||||
|
if (currentBackPressTime == null ||
|
||||||
|
now.difference(currentBackPressTime) > const Duration(seconds: 1)) {
|
||||||
|
currentBackPressTime = now;
|
||||||
|
Fluttertoast.showToast(
|
||||||
|
msg: "Press again to exit",
|
||||||
|
gravity: ToastGravity.CENTER,
|
||||||
|
backgroundColor: Colors.black);
|
||||||
|
return Future.value(false);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
|
@ -0,0 +1,247 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||||
|
import 'package:fluttericon/font_awesome5_icons.dart';
|
||||||
|
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||||
|
import '../../../widgets/wave.dart';
|
||||||
|
import '../../../utils/global.dart';
|
||||||
|
import '../../../theme-data.dart/colors.dart';
|
||||||
|
import '../../../theme-data.dart/form-style.dart';
|
||||||
|
import '../../../theme-data.dart/btn-style.dart';
|
||||||
|
import './components/login-via-qr-label.dart';
|
||||||
|
import './functions/press-again-to-exit.dart';
|
||||||
|
|
||||||
|
class UniT2Login extends StatefulWidget {
|
||||||
|
const UniT2Login({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<UniT2Login> createState() => _UniT2LoginState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _UniT2LoginState extends State<UniT2Login> {
|
||||||
|
final _formKey = GlobalKey<FormBuilderState>();
|
||||||
|
bool showSuffixIcon = false;
|
||||||
|
bool _showPassword = true;
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return WillPopScope(
|
||||||
|
onWillPop: pressAgainToExit,
|
||||||
|
child: Scaffold(
|
||||||
|
body: SizedBox(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Positioned(
|
||||||
|
bottom: 0,
|
||||||
|
right: 0,
|
||||||
|
child: WaveReverse(height: blockSizeVertical * 7)),
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 100,
|
||||||
|
child: FormBuilder(
|
||||||
|
key: _formKey,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 25),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(height: blockSizeVertical * 7),
|
||||||
|
SvgPicture.asset(
|
||||||
|
'assets/svgs/logo.svg',
|
||||||
|
height: blockSizeVertical * 16,
|
||||||
|
allowDrawingOutsideViewBox: true,
|
||||||
|
color: primary,
|
||||||
|
),
|
||||||
|
|
||||||
|
Text(
|
||||||
|
"Welcome to!",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: blockSizeVertical * 5,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
Text("uniT-App",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: blockSizeVertical * 8,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
letterSpacing: .2,
|
||||||
|
height: 1,
|
||||||
|
color: primary)),
|
||||||
|
Text(
|
||||||
|
"Please login to continue.",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: blockSizeVertical * 2,
|
||||||
|
height: 1.5,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 1.5,
|
||||||
|
),
|
||||||
|
// USERNAME
|
||||||
|
FormBuilderTextField(
|
||||||
|
name: 'username',
|
||||||
|
validator: FormBuilderValidators.compose([
|
||||||
|
FormBuilderValidators.required(
|
||||||
|
errorText: "Username is required")
|
||||||
|
]),
|
||||||
|
autofocus: false,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.black87),
|
||||||
|
decoration: loginTextFieldStyle()),
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 1.5,
|
||||||
|
),
|
||||||
|
// PASSWORD
|
||||||
|
FormBuilderTextField(
|
||||||
|
name: 'password',
|
||||||
|
validator: FormBuilderValidators.compose([
|
||||||
|
FormBuilderValidators.required(
|
||||||
|
errorText: "Password is required")
|
||||||
|
]),
|
||||||
|
// initialValue: state.password,
|
||||||
|
onChanged: (value) {
|
||||||
|
value!.isEmpty
|
||||||
|
? setState(() {
|
||||||
|
showSuffixIcon = false;
|
||||||
|
})
|
||||||
|
: setState(() {
|
||||||
|
showSuffixIcon = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
autofocus: false,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.black87),
|
||||||
|
decoration: loginTextFieldStyle().copyWith(
|
||||||
|
suffixIcon: Visibility(
|
||||||
|
visible: showSuffixIcon,
|
||||||
|
child: _showPassword
|
||||||
|
? IconButton(
|
||||||
|
icon: Icon(FontAwesome5.eye_slash,
|
||||||
|
size: 24,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.displayLarge
|
||||||
|
?.color),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
_showPassword = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
_showPassword = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
icon: Icon(FontAwesome5.eye,
|
||||||
|
size: 24,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.displayLarge
|
||||||
|
?.color)),
|
||||||
|
),
|
||||||
|
prefixIcon: const Icon(Icons.lock),
|
||||||
|
labelText: "Password",
|
||||||
|
hintText: "Enter Password..."),
|
||||||
|
obscureText: _showPassword ? true : false,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 2,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 7,
|
||||||
|
// Login Button
|
||||||
|
child: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: btnStyle(
|
||||||
|
second, Colors.transparent, Colors.white54),
|
||||||
|
child: const Text(
|
||||||
|
"LOGIN",
|
||||||
|
style: TextStyle(color: Colors.white),
|
||||||
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
if (_formKey.currentState!
|
||||||
|
.saveAndValidate()) {
|
||||||
|
debugPrint(
|
||||||
|
_formKey.currentState!.value['name']);
|
||||||
|
debugPrint(_formKey
|
||||||
|
.currentState!.value['password']);
|
||||||
|
}
|
||||||
|
// if (_formKey.currentState.validate()) {
|
||||||
|
// _formKey.currentState.save();
|
||||||
|
// BlocProvider.of<UserBloc>(context)
|
||||||
|
// .add(UserWebLogin(
|
||||||
|
// password: password,
|
||||||
|
// username: username));
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 1.5,
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 7,
|
||||||
|
child: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
child: ElevatedButton.icon(
|
||||||
|
style: btnStyle(Colors.white, second,
|
||||||
|
primary.withOpacity(.4)),
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.qr_code,
|
||||||
|
color: second,
|
||||||
|
),
|
||||||
|
label: const Text(
|
||||||
|
"Login via QR code",
|
||||||
|
style: TextStyle(color: second),
|
||||||
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
// BlocProvider.of<UserBloc>(context)
|
||||||
|
// .add(QRCodelogin());
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 1,
|
||||||
|
),
|
||||||
|
const LoginViaQr(
|
||||||
|
text: " Request Emergency Response "),
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 1,
|
||||||
|
),
|
||||||
|
// REQUEST SOS
|
||||||
|
SizedBox(
|
||||||
|
height: screenHeight * .07,
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
child: ElevatedButton.icon(
|
||||||
|
icon: const Icon(
|
||||||
|
FontAwesome5.life_ring,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
style: btnStyle(
|
||||||
|
third, Colors.transparent, Colors.white38),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pushNamed(context, '/SosScreen');
|
||||||
|
},
|
||||||
|
label: const Text(
|
||||||
|
"Request SOS",
|
||||||
|
style: TextStyle(color: Colors.white),
|
||||||
|
)),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
ButtonStyle btnStyle(Color background, Color borderColor, Color overlay) {
|
||||||
|
return ButtonStyle(
|
||||||
|
elevation: MaterialStateProperty.all<double>(0),
|
||||||
|
backgroundColor: MaterialStateProperty.all<Color>(background),
|
||||||
|
overlayColor: MaterialStateProperty.all<Color>(overlay),
|
||||||
|
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
||||||
|
RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(25.0),
|
||||||
|
side: BorderSide(
|
||||||
|
width: 2,
|
||||||
|
color: borderColor,
|
||||||
|
))));
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
const primary = Color(0xff99191a);
|
||||||
|
const second = Color(0xffd92828);
|
||||||
|
const third = Color(0xffeb8b1e);
|
||||||
|
const fourth = Color(0xfff6c359);
|
||||||
|
const fifth = Color(0xfffdfefd);
|
||||||
|
const success = Color(0xffa5d6a7);
|
||||||
|
const success2 = Color(0xff66bb6a);
|
||||||
|
const primary2 = Color(0xff039be5);
|
|
@ -0,0 +1,40 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
InputDecoration loginTextFieldStyle() {
|
||||||
|
return InputDecoration(
|
||||||
|
floatingLabelBehavior: FloatingLabelBehavior.never,
|
||||||
|
prefixIcon: const Icon(
|
||||||
|
Icons.person,
|
||||||
|
),
|
||||||
|
labelText: 'Username',
|
||||||
|
hintText: 'Enter your username...',
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: const BorderSide(
|
||||||
|
width: 2,
|
||||||
|
color: Colors.black87,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(5),
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: const BorderSide(
|
||||||
|
color: Colors.black87,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(5),
|
||||||
|
),
|
||||||
|
errorBorder: const OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors.red,
|
||||||
|
width: 2,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(5)),
|
||||||
|
),
|
||||||
|
focusedErrorBorder: const OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors.red,
|
||||||
|
width: 2,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(5)),
|
||||||
|
),
|
||||||
|
filled: false);
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
double screenWidth = 0;
|
||||||
|
double screenHeight = 0;
|
||||||
|
double blockSizeHorizontal = 0;
|
||||||
|
double blockSizeVertical = 0;
|
||||||
|
double safeAreaHorizontal = 0;
|
||||||
|
double safeAreaVertical = 0;
|
||||||
|
double safeBlockHorizontal = 0;
|
||||||
|
double safeBlockVertical = 0;
|
|
@ -0,0 +1,11 @@
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
|
import '../screen/unit2/login/login.dart';
|
||||||
|
|
||||||
|
|
||||||
|
final GoRouter goRouter = GoRouter(
|
||||||
|
routes: [
|
||||||
|
GoRoute(path: '/',
|
||||||
|
builder: (context,state) => const UniT2Login()
|
||||||
|
)
|
||||||
|
]
|
||||||
|
);
|
|
@ -0,0 +1,36 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_custom_clippers/flutter_custom_clippers.dart';
|
||||||
|
import '../theme-data.dart/colors.dart';
|
||||||
|
|
||||||
|
|
||||||
|
class Wave extends StatelessWidget {
|
||||||
|
final double height;
|
||||||
|
const Wave({Key? key, required this.height}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ClipPath(
|
||||||
|
clipper: WaveClipperOne(),
|
||||||
|
child: Container(
|
||||||
|
height: height,
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
color: primary,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class WaveReverse extends StatelessWidget {
|
||||||
|
final double height;
|
||||||
|
const WaveReverse({Key? key, required this.height}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ClipPath(
|
||||||
|
clipper: WaveClipperTwo(reverse: true),
|
||||||
|
child: Container(
|
||||||
|
height: height,
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
color: primary,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,6 +5,8 @@
|
||||||
import FlutterMacOS
|
import FlutterMacOS
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
import shared_preferences_macos
|
||||||
|
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
|
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,20 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.5"
|
version: "1.0.5"
|
||||||
|
device_frame:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: device_frame
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.0"
|
||||||
|
device_preview:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: device_preview
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.0"
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -50,11 +64,39 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.1"
|
version: "1.3.1"
|
||||||
|
ffi:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: ffi
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.1"
|
||||||
|
file:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "6.1.4"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_custom_clippers:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_custom_clippers
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.0"
|
||||||
|
flutter_form_builder:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_form_builder
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "7.7.0"
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
|
@ -62,11 +104,91 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "2.0.1"
|
||||||
|
flutter_localizations:
|
||||||
|
dependency: transitive
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
|
flutter_svg:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_svg
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.6"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_web_plugins:
|
||||||
|
dependency: transitive
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
|
flutter_zoom_drawer:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_zoom_drawer
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.3"
|
||||||
|
fluttericon:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: fluttericon
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.0"
|
||||||
|
fluttertoast:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: fluttertoast
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "8.1.1"
|
||||||
|
form_builder_validators:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: form_builder_validators
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "8.4.0"
|
||||||
|
freezed_annotation:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: freezed_annotation
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.0"
|
||||||
|
go_router:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: go_router
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "5.2.0"
|
||||||
|
intl:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: intl
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.17.0"
|
||||||
|
js:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: js
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.6.4"
|
||||||
|
json_annotation:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: json_annotation
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.7.0"
|
||||||
lints:
|
lints:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -74,6 +196,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "2.0.1"
|
||||||
|
logging:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: logging
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.0"
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -95,6 +224,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.0"
|
version: "1.8.0"
|
||||||
|
nested:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: nested
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.0"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -102,6 +238,132 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.2"
|
version: "1.8.2"
|
||||||
|
path_drawing:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_drawing
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.1"
|
||||||
|
path_parsing:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_parsing
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.1"
|
||||||
|
path_provider_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_linux
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.7"
|
||||||
|
path_provider_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_platform_interface
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.5"
|
||||||
|
path_provider_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_windows
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.3"
|
||||||
|
petitparser:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: petitparser
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "5.1.0"
|
||||||
|
platform:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: platform
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.0"
|
||||||
|
plugin_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: plugin_platform_interface
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.3"
|
||||||
|
process:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: process
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.2.4"
|
||||||
|
provider:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: provider
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "6.0.4"
|
||||||
|
shared_preferences:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.15"
|
||||||
|
shared_preferences_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_android
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.14"
|
||||||
|
shared_preferences_ios:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_ios
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.1"
|
||||||
|
shared_preferences_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_linux
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.1"
|
||||||
|
shared_preferences_macos:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_macos
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.4"
|
||||||
|
shared_preferences_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_platform_interface
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.0"
|
||||||
|
shared_preferences_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_web
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.4"
|
||||||
|
shared_preferences_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_windows
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.1"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -156,5 +418,27 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.2"
|
version: "2.1.2"
|
||||||
|
win32:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: win32
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.2"
|
||||||
|
xdg_directories:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: xdg_directories
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.2.0+2"
|
||||||
|
xml:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: xml
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "6.1.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.18.5 <3.0.0"
|
dart: ">=2.18.5 <3.0.0"
|
||||||
|
flutter: ">=3.3.0"
|
||||||
|
|
|
@ -36,6 +36,15 @@ dependencies:
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
|
go_router: ^5.2.0
|
||||||
|
flutter_custom_clippers: ^2.0.0
|
||||||
|
flutter_svg: ^1.1.6
|
||||||
|
flutter_form_builder: ^7.7.0
|
||||||
|
form_builder_validators: ^8.4.0
|
||||||
|
fluttericon: ^2.0.0
|
||||||
|
fluttertoast: ^8.1.1
|
||||||
|
device_preview: ^1.1.0
|
||||||
|
flutter_zoom_drawer: ^3.0.3
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
@ -61,9 +70,9 @@ flutter:
|
||||||
|
|
||||||
# To add assets to your application, add an assets section, like this:
|
# To add assets to your application, add an assets section, like this:
|
||||||
assets:
|
assets:
|
||||||
- assets/fonts
|
- assets/svgs/
|
||||||
- assets/pngs
|
- assets/pngs/
|
||||||
- assets/svgs
|
- assets/fonts/
|
||||||
# - images/a_dot_ham.jpeg
|
# - images/a_dot_ham.jpeg
|
||||||
|
|
||||||
# An image asset can refer to one or more resolution-specific "variants", see
|
# An image asset can refer to one or more resolution-specific "variants", see
|
||||||
|
@ -77,17 +86,18 @@ flutter:
|
||||||
# "family" key with the font family name, and a "fonts" key with 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
|
# list giving the asset and other descriptors for the font. For
|
||||||
# example:
|
# example:
|
||||||
# fonts:
|
fonts:
|
||||||
# - family: Schyler
|
- family: LexendDeca
|
||||||
# fonts:
|
fonts:
|
||||||
# - asset: fonts/Schyler-Regular.ttf
|
- asset: assets/fonts/LexendDeca-Regular.ttf
|
||||||
# - asset: fonts/Schyler-Italic.ttf
|
- asset: assets/fonts/LexendDeca-Light.ttf
|
||||||
# style: italic
|
weight: 300
|
||||||
# - family: Trajan Pro
|
- asset: assets/fonts/LexendDeca-Medium.ttf
|
||||||
# fonts:
|
weight: 500
|
||||||
# - asset: fonts/TrajanPro.ttf
|
- asset: assets/fonts/LexendDeca-SemiBold.ttf
|
||||||
# - asset: fonts/TrajanPro_Bold.ttf
|
weight: 600
|
||||||
# weight: 700
|
- asset: assets/fonts/LexendDeca-Bold.ttf
|
||||||
|
weight: 700
|
||||||
#
|
#
|
||||||
# For details regarding fonts from package dependencies,
|
# For details regarding fonts from package dependencies,
|
||||||
# see https://flutter.dev/custom-fonts/#from-packages
|
# see https://flutter.dev/custom-fonts/#from-packages
|
||||||
|
|
Loading…
Reference in New Issue