|
@@ -1,5 +1,6 @@
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
+import 'package:namer_app/list.dart';
|
|
import 'package:namer_app/login.dart';
|
|
import 'package:namer_app/login.dart';
|
|
|
|
|
|
void main() {
|
|
void main() {
|
|
@@ -8,15 +9,17 @@ void main() {
|
|
|
|
|
|
final _router = GoRouter(
|
|
final _router = GoRouter(
|
|
routes: [
|
|
routes: [
|
|
- GoRoute(
|
|
|
|
- path: '/',
|
|
|
|
- builder: (context, state) => MyHomePage(),
|
|
|
|
- routes: [
|
|
|
|
- GoRoute(
|
|
|
|
- path: '/login',
|
|
|
|
- builder: (context, state) => const Login(),)
|
|
|
|
- ]
|
|
|
|
- ),
|
|
|
|
|
|
+ GoRoute(path: '/', builder: (context, state) => MyHomePage(), //),
|
|
|
|
+ routes: [
|
|
|
|
+ GoRoute(
|
|
|
|
+ path: 'login',
|
|
|
|
+ builder: (context, state) => LoginPage(),
|
|
|
|
+ ),
|
|
|
|
+ GoRoute(
|
|
|
|
+ path: 'list',
|
|
|
|
+ builder: (context, state) => ListPage(),
|
|
|
|
+ ),
|
|
|
|
+ ]),
|
|
],
|
|
],
|
|
);
|
|
);
|
|
|
|
|
|
@@ -26,22 +29,21 @@ class MyApp extends StatelessWidget {
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp.router(
|
|
return MaterialApp.router(
|
|
- title: 'TelNow Lat',
|
|
|
|
- theme: ThemeData(
|
|
|
|
- useMaterial3: true,
|
|
|
|
- colorScheme: ColorScheme.fromSeed(seedColor: Color.fromARGB(255, 0, 255, 255)),
|
|
|
|
- ),
|
|
|
|
- // home: MyHomePage(),
|
|
|
|
- routerConfig: _router,
|
|
|
|
|
|
+ title: 'TelNow Lat',
|
|
|
|
+ theme: ThemeData(
|
|
|
|
+ useMaterial3: true,
|
|
|
|
+ colorScheme:
|
|
|
|
+ ColorScheme.fromSeed(seedColor: Color.fromARGB(255, 0, 255, 255)),
|
|
|
|
+ ),
|
|
|
|
+ // home: MyHomePage(),
|
|
|
|
+ routerConfig: _router,
|
|
);
|
|
);
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
class MyHomePage extends StatelessWidget {
|
|
class MyHomePage extends StatelessWidget {
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
-
|
|
|
|
return Scaffold(
|
|
return Scaffold(
|
|
backgroundColor: Theme.of(context).colorScheme.primaryContainer,
|
|
backgroundColor: Theme.of(context).colorScheme.primaryContainer,
|
|
body: Column(
|
|
body: Column(
|
|
@@ -50,21 +52,21 @@ class MyHomePage extends StatelessWidget {
|
|
Lang(),
|
|
Lang(),
|
|
Expanded(
|
|
Expanded(
|
|
child: Center(
|
|
child: Center(
|
|
- child: Text('TelNow',
|
|
|
|
- style: TextStyle(color: Colors.orange,
|
|
|
|
- fontSize: 48),
|
|
|
|
- )
|
|
|
|
- ),
|
|
|
|
|
|
+ child: Text(
|
|
|
|
+ 'TelNow',
|
|
|
|
+ style: TextStyle(color: Colors.orange, fontSize: 48),
|
|
|
|
+ )),
|
|
),
|
|
),
|
|
Padding(
|
|
Padding(
|
|
padding: const EdgeInsets.only(left: 120, right: 120),
|
|
padding: const EdgeInsets.only(left: 120, right: 120),
|
|
- child: Text('Silakan pindai QR terlebih dulu untuk mulai menggunakan aplikasi.',
|
|
|
|
- softWrap: true,
|
|
|
|
- textAlign: TextAlign.center,
|
|
|
|
|
|
+ child: Text(
|
|
|
|
+ 'Silakan pindai QR terlebih dulu untuk mulai menggunakan aplikasi.',
|
|
|
|
+ softWrap: true,
|
|
|
|
+ textAlign: TextAlign.center,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
- Expanded(child:
|
|
|
|
- Center(child: Pindai()),
|
|
|
|
|
|
+ Expanded(
|
|
|
|
+ child: Center(child: Pindai()),
|
|
),
|
|
),
|
|
Text('Kebijakan Privasi'),
|
|
Text('Kebijakan Privasi'),
|
|
Text('Versi 4.0.0.0'),
|
|
Text('Versi 4.0.0.0'),
|
|
@@ -87,46 +89,49 @@ class Lang extends StatefulWidget {
|
|
}
|
|
}
|
|
|
|
|
|
class _LangState extends State<Lang> {
|
|
class _LangState extends State<Lang> {
|
|
-
|
|
|
|
-var selectedIndex = 0;
|
|
|
|
|
|
+ var selectedIndex = 0;
|
|
|
|
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
return Padding(
|
|
return Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
padding: const EdgeInsets.all(8.0),
|
|
- child: Row(
|
|
|
|
|
|
+ child: Row(
|
|
children: [
|
|
children: [
|
|
Expanded(child: Container()),
|
|
Expanded(child: Container()),
|
|
- ElevatedButton
|
|
|
|
- (onPressed: (){print('EN');},
|
|
|
|
- style: ButtonStyle(
|
|
|
|
|
|
+ ElevatedButton(
|
|
|
|
+ onPressed: () {
|
|
|
|
+ print('EN');
|
|
|
|
+ },
|
|
|
|
+ style: ButtonStyle(
|
|
foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
|
|
foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
|
|
- backgroundColor: MaterialStateProperty.all<Color>(Colors.white70),
|
|
|
|
|
|
+ backgroundColor:
|
|
|
|
+ MaterialStateProperty.all<Color>(Colors.white70),
|
|
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
|
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
|
- RoundedRectangleBorder(
|
|
|
|
- borderRadius: BorderRadius.only(topLeft: Radius.circular(20), bottomLeft: Radius.circular(20)),
|
|
|
|
- //side: BorderSide(color: Colors.red),
|
|
|
|
-
|
|
|
|
- )
|
|
|
|
- )
|
|
|
|
- ),
|
|
|
|
- child: Text('EN'),
|
|
|
|
|
|
+ RoundedRectangleBorder(
|
|
|
|
+ borderRadius: BorderRadius.only(
|
|
|
|
+ topLeft: Radius.circular(20),
|
|
|
|
+ bottomLeft: Radius.circular(20)),
|
|
|
|
+ //side: BorderSide(color: Colors.red),
|
|
|
|
+ ))),
|
|
|
|
+ child: Text('EN'),
|
|
),
|
|
),
|
|
- ElevatedButton
|
|
|
|
- (onPressed: (){print('ID');},
|
|
|
|
|
|
+ ElevatedButton(
|
|
|
|
+ onPressed: () {
|
|
|
|
+ print('ID');
|
|
|
|
+ },
|
|
style: ButtonStyle(
|
|
style: ButtonStyle(
|
|
- foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
|
|
|
|
|
|
+ foregroundColor:
|
|
|
|
+ MaterialStateProperty.all<Color>(Colors.white),
|
|
backgroundColor: MaterialStateProperty.all<Color>(Colors.red),
|
|
backgroundColor: MaterialStateProperty.all<Color>(Colors.red),
|
|
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
|
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
|
- RoundedRectangleBorder(
|
|
|
|
- borderRadius: BorderRadius.only(topRight: Radius.circular(20), bottomRight: Radius.circular(20)),
|
|
|
|
- side: BorderSide(color: Colors.red),
|
|
|
|
-
|
|
|
|
- )
|
|
|
|
- )
|
|
|
|
- ),
|
|
|
|
|
|
+ RoundedRectangleBorder(
|
|
|
|
+ borderRadius: BorderRadius.only(
|
|
|
|
+ topRight: Radius.circular(20),
|
|
|
|
+ bottomRight: Radius.circular(20)),
|
|
|
|
+ side: BorderSide(color: Colors.red),
|
|
|
|
+ ))),
|
|
child: Text('ID'))
|
|
child: Text('ID'))
|
|
- ],
|
|
|
|
|
|
+ ],
|
|
),
|
|
),
|
|
);
|
|
);
|
|
}
|
|
}
|
|
@@ -160,21 +165,19 @@ class Pindai extends StatelessWidget {
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
return Expanded(
|
|
return Expanded(
|
|
- child: Center(
|
|
|
|
- child: ElevatedButton(
|
|
|
|
- onPressed: () => context.go('/login'),
|
|
|
|
- style: ButtonStyle(
|
|
|
|
- padding: MaterialStateProperty.all<EdgeInsets>(EdgeInsets.all(50)),
|
|
|
|
- foregroundColor: MaterialStateProperty.all<Color>(Colors.black),
|
|
|
|
- shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
|
|
|
- RoundedRectangleBorder(
|
|
|
|
- borderRadius: BorderRadius.circular(18.0),
|
|
|
|
- )
|
|
|
|
- )
|
|
|
|
- ),
|
|
|
|
- child: Text('Pindai QR'),)
|
|
|
|
- ),
|
|
|
|
- );
|
|
|
|
|
|
+ child: Center(
|
|
|
|
+ child: ElevatedButton(
|
|
|
|
+ onPressed: () => context.go('/login'),
|
|
|
|
+ style: ButtonStyle(
|
|
|
|
+ padding: MaterialStateProperty.all<EdgeInsets>(EdgeInsets.all(50)),
|
|
|
|
+ foregroundColor: MaterialStateProperty.all<Color>(Colors.black),
|
|
|
|
+ shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
|
|
|
+ RoundedRectangleBorder(
|
|
|
|
+ borderRadius: BorderRadius.circular(18.0),
|
|
|
|
+ ))),
|
|
|
|
+ child: Text('Pindai QR'),
|
|
|
|
+ )),
|
|
|
|
+ );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -193,26 +196,3 @@ class Pindai extends StatelessWidget {
|
|
// );
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
-
|
|
|
|
-// class Login extends StatelessWidget {
|
|
|
|
-// /// Constructs a [DetailsScreen]
|
|
|
|
-// const Login({Key? key}) : super(key: key);
|
|
|
|
-
|
|
|
|
-// @override
|
|
|
|
-// Widget build(BuildContext context) {
|
|
|
|
-// return Scaffold(
|
|
|
|
-// appBar: AppBar(title: const Text('Details Screen')),
|
|
|
|
-// body: Center(
|
|
|
|
-// child: Column(
|
|
|
|
-// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
-// children: <ElevatedButton>[
|
|
|
|
-// ElevatedButton(
|
|
|
|
-// onPressed: () {print('x');},
|
|
|
|
-// child: const Text('Go back to the Home screen'),
|
|
|
|
-// ),
|
|
|
|
-// ],
|
|
|
|
-// ),
|
|
|
|
-// ),
|
|
|
|
-// );
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|