This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| void main() => runApp(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| // This widget is the root of your application. | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| debugShowCheckedModeBanner: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| workflows: | |
| default-workflow: | |
| name: Default Workflow | |
| environment: | |
| flutter: stable | |
| scripts: | |
| - | | |
| # set up debug key.properties | |
| keytool -genkeypair \ | |
| -alias androiddebugkey \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| import 'package:recimix/pages/widgets/customAppBar.dart'; | |
| class HomePage extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| bottomNavigationBar: CustomAppBar(), | |
| body: SingleChildScrollView( | |
| child: Column( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| class CustomAppBar extends StatelessWidget { | |
| final List<BottomNavigationBarItem> bottomBarItems = []; | |
| final bottomNavigationBarItemStyle = TextStyle(fontStyle: FontStyle.normal, color: Colors.black); | |
| CustomAppBar() { | |
| bottomBarItems.add( | |
| BottomNavigationBarItem( | |
| icon: Icon(Icons.home, color: Color(0xFF78AA39),), | |
| title: Text("Home", style: bottomNavigationBarItemStyle,) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static String validateCardNum(String input) { | |
| if (input.isEmpty) { | |
| return Strings.fieldReq; | |
| } | |
| input = getCleanedNumber(input); | |
| if (input.length < 8) { | |
| return Strings.numberIsInvalid; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:convert'; | |
| Map<String, dynamic> parseJwtPayLoad(String token) { | |
| final parts = token.split('.'); | |
| if (parts.length != 3) { | |
| throw Exception('invalid token'); | |
| } | |
| final payload = _decodeBase64(parts[1]); | |
| final payloadMap = json.decode(payload); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // A simple helper function to allow us to immutably add to lists. | |
| extension ImmutableList<T> on List<T> { | |
| List<T> concat(T item) => List<T>.from(<T>[...this, item]); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension StringExtension on String { | |
| String get svg => 'assets/images/svg/$this.svg'; | |
| String get png => 'assets/images/png/$this.png'; | |
| } | |
| // Then you can do this | |
| SvgPicture.asset( | |
| 'back'.svg, | |
| height: 16, | |
| width: 16, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:freezed_annotation/freezed_annotation.dart'; | |
| import 'package:hooks_riverpod/hooks_riverpod.dart'; | |
| part 'request_state_notifier.freezed.dart'; | |
| abstract class RequestStateNotifier<T> extends StateNotifier<RequestState<T>> { | |
| RequestStateNotifier() : super(RequestState.idle()); | |
| //It returns a Future with state if you want to avoid ProviderListener | |
| Future<RequestState<T>> makeRequest(Future<T> Function() function) async { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:quiver/async.dart'; | |
| CountdownTimer _countdownTimer; | |
| Listener( | |
| behavior: HitTestBehavior.translucent, | |
| onPointerMove: (_) { | |
| _countdownTimer = | |
| CountdownTimer(Duration(minutes: 5), Duration(seconds: 1)); | |
| }, |
OlderNewer