123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- import 'package:flutter/material.dart';
- import 'package:go_router/go_router.dart';
- import 'package:namer_app/list.dart';
- import 'package:namer_app/login.dart';
- import 'package:namer_app/lang.dart';
- void main() {
- runApp(MyApp());
- }
- final _router = GoRouter(
- routes: [
- GoRoute(path: '/', builder: (context, state) => MyHomePage(), //),
- routes: [
- GoRoute(
- path: 'login',
- builder: (context, state) => LoginPage(),
- ),
- GoRoute(
- path: 'list',
- builder: (context, state) => ListPage(),
- ),
- ]),
- ],
- );
- class MyApp extends StatelessWidget {
- const MyApp({super.key});
- @override
- Widget build(BuildContext context) {
- return MaterialApp.router(
- debugShowCheckedModeBanner: false,
- title: 'TelNow Lat',
- theme: ThemeData(
- useMaterial3: true,
- // colorScheme:
- // ColorScheme.fromSeed(seedColor: Color(0xffD9D9D1)),
- ),
- routerConfig: _router,
- );
- }
- }
- class MyHomePage extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: Container(
- decoration: BoxDecoration(
- gradient: LinearGradient(
- begin: Alignment.topCenter,
- end: Alignment.bottomCenter,
- colors: [
- Color(0xffD9D9D1),
- Color(0xff968E73),
- Color(0xff000000)
- ]),
- image: DecorationImage(
- image: AssetImage("assets/images/building.jpg"),
- fit: BoxFit.cover,
- )),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.end,
- children: [
- Lang(),
- ],
- ),
- Expanded(
- child: Center(
- child: Text(
- 'telnow',
- style: TextStyle(color: Color(0xffFF6600), fontSize: 48),
- )),
- ),
- Padding(
- padding: const EdgeInsets.only(left: 120, right: 120),
- child: Text(
- 'Silakan pindai QR terlebih dulu untuk mulai menggunakan aplikasi.',
- softWrap: true,
- textAlign: TextAlign.center,
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.bold,
- color: Colors.white),
- ),
- ),
- Expanded(
- child: Center(child: Pindai()),
- ),
- Column(
- children: [
- Text('Kebijakan Privasi',
- style: TextStyle(
- fontSize: 16,
- decoration: TextDecoration.underline,
- fontWeight: FontWeight.w800,
- color: Colors.white)),
- Text('Versi 4.0.0.0',
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.w800,
- color: Colors.white,
- ))
- ],
- ),
- Container(
- color: Theme.of(context).colorScheme.primaryContainer,
- )
- ],
- ),
- ),
- );
- }
- }
- class Pindai extends StatelessWidget {
- const Pindai({
- Key? key,
- }) : super(key: key);
- @override
- Widget build(BuildContext context) {
- return ElevatedButton(
- onPressed: () => context.go('/login'),
- style: ButtonStyle(
- padding: MaterialStateProperty.all<EdgeInsets>(EdgeInsets.all(50)),
- foregroundColor: MaterialStateProperty.all<Color>(Colors.black),
- backgroundColor:
- MaterialStateProperty.all(Color.fromARGB(1, 7, 140, 132)),
- shape: MaterialStateProperty.all<RoundedRectangleBorder>(
- RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(18.0),
- ))),
- child: Text(
- 'Pindai QR',
- style: TextStyle(color: Colors.white),
- ),
- );
- }
- }
|