custom_sebas_package 0.0.1
custom_sebas_package: ^0.0.1 copied to clipboard
Mock package for Auth and API calls
example/lib/main.dart
import 'package:custom_sebas_package/custom_sebas_package.dart';
/* import 'package:example/helper/helper.dart'; */
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final TextEditingController _usernameController = TextEditingController();
final TextEditingController _passwordController = TextEditingController();
/* Helper helper = Helper(); */
CustomSebasPackcage sebas = CustomSebasPackcage();
String auth = '';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Text(
'Ingresa usuario y contraseña',
style: Theme.of(context).textTheme.headlineMedium,
),
TextField(
controller: _usernameController,
decoration: const InputDecoration(
border: OutlineInputBorder(),
labelText: 'Usuario :',
),
),
const SizedBox(height: 10,),
TextField(
controller: _passwordController,
obscureText: true,
decoration: const InputDecoration(
border: OutlineInputBorder(),
labelText: 'Contraseña :',
),
),
Text(auth),
const SizedBox(height: 10,),
],
),
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
/* auth = helper.customAuth(username: _usernameController.text, password: _passwordController.text);
setState(() {
}); */
auth = sebas.customAuth(username: _usernameController.text, password: _passwordController.text);
setState(() {
});
},
tooltip: 'Increment',
child: const Icon(Icons.add),
),
);
}
}