본문 바로가기

Push5

05. Flutter Navigator로 화면 이동하는 방법 오늘 배울 것오늘은 Flutter 에서 기본 제공하는 Navigator를 사용해 화면 간 이동 방법에 대해서 배워보겠습니다. 홈 → 입력 → 리스트 화면을 오가면서 Navigator 메서드(함수) push, pop, pushReplacement, popUntil 을 익혀봅시다. Navigator 메서드 요약표먼저 Navigator의 각 메서드에 대한 설명을 간략히 표로 정리하였습니다. 이를 바탕으로 실습을 진행하겠습니다.메서드설명뒤로가기사용 예push()새 화면 추가ONavigator.push(context, MaterialPageRoute(...))pop()현재 화면 제거-Navigator.pop(context)pushReplacement()현재 화면을 새로운 화면으로 교체❌Navigator.pus.. 2025. 5. 6.
Count the divisors of a number Description: Count the number of divisors of a positive integer n. Random tests go up to n = 500000. Examples (input --> output) 4 --> 3 (1, 2, 4) 5 --> 2 (1, 5) 12 --> 6 (1, 2, 3, 4, 6, 12) 30 --> 8 (1, 2, 3, 5, 6, 10, 15, 30) Solution: 1. Repeat 'n' to generate numbers one after the other. 2. Check whether the generated numbers are divisible by 'n'. 3. Count the number of divisible numbers. fu.. 2022. 3. 12.
Maximum Length Difference Description: You are given two arrays a1 and a2 of strings. Each string is composed with letters from a to z. Let x be any string in the first array and y be any string in the second array. Find max(abs(length(x) − length(y))) If a1 and/or a2 are empty return -1 in each language except in Haskell (F#) where you will return Nothing (None). Example: a1 = ["hoqq", "bbllkw", "oox", "ejjuyyy", "plmii.. 2022. 3. 11.
Abbreviate a Two Word Name Description: Write a function to convert a name into initials. This kata strictly takes two words with one space in between them. The output should be two capital letters with a dot separating them. It should look like this: Sam Harris => S.H patrick feeney => P.F solution: 1. Change the name to all uppercase letters. 2. Separate strings based on space and put them in an array. 3. Put the first .. 2022. 3. 6.
Unique In Order Description: Implement the function unique_in_order which takes as argument a sequence and returns a list of items without any elements with the same value next to each other and preserving the original order of elements. For example: uniqueInOrder('AAAABBBCCDAABBB') == ['A', 'B', 'C', 'D', 'A', 'B'] uniqueInOrder('ABBCcAD') == ['A', 'B', 'C', 'c', 'A', 'D'] uniqueInOrder([1,2,2,3,3]) == [1,2,3].. 2022. 2. 26.